From de6af87bd37ce063e08633eca28bf7d644d83bd2 Mon Sep 17 00:00:00 2001 From: acidmanifesto Date: Wed, 17 Nov 2021 20:00:01 +0100 Subject: [PATCH] =?UTF-8?q?fix(Core/Objects):=20increase=20sight=20range?= =?UTF-8?q?=20of=20objects=20&=20correct=20general=20defau=E2=80=A6=20(#91?= =?UTF-8?q?80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rev_1636844514010159481.sql | 3967 +++++++++++++++++ .../game/Entities/Creature/Creature.cpp | 12 +- .../game/Entities/Creature/CreatureData.h | 3 +- .../game/Entities/GameObject/GameObject.cpp | 4 +- src/server/game/Entities/Object/Object.cpp | 41 +- src/server/game/Entities/Object/Object.h | 9 +- .../game/Entities/Object/ObjectDefines.h | 45 +- src/server/game/Globals/ObjectMgr.cpp | 23 +- 8 files changed, 4070 insertions(+), 34 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1636844514010159481.sql diff --git a/data/sql/updates/pending_db_world/rev_1636844514010159481.sql b/data/sql/updates/pending_db_world/rev_1636844514010159481.sql new file mode 100644 index 000000000..a2c68a08e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1636844514010159481.sql @@ -0,0 +1,3967 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1636844514010159481'); + + -- Creating visibilityDistanceType COLUMN +ALTER TABLE `creature_addon` + ADD COLUMN `visibilityDistanceType` TINYINT UNSIGNED NOT NULL AFTER `emote`; + +ALTER TABLE `creature_template_addon` + ADD COLUMN `visibilityDistanceType` TINYINT UNSIGNED NOT NULL AFTER `emote`; + + -- dropping isLarge COLUMN +ALTER TABLE `creature_addon` + DROP COLUMN `isLarge`; + +ALTER TABLE `creature_template_addon` + DROP COLUMN `isLarge`; + +-- Set right visibility for creatures +UPDATE `creature_template_addon` SET `visibilityDistanceType`='5' WHERE `entry` IN ( +18733, +33377, +16128, +28332, +28859, +30342, +30343, +36838, +33293, +34944, +34929, +34775, +34935, +35273, +34802, +33143, +33186, +33816, +33287, +33259, +36598, +39217, +33724, +32295, +36494, +36839, +26310, +13116, +229, +13117, +20000, +24812, +28243, +28781, +31253, +32448, +32487, +32492, +32520, +33108, +33184, +33212, +33364, +33365, +33366, +33367, +33369, +33370, +33388, +33425, +33426, +33453, +33805, +33846, +34144, +34145, +34515, +35819, +36171, +36597, +36612, +36853, +36913, +36954, +36955, +37215, +37540, +37554, +37593, +37755, +38557, +38558, +38569, +38757, +38857, +39123, +39231, +31734, +33885, +35429, +35410, +35415, +35427, +35421, +35419, +34255, +34256, +34257, +37613, +22526, +31920, +37236, +22558, +32004, +37323, +32796, +33850, +33851, +33852, +39166, +39167, +39168, +37957, +37958, +37959, +38265, +38266, +38267, +37611, +38129, +38701, +38702, +38128, +38699, +38700, +39232, +39233, +39234, +34044); + +UPDATE `creature_template_addon` SET `visibilityDistanceType`='4' WHERE `entry` IN ( +37574, +22441, +35336, +35335, +33059, +33063, +33060, +33167, +33062, +33067, +33214, +33109, +33218, +37528, +39746, +39747, +39751, +34793, +34776, +36355, +35069, +33114, +33142, +33139, +33189, +33216, +33090, +34086, +34085, +30300, +37543, +30215, +30476, +32629, +28319, +28366, +32627, +28312, +28094, +27881, +29240, +832, +33264, +31400, +34925, +30288, +31650, +39271, +26287, +27641, +30905, +24646, +24538, +24019, +22522, +14824, +14272, +14269, +7024, +2120, +1493, +392, +90, +24647, +24925, +27447, +27655, +27656, +27838, +27850, +27883, +27894, +27992, +27993, +28586, +29263, +29308, +29747, +29789, +29790, +30181, +30246, +30559, +30588, +30589, +30640, +30646, +30649, +30651, +30690, +30699, +30749, +30832, +31047, +31137, +31243, +31406, +31530, +31565, +31684, +31765, +31782, +31811, +31838, +31844, +31869, +32160, +32200, +32254, +32264, +32277, +32305, +32347, +32400, +32473, +32479, +32480, +32482, +32483, +32491, +32511, +32512, +32513, +32518, +32521, +32630, +32898, +32906, +32913, +32914, +32915, +32933, +33061, +33080, +33146, +33237, +33387, +34161, +34164, +34275, +34564, +34660, +34777, +34778, +35339, +35377, +36168, +36356, +36510, +36737, +36804, +36940, +36941, +36966, +37037, +37069, +37126, +37193, +37194, +37533, +37534, +37970, +37972, +37973, +38019, +38020, +38021, +39420, +40506, +34045, +39805, +39823, +39920, +35413, +35431, +36357, +35433, +34111, +34201, +34186, +30973, +31559, +31560, +31561, +32795, +31533, +31469, +33360, +33392, +33393, +33391, +33910, +34105, +34277, +34162, +34165, +34276, +34566, +35436, +35417, +36358, +37550, +37551, +37549, +38258, +38220, +38219, +38401, +38399, +38400, +35615, +35616, +38784, +38785, +38769, +38770, +38771, +38772); + +UPDATE `creature_template_addon` SET `visibilityDistanceType`='3'WHERE `entry` IN ( +3653, +3669, +3670, +3671, +3673, +3674, +3977, +4829, +4830, +4831, +4832, +4887, +5775, +6243, +7271, +7272, +7795, +7999, +8127, +10415, +11517, +11518, +11519, +11520, +12201, +12203, +12206, +12225, +12236, +12243, +12258, +13282, +13596, +13601, +30681, +33068, +15242, +15687, +15688, +15690, +15691, +15990, +16151, +31070, +32596, +16457, +16477, +16524, +16598, +16800, +16801, +16802, +16887, +17076, +17225, +17256, +17306, +17307, +17308, +17309, +17380, +17535, +17543, +17546, +17547, +17548, +17592, +17653, +18099, +18100, +18101, +18102, +30680, +18168, +18238, +18256, +18257, +18258, +18259, +18352, +18411, +18667, +18707, +18708, +18731, +18732, +18759, +18793, +18794, +18796, +18848, +18945, +18946, +19215, +19224, +19291, +19292, +19336, +19358, +19359, +19382, +19397, +19398, +19399, +19400, +19427, +19554, +19565, +19568, +19622, +27629, +19851, +19872, +19873, +19874, +19875, +20132, +20216, +20243, +20454, +20600, +20769, +20870, +20885, +20886, +20898, +20899, +20900, +20904, +20908, +20911, +20977, +21075, +21101, +21102, +21153, +21159, +21174, +21315, +21404, +21466, +21467, +21497, +21648, +21657, +21690, +21801, +21984, +22112, +22146, +22196, +22268, +22274, +22293, +22295, +22389, +22406, +22422, +22980, +23051, +23558, +24468, +24497, +24510, +10440, +21857, +15689, +22917, +22949, +22950, +22951, +22952, +23375, +25882, +22841, +24850, +19514, +15241, +22077, +23261, +23281, +23282, +23061, +17890, +23345, +24895, +25824, +24882, +23310, +25144, +25744, +23030, +23330, +22849, +19389, +21350, +28416, +28594, +25764, +10184, +29077, +29078, +35470, +16803, +29941, +29332, +32540, +26286, +40626, +40627, +40628, +40870, +31084, +29246, +27996, +29347, +29354, +38332, +38451, +32569, +30674, +30673, +28884, +28544, +28543, +28542, +28525, +24364, +30235, +30500, +36678, +37965, +37967, +37928, +38194, +37996, +37120, +25462, +28765, +26057, +26579, +26716, +26722, +26723, +26731, +26798, +36538, +37190, +24795, +29144, +30021, +30124, +33579, +33666, +33779, +34234, +33236, +33571, +37012, +36808, +37007, +37030, +37146, +37032, +37029, +37027, +37149, +37031, +37034, +37016, +37148, +37026, +37028, +37003, +37033, +37035, +37545, +25765, +26572, +29500, +30228, +29351, +29358, +29931, +30204, +36476, +36794, +36896, +38500, +23472, +28160, +31229, +30682, +32602, +32601, +33113, +36661, +32189, +30330, +29625, +28614, +36508, +30352, +30755, +32725, +33778, +37221, +37225, +37226, +37704, +40188, +40218, +40301, +40416, +23346, +23348, +23340, +23342, +23344, +32422, +32447, +31103, +30648, +30449, +30453, +30451, +28860, +30616, +30272, +36789, +27925, +32186, +32180, +32185, +26841, +38174, +37934, +37950, +38031, +23863, +39814, +40083, +40468, +40029, +40041, +40042, +40043, +40044, +40055, +40469, +40135, +40001, +40417, +40419, +40421, +40423, +40429, +33346, +33344, +33343, +29333, +34286, +34159, +15122, +33572, +33118, +33121, +35451, +39137, +36609, +39120, +39121, +39122, +37799, +39284, +39285, +39286, +39190, +39287, +39288, +39289, +36823, +38579, +39189, +34497, +35350, +35351, +35352, +34496, +35347, +35348, +35349, +36595, +32871, +33070, +36967, +30677, +30461, +29445, +29709, +34606, +34649, +23118, +23119, +28670, +29611, +31334, +31333, +31293, +40100, +33051, +32958, +33689, +33705, +28030, +32535, +30084, +30161, +30099, +28785, +12076, +24025, +27673, +11661, +22848, +4714, +1908, +22876, +26918, +32534, +27691, +29754, +23969, +22853, +23421, +23337, +22883, +11669, +16447, +27957, +23687, +27671, +27665, +28856, +22875, +11659, +4719, +29838, +19950, +29914, +11671, +30877, +23397, +15185, +11666, +24312, +22885, +15977, +36807, +23399, +36805, +27530, +23188, +16243, +29498, +22874, +22877, +27638, +11668, +23400, +32467, +30118, +28642, +36811, +29708, +5359, +11667, +33292, +12100, +22884, +11662, +28157, +31887, +12099, +4716, +24363, +28530, +25286, +23374, +27605, +22873, +22869, +11658, +2726, +15978, +23401, +22855, +36725, +35092, +23403, +23339, +34199, +23394, +23047, +23817, +24747, +28276, +33528, +15324, +11382, +29599, +30592, +31583, +26867, +33280, +33890, +33954, +33134, +34332, +33567, +32446, +29863, +30403, +32442, +30127, +30123, +30121, +30295, +30169, +15491, +30575, +27709, +27753, +27754, +30564, +27619, +9543, +31191, +31193, +31192, +31196, +31194, +31222, +31242, +31271, +31277, +14688, +29453, +29939, +29887, +29872, +29895, +29884, +30014, +30022, +30042, +30043, +30044, +30045, +30020, +30019, +30024, +30025, +30026, +30017, +31814, +27611, +27631, +27766, +27767, +27768, +27769, +27770, +27771, +27772, +27773, +27774, +27775, +27776, +27777, +27778, +27779, +27780, +27781, +27782, +16126, +16163, +17862, +23321, +23387, +23440, +23441, +23543, +23557, +24132, +24169, +24533, +24849, +24987, +25164, +26650, +26926, +27220, +27843, +28063, +28444, +28908, +28909, +29173, +29175, +29199, +29200, +29204, +30595, +31030, +31651, +32201, +32597, +32598, +32600, +39273, +39654, +39837, +39910, +40192, +25334, +27064, +24745, +16027, +33670, +34109, +33836, +21181, +30396, +30399, +29394, +36066, +36065, +28006, +36165, +26608, +26654, +25383, +31301, +30420, +25760, +30393, +23467, +24248, +25508, +25791, +25817, +25748, +25750, +26417, +22910, +30837, +30493, +27268, +38058, +37230, +38444, +15233, +15247, +15312, +15335, +15387, +15339, +15341, +15385, +15428, +15589, +15957, +15963, +27292, +17796, +17797, +20629, +20630, +29986, +31016, +31083, +31050, +15928, +25740, +25755, +25952, +29679, +34815, +35262, +35263, +35264, +25754, +38009, +38010, +38136, +31787, +17454, +23418, +34237, +36565, +36272, +36296, +23512, +24891, +24892, +29647, +28576, +28577, +17965, +26237, +24769, +1284, +1768, +1853, +2748, +2754, +3654, +3886, +3887, +3914, +3936, +3943, +4274, +4275, +4278, +4279, +4715, +4718, +4854, +4968, +5709, +5710, +5711, +6109, +6193, +6196, +6235, +6906, +6907, +6908, +6910, +7023, +7079, +7206, +7228, +7267, +7273, +7275, +7291, +7361, +7797, +7800, +7846, +7977, +8197, +8198, +8443, +8923, +8929, +8933, +8983, +9016, +9017, +9018, +9019, +9024, +9025, +9027, +9028, +9029, +9030, +9031, +9032, +9033, +9041, +9042, +9156, +9196, +9236, +9237, +9319, +9499, +9502, +9537, +9568, +9659, +9736, +9816, +9938, +10076, +10162, +10181, +10220, +10264, +10268, +10339, +10363, +10429, +10430, +10435, +10436, +10437, +10438, +10439, +10502, +10503, +10505, +10508, +10516, +10558, +10584, +10596, +10808, +10809, +10811, +10812, +10813, +10826, +10901, +10942, +10997, +11032, +11143, +11261, +11262, +11352, +11380, +11467, +11486, +11487, +11488, +11489, +11490, +11496, +11501, +11502, +11583, +11622, +11660, +11663, +11664, +11665, +11673, +11897, +11978, +11981, +11982, +11983, +11988, +12017, +12018, +12056, +12057, +12098, +12101, +12118, +12119, +12129, +12142, +12143, +12237, +12259, +12264, +12265, +12397, +12422, +12557, +12457, +12458, +12459, +12467, +12461, +12463, +12464, +12465, +12466, +12468, +12804, +12806, +13020, +13161, +13178, +13221, +13256, +13280, +13419, +13738, +13976, +12460, +14020, +14261, +14262, +14263, +14264, +14265, +14302, +14310, +14321, +14322, +14323, +14324, +14325, +14326, +14327, +14349, +14352, +14353, +14354, +12435, +14435, +14449, +14453, +14456, +14507, +14509, +14510, +14515, +14517, +14601, +14605, +14661, +14834, +14861, +14887, +14888, +14889, +14890, +14943, +14944, +14945, +14946, +14947, +14948, +15192, +15203, +15204, +15205, +15223, +15226, +15227, +15228, +15229, +15230, +15231, +15232, +15234, +15235, +15236, +15237, +15238, +15239, +15240, +15243, +15244, +15245, +15246, +15248, +15249, +15250, +15251, +15252, +15253, +15254, +15255, +15256, +15257, +15258, +15259, +15262, +15263, +15264, +15275, +15276, +15277, +15299, +15300, +15302, +15305, +15311, +15318, +15319, +15320, +15322, +15323, +15325, +15326, +15327, +15329, +15330, +15331, +15332, +15333, +15334, +15336, +15337, +15338, +15340, +15343, +15344, +15345, +15346, +15347, +15348, +15355, +15369, +15370, +15386, +15388, +15389, +15390, +15391, +15392, +15393, +15467, +15471, +15472, +15473, +15481, +15507, +15509, +15510, +15511, +15514, +15516, +15517, +15521, +15527, +15537, +15538, +15543, +15544, +15546, +15550, +15555, +15608, +15628, +15667, +15712, +15718, +15725, +15726, +15727, +15728, +15740, +15741, +15742, +15743, +15744, +15772, +15773, +15775, +15776, +15778, +15800, +15802, +15809, +15896, +15904, +15910, +15929, +15930, +15931, +15932, +15934, +15936, +15952, +15953, +15954, +15956, +15962, +15973, +15974, +15975, +15976, +15979, +15980, +15981, +15984, +15989, +16011, +16017, +16018, +16020, +16021, +16022, +16024, +16025, +16026, +16028, +16029, +16034, +16035, +16038, +16039, +16040, +16041, +16059, +16060, +16061, +16062, +16063, +16064, +16065, +16067, +16097, +16098, +16101, +16102, +16103, +16104, +16125, +16136, +16137, +16142, +16145, +16146, +16152, +16154, +16156, +16157, +16158, +16164, +16165, +16167, +16168, +16172, +16179, +16180, +16181, +16193, +16194, +16215, +16216, +16218, +16244, +16286, +16290, +16363, +16375, +16386, +16398, +16401, +16421, +16431, +16440, +16446, +16448, +16449, +16451, +16452, +16453, +16488, +16505, +16506, +16531, +16573, +16604, +16609, +16697, +16775, +16776, +16777, +16778, +16807, +16808, +16809, +16861, +16939, +17007, +17030, +17075, +17257, +17258, +17310, +17367, +17368, +17369, +17377, +17381, +17388, +17427, +17435, +17451, +17461, +17462, +17468, +17470, +17521, +17533, +17534, +17536, +17537, +17602, +17603, +17611, +17621, +17622, +17623, +17645, +17646, +17650, +17652, +17693, +17711, +17719, +17720, +17725, +17767, +17770, +17772, +17798, +17808, +17818, +17826, +17830, +17838, +17839, +17842, +17848, +17852, +17864, +17871, +17876, +17879, +17880, +17881, +17882, +17888, +17895, +17897, +17898, +17899, +17905, +17906, +17907, +17908, +17916, +17918, +17941, +17942, +17951, +17968, +17975, +17976, +17977, +17978, +17980, +17991, +18040, +18041, +18061, +18096, +18105, +18107, +18192, +18242, +18287, +18338, +18341, +18343, +18344, +18351, +18371, +18373, +18399, +18409, +18472, +18473, +18478, +18479, +18497, +18528, +18625, +18726, +18728, +18729, +18757, +18769, +18770, +20304, +18780, +18805, +18806, +18829, +18831, +18832, +18834, +18835, +18836, +18847, +18925, +18928, +18932, +19044, +19214, +19218, +19219, +19220, +19260, +19433, +19516, +19551, +19577, +19710, +19870, +19876, +19878, +19918, +19922, +19927, +19934, +19951, +20031, +20032, +20033, +20034, +20035, +20036, +20037, +20038, +20039, +20040, +20041, +20042, +20043, +20044, +20045, +20046, +20047, +20048, +20049, +20050, +20051, +20052, +20060, +20062, +20063, +20064, +20075, +20129, +20142, +20555, +20776, +20905, +20909, +20910, +20912, +20923, +21035, +21091, +21104, +21122, +21140, +21148, +21154, +21166, +21170, +21187, +21212, +21213, +21214, +21215, +21216, +21217, +21219, +21222, +21224, +21225, +21226, +21227, +21228, +21251, +21268, +21269, +21270, +21271, +21272, +21273, +21274, +21338, +21351, +21362, +21364, +21456, +21514, +21685, +21686, +21687, +21688, +21689, +21697, +21698, +21785, +21806, +21812, +21845, +21862, +21865, +21873, +21874, +21875, +21913, +21920, +21931, +21932, +21933, +21958, +21964, +21965, +21966, +21976, +22009, +22035, +22036, +22055, +22056, +22064, +22067, +22085, +22089, +22119, +22120, +22122, +22128, +22140, +22207, +22210, +22290, +22296, +22299, +22332, +22335, +22360, +22404, +22405, +22409, +22418, +22448, +22509, +22517, +22844, +22845, +22846, +22847, +22852, +22854, +22856, +22859, +22871, +22878, +22879, +22880, +22881, +22882, +22887, +22898, +22942, +22945, +22947, +22948, +22953, +22954, +22956, +22957, +22960, +22961, +22962, +22964, +22973, +22988, +22996, +22997, +23018, +23035, +23049, +23054, +23059, +23062, +23069, +23076, +23085, +23126, +23147, +23195, +23196, +23197, +23215, +23216, +23222, +23223, +23226, +23230, +23235, +23236, +23237, +23238, +23239, +23260, +23283, +23292, +23293, +23294, +23295, +23296, +23297, +23298, +23299, +23304, +23307, +23314, +23318, +23323, +23328, +23378, +23402, +23404, +23409, +23419, +23420, +23436, +23468, +23500, +23514, +23516, +23517, +23518, +23519, +23523, +23524, +23538, +23539, +23556, +23574, +23575, +23576, +23577, +23578, +23689, +23746, +23754, +23755, +23767, +23771, +23803, +23805, +23810, +23812, +23867, +23877, +23878, +23879, +23880, +23884, +23885, +23889, +23899, +23915, +23916, +23917, +23944, +23947, +23953, +23954, +23957, +23968, +23972, +23980, +24000, +24008, +24027, +24060, +24072, +24083, +24110, +24130, +24143, +24144, +24165, +24166, +24167, +24182, +24183, +24184, +24185, +24193, +24194, +24200, +24201, +24222, +24237, +24239, +24240, +24241, +24242, +24243, +24244, +24245, +24246, +24247, +24289, +24290, +24371, +24381, +24382, +24383, +24384, +24386, +24440, +24446, +24447, +24512, +24514, +24515, +24518, +24527, +24549, +24553, +24554, +24555, +24556, +24557, +24558, +24559, +24560, +24561, +24652, +24664, +24674, +24675, +24682, +24694, +24701, +24707, +24712, +24721, +24722, +24723, +24744, +24762, +24770, +24771, +24778, +24781, +24786, +24787, +24797, +24844, +24859, +24861, +24862, +24865, +24879, +24899, +24910, +24911, +24912, +24914, +24915, +24973, +24983, +24985, +24986, +25006, +25031, +25033, +25038, +25041, +25042, +25158, +25160, +25161, +25165, +25166, +25175, +25214, +25236, +25246, +25289, +25315, +25319, +25330, +25349, +25356, +25364, +25386, +25387, +25431, +25436, +25451, +25453, +25465, +25471, +25472, +25473, +25490, +25492, +25493, +25525, +25588, +25594, +25601, +25640, +25656, +25664, +25665, +25666, +25708, +25723, +25724, +25727, +25732, +25733, +25735, +25741, +25745, +25756, +25757, +25762, +25771, +25772, +25840, +25845, +25846, +25847, +25855, +25860, +25864, +25954, +25955, +25956, +25957, +25958, +25959, +25960, +25964, +25965, +25966, +25971, +25972, +25973, +26041, +26046, +26093, +26094, +26105, +26117, +26120, +26121, +26127, +26129, +26130, +26174, +26175, +26193, +26206, +26230, +26231, +26247, +26260, +26261, +26264, +26265, +26266, +26276, +26277, +26290, +26297, +26298, +26346, +26370, +26373, +26406, +26420, +26444, +26475, +26483, +26495, +26497, +26498, +26499, +26510, +26528, +26529, +26530, +26533, +26559, +26578, +26591, +26612, +26626, +26648, +26665, +26668, +26687, +26690, +26691, +26692, +26693, +26700, +26712, +26736, +26761, +26763, +26783, +26788, +26789, +26794, +26796, +26799, +30497, +30508, +26807, +26808, +26836, +26838, +26840, +26855, +26856, +26857, +26858, +26861, +26872, +26893, +26917, +26925, +26927, +26933, +26967, +27036, +27103, +27104, +27105, +27200, +27201, +27241, +27244, +27249, +27255, +27257, +27270, +27285, +27326, +27327, +27338, +27389, +27390, +27396, +27397, +27413, +27439, +27453, +27455, +27466, +27480, +27513, +27587, +27608, +27654, +27660, +27663, +27679, +27682, +27688, +27689, +27690, +27693, +27702, +27710, +27789, +27801, +27821, +27837, +27847, +27852, +27862, +27869, +27880, +27888, +27905, +27921, +27929, +27931, +27939, +30495, +27956, +27969, +27978, +27979, +27980, +27981, +27982, +28007, +28008, +28015, +28018, +28021, +28064, +28068, +28103, +28135, +28137, +28151, +28174, +28181, +28189, +28190, +28198, +28207, +28208, +28211, +28212, +28230, +28236, +28240, +28246, +28248, +28255, +28256, +28274, +28292, +28293, +28294, +28295, +28296, +28304, +28305, +28316, +28330, +28351, +28352, +28356, +28357, +28377, +28401, +28409, +28439, +28442, +28445, +28466, +28467, +28469, +28478, +28492, +28494, +28495, +28496, +28499, +28520, +28523, +28529, +28535, +28536, +28537, +28539, +28540, +28546, +28548, +28558, +28559, +28560, +28561, +28565, +28587, +28591, +28616, +28617, +28631, +28636, +28639, +28647, +28653, +28654, +28658, +28660, +28662, +28663, +28671, +28672, +28684, +28717, +28729, +28730, +28731, +28738, +28739, +28740, +28741, +28751, +28761, +28762, +28777, +28778, +28780, +28786, +28788, +28789, +28793, +28804, +28823, +28848, +28849, +28873, +28874, +28875, +28890, +28907, +28910, +28911, +28919, +28920, +28921, +28922, +28923, +28924, +28925, +28928, +28929, +28931, +28932, +28952, +28960, +28996, +29048, +29050, +29051, +29062, +29063, +29064, +29066, +29079, +29080, +29096, +29097, +29098, +29099, +29100, +29102, +29103, +29104, +29107, +29108, +29109, +29110, +29112, +29113, +29114, +29117, +29118, +29119, +29120, +29128, +29150, +29153, +29176, +29177, +29178, +29179, +29180, +29181, +29182, +29183, +29190, +29213, +29214, +29216, +29217, +29227, +29228, +29266, +29306, +29310, +29311, +29312, +29313, +29314, +29316, +29349, +29350, +29375, +29424, +29458, +29460, +29469, +29485, +29503, +29543, +29544, +29545, +29558, +29571, +29573, +29592, +29595, +29597, +29629, +29639, +29645, +29694, +29734, +29748, +29753, +29755, +29756, +29773, +29798, +29800, +29805, +29809, +29810, +29815, +29821, +29836, +29870, +29871, +29877, +29878, +29879, +29883, +29893, +29894, +29896, +29897, +29913, +29933, +29934, +29935, +29936, +29974, +29982, +29983, +30023, +30050, +30052, +30055, +30064, +30071, +30082, +30085, +30096, +30103, +30105, +30120, +30122, +30125, +30126, +30138, +30139, +30141, +30142, +30143, +30145, +30150, +30151, +30163, +30188, +30205, +30209, +30210, +30211, +30212, +30236, +30252, +30260, +30262, +30275, +30294, +30298, +30302, +30320, +30327, +30328, +30331, +30332, +30333, +30351, +30366, +30390, +30394, +30406, +30407, +30415, +30421, +30425, +30426, +30427, +30428, +30442, +30443, +30445, +30448, +30452, +30455, +30456, +30462, +30482, +30486, +30502, +30514, +30544, +30545, +30549, +30576, +30593, +30598, +30599, +30614, +30639, +30660, +30670, +30675, +30679, +30688, +30695, +30719, +30742, +30744, +30745, +30752, +30753, +30754, +30858, +30861, +30866, +30867, +30881, +30882, +30883, +30890, +30892, +30893, +30950, +30988, +30995, +30996, +31006, +31011, +31014, +31040, +31044, +31056, +31088, +31089, +31092, +31099, +31105, +31125, +31135, +31139, +31195, +31198, +31204, +31214, +31218, +31219, +31249, +31255, +31264, +31272, +31280, +31312, +31364, +31393, +31399, +31419, +31437, +31467, +31526, +31630, +31640, +31688, +31743, +31767, +31773, +31775, +31817, +31831, +31880, +31892, +32154, +32155, +32159, +32167, +32168, +32173, +32174, +32184, +32195, +32196, +32197, +32199, +32202, +32214, +32215, +32217, +32221, +32229, +32230, +32231, +32232, +32234, +32235, +32237, +32242, +32244, +32245, +32266, +32273, +32292, +32299, +32314, +32318, +32319, +32344, +32348, +32353, +32365, +32376, +32378, +32431, +32443, +32445, +32485, +32486, +32495, +32501, +32522, +32523, +32524, +32544, +32548, +32571, +32576, +32577, +32578, +32579, +32580, +32594, +32608, +32662, +32742, +32768, +32845, +32857, +32865, +32867, +32872, +32873, +32882, +32892, +32893, +32897, +32900, +32901, +32927, +32930, +32934, +32941, +32946, +32948, +32950, +32953, +32955, +33045, +33081, +33087, +33136, +33138, +33140, +33141, +33174, +33192, +33196, +33213, +33221, +33241, +33242, +33244, +33246, +33271, +33282, +33288, +33303, +33325, +33326, +33327, +33328, +33329, +33330, +33331, +33332, +33333, +33337, +33350, +33354, +33355, +33378, +33410, +33411, +33412, +33413, +33430, +33431, +33432, +33433, +33441, +33488, +33500, +33515, +33516, +33524, +33525, +33526, +33527, +33575, +33576, +33651, +33663, +33667, +33687, +33695, +33699, +33716, +33717, +33718, +33719, +33720, +33722, +33754, +33755, +33768, +33772, +33806, +33818, +33819, +33820, +33822, +33823, +33824, +33835, +33838, +33883, +33966, +33983, +33985, +33988, +33990, +33993, +33998, +34000, +34001, +34014, +34015, +34034, +34035, +34049, +34054, +34068, +34069, +34071, +34099, +34119, +34190, +34192, +34194, +34196, +34197, +34198, +34297, +34310, +34313, +34362, +34434, +34441, +34444, +34445, +34447, +34448, +34449, +34450, +34451, +34453, +34454, +34455, +34456, +34458, +34459, +34460, +34461, +34463, +34465, +34466, +34467, +34468, +34469, +34470, +34471, +34472, +34473, +34474, +34475, +34567, +34568, +34607, +34628, +34630, +34657, +34701, +34702, +34703, +34704, +34705, +34720, +34735, +34737, +34738, +34739, +34740, +34741, +34780, +34796, +34797, +34799, +34810, +34813, +34825, +34826, +34862, +34879, +34899, +34921, +34922, +34924, +34928, +34942, +34990, +34992, +34994, +34995, +34996, +35013, +35028, +35029, +35030, +35031, +35032, +35033, +35034, +35036, +35037, +35038, +35039, +35040, +35041, +35042, +35043, +35044, +35045, +35046, +35047, +35048, +35049, +35050, +35051, +35052, +35055, +35089, +35106, +35119, +35143, +35144, +35145, +35176, +35242, +35297, +35299, +35320, +35321, +35368, +35372, +35373, +35459, +35474, +35476, +35482, +35493, +35545, +35547, +35557, +35564, +35569, +35570, +35571, +35572, +35590, +35617, +35651, +35877, +36064, +36128, +36155, +36166, +36189, +36477, +36497, +36502, +36503, +36504, +36561, +36626, +36627, +36633, +36648, +36658, +36701, +36723, +36788, +36791, +36824, +36829, +36840, +36841, +36842, +36844, +36855, +36877, +36881, +36886, +36892, +36893, +36897, +36899, +36907, +36944, +36945, +36946, +36947, +36950, +36957, +36960, +36961, +36968, +36969, +36970, +36971, +36978, +36982, +36990, +36993, +36998, +37004, +37011, +37014, +37017, +37021, +37022, +37023, +37025, +37038, +37098, +37116, +37117, +37119, +37122, +37123, +37124, +37125, +37129, +37144, +37181, +37186, +37188, +37189, +37217, +37223, +37491, +37493, +37494, +37495, +37503, +37530, +37535, +37544, +37546, +37562, +37571, +37595, +37596, +37597, +37662, +37663, +37664, +37665, +37666, +37672, +37695, +37697, +37698, +37702, +37712, +37713, +37728, +37729, +37801, +37813, +37814, +37826, +37827, +37829, +37830, +37832, +37857, +37871, +37878, +37882, +37886, +37890, +37894, +37898, +37902, +37903, +37904, +37920, +37930, +37932, +37935, +37936, +37949, +37952, +37955, +37968, +38001, +38004, +38008, +38052, +38121, +38135, +38153, +38154, +38160, +38161, +38162, +38184, +38188, +38189, +38191, +38216, +38226, +38230, +38236, +38248, +38264, +38285, +38289, +38291, +38292, +38308, +38309, +38310, +38367, +38386, +38433, +38472, +38482, +38485, +38487, +38490, +38493, +38494, +38497, +38503, +38505, +38527, +38528, +38529, +38546, +38547, +38572, +38584, +38587, +38588, +38589, +38606, +38608, +38609, +38610, +38751, +38879, +38883, +38995, +39057, +39091, +39092, +39125, +39372, +39735, +39743, +39744, +39759, +39799, +39820, +39841, +39842, +39863, +39899, +39901, +39903, +40091, +40142, +40146, +40189, +40196, +40681, +40683, +40704, +40842, +30998, +30061, +18436, +18435, +18433, +18058, +18601, +18620, +30999, +20637, +20657, +20636, +20653, +20654, +20645, +20652, +20656, +20663, +20665, +21626, +21590, +21624, +21598, +21621, +21622, +21617, +21588, +21602, +21620, +21600, +21601, +38431, +38585, +38586, +30459, +30457, +30540, +30510, +30397, +30509, +34235, +34113, +38059, +38076, +38091, +38093, +38087, +38092, +38080, +38089, +38090, +38095, +38081, +38084, +38083, +38094, +38086, +38088, +38096, +38445, +30936, +37627, +37636, +31000, +34003, +31535, +31001, +31520, +31311, +38170, +38723, +38733, +39815, +40673, +40674, +40675, +40670, +40671, +40672, +40418, +40420, +40422, +40424, +33886, +33888, +33887, +34247, +33190, +33191, +35490, +37678, +33691, +32187, +31752, +30522, +30097, +30935, +29229, +38073, +38075, +29575, +30903, +38072, +30389, +30991, +33733, +29842, +20521, +31676, +26651, +34218, +29448, +38398, +38630, +38631, +38397, +39000, +39001, +38396, +38632, +38633, +36566, +36572, +22525, +31917, +37233, +22594, +32138, +37466, +22686, +32056, +37377, +22629, +31822, +37363, +22627, +31821, +37341, +22556, +32002, +37321, +22564, +32023, +37343, +22566, +22570, +22563, +32010, +37329, +22593, +32136, +37464, +29446, +29447, +29373, +29417, +29701, +29278, +29268, +29615, +29249, +29242, +29241, +29243, +29286, +29247, +29248, +29991, +29718, +29353, +29362, +29359, +29363, +29355, +29371, +29324, +29356, +29609, +29955, +29940, +30602, +30603, +30601, +29852, +29985, +29357, +29824, +29823, +29831, +29833, +29825, +29828, +29835, +29576, +29837, +29898, +29899, +29900, +29574, +30068, +29388, +29379, +29273, +29274, +29256, +20568, +20597, +20596, +18607, +18621, +20579, +20571, +20581, +20595, +18432, +18434, +20569, +20578, +20575, +20592, +20188, +20169, +20633, +20183, +22172, +20535, +20190, +20548, +20738, +20745, +20737, +20184, +20746, +19893, +19894, +20632, +21558, +21551, +21582, +21581, +21559, +19895, +20531, +20168, +20182, +20267, +20268, +20266, +20318, +20306, +20170, +20690, +20706, +20303, +20299, +20307, +20550, +18778, +21525, +21533, +21537, +20522, +21526, +20319, +21589, +21616, +21618, +21599, +20993, +22171, +22170, +21915, +21712, +22167, +21919, +21918, +21988, +22129, +22300, +30748, +31673, +31674, +31669, +31679, +31656, +25541, +25550, +25555, +25579, +25556, +25549, +25574, +25560, +25578, +24857, +25552, +25562, +25573, +25567, +25557, +26341, +31210, +31211, +31212, +31217, +31359, +30794, +30810, +30774, +30822, +30823, +30819, +30807, +30518, +30521, +30529, +30532, +30398, +30498, +30496, +30788, +30775, +30805, +31657, +31680, +31558, +31373, +31386, +31390, +31391, +31388, +31394, +31537, +31536, +31612, +31616, +31615, +31617, +30972, +31611, +31592, +31538, +31588, +31600, +31593, +31589, +31594, +31601, +31590, +31595, +31602, +31591, +31596, +31603, +31610, +31604, +31585, +31597, +31586, +31599, +31607, +31511, +31368, +31465, +31464, +31509, +31508, +31512, +31510, +31598, +31367, +30925, +30934, +30075, +30087, +31534, +30600, +31501, +31544, +31503, +31546, +31539, +31540, +31502, +31504, +31722, +31547, +31548, +31541, +31543, +32555, +32552, +32554, +32551, +32553, +32313, +32368, +32846, +33694, +33147, +33693, +33149, +33148, +33154, +33692, +33909, +33911, +34296, +34215, +33968, +33234, +33449, +33955, +33995, +33729, +33737, +33732, +33731, +34106, +33789, +34175, +33730, +34152, +33735, +33734, +33741, +34108, +33664, +33668, +33700, +33723, +33757, +33758, +33908, +33773, +33815, +33827, +33829, +33830, +33828, +33832, +33831, +33839, +33967, +33984, +33986, +33989, +33994, +34200, +34166, +34016, +34169, +34171, +33999, +34185, +34229, +34216, +34245, +34226, +34236, +34442, +34443, +35749, +35740, +35741, +35742, +35705, +35706, +35707, +35683, +35684, +35685, +35724, +35725, +35726, +35689, +35690, +35691, +35695, +35696, +35697, +35671, +35672, +35673, +35718, +35719, +35720, +35711, +35712, +35713, +35680, +35681, +35682, +35708, +35709, +35710, +35692, +35693, +35694, +35686, +35687, +35688, +35702, +35703, +35704, +35743, +35744, +35745, +35734, +35735, +35736, +35746, +35747, +35748, +35665, +35666, +35667, +35662, +35663, +35664, +35721, +35722, +35723, +35714, +35715, +35716, +35728, +35729, +35730, +35668, +35669, +35670, +35699, +35700, +35701, +35674, +35675, +35676, +35731, +35732, +35733, +35737, +35738, +35739, +34648, +35655, +35656, +35353, +35354, +35355, +35356, +35357, +35358, +36086, +36083, +36082, +36087, +36088, +35216, +35268, +35269, +35438, +35439, +35440, +35447, +35448, +35449, +35514, +35515, +35516, +35265, +35266, +35267, +35278, +35279, +35280, +35270, +35271, +35272, +35405, +35403, +35517, +35531, +35360, +35541, +35538, +35530, +35536, +35540, +35521, +35528, +35543, +35535, +35537, +35527, +35542, +35520, +35533, +35523, +35525, +35534, +35522, +35524, +35539, +35529, +35532, +35544, +35519, +35518, +35359, +35511, +35512, +35513, +35546, +35559, +35560, +35568, +36085, +36091, +36090, +36089, +35717, +36084, +36067, +37629, +36498, +37677, +36571, +37504, +37505, +37506, +38390, +38549, +38550, +39305, +39306, +39307, +36938, +39302, +39303, +39304, +37720, +37609, +38169, +38722, +38721, +39296, +38074, +37644, +37612, +37637, +38077, +38106, +38296, +38297, +37640, +37656, +37622, +37641, +37642, +38138, +38123, +37639, +38406, +38685, +38686, +38404, +38679, +38680, +38262, +38683, +38684, +38261, +38691, +38692, +38403, +38675, +38676, +38408, +38689, +38690, +38407, +38687, +38688, +38405, +38681, +38682, +38082, +38079, +38061, +38078, +38085, +38108, +38062, +38064, +38063, +38418, +38256, +38693, +38694, +38257, +38677, +38678, +38298, +38299, +38303, +38304, +38000, +38097, +38103, +38349, +38350, +38351, +38352, +38481, +38446, +38602, +38760, +38761, +38098, +38100, +38102, +38480, +38099, +38101, +38479, +38605, +38786, +38787, +39309, +39310, +39311, +38604, +38758, +38759, +39299, +39300, +39301, +38025, +38026, +37731, +37730, +38402, +38582, +38583, +38166, +38724, +38734, +38393, +38628, +38629, +38394, +38625, +38626, +38434, +38435, +38436, +38641, +38773, +38774, +38395, +38634, +38635, +38185, +38788, +38789, +38790, +38388, +38462, +38483, +38590, +39864, +39944, +39945, +39922, +43280, +43281, +43282, +40143, +40144, +40145, +40682, +40684, +26801, +26803, +26800, +26802, +26805, +27949, +27947, +13996, +14401); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index d6718fe19..c6ea81df3 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2503,10 +2503,20 @@ bool Creature::LoadCreaturesAddon(bool reload) // Check if Creature is Large if (cainfo->isLarge) - SetVisibilityDistanceOverride(true); + { + SetVisibilityDistanceOverride(cainfo->visibilityDistanceType); + } if (cainfo->emote != 0) + { SetUInt32Value(UNIT_NPC_EMOTESTATE, cainfo->emote); + } + + // Check if visibility distance different + if (cainfo->visibilityDistanceType != VisibilityDistanceType::Normal) + { + SetVisibilityDistanceOverride(cainfo->visibilityDistanceType); + } //Load Path if (cainfo->path_id != 0) diff --git a/src/server/game/Entities/Creature/CreatureData.h b/src/server/game/Entities/Creature/CreatureData.h index 0be20ab78..6ce556565 100644 --- a/src/server/game/Entities/Creature/CreatureData.h +++ b/src/server/game/Entities/Creature/CreatureData.h @@ -38,7 +38,7 @@ #define MAX_CREATURE_QUEST_ITEMS 6 #define MAX_EQUIPMENT_ITEMS 3 - +enum class VisibilityDistanceType : uint8; // TODO: Implement missing flags from TC in places that custom flags from xinef&pussywizzard use flag values. // EnumUtils: DESCRIBE THIS enum CreatureFlagsExtra : uint32 @@ -342,6 +342,7 @@ struct CreatureAddon uint32 emote; bool isLarge; std::vector auras; + VisibilityDistanceType visibilityDistanceType; }; typedef std::unordered_map CreatureAddonContainer; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index b0289e5b0..82e8d0247 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -400,7 +400,9 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u // Check if GameObject is Large if (goinfo->IsLargeGameObject()) - SetVisibilityDistanceOverride(true); + { + SetVisibilityDistanceOverride(VisibilityDistanceType::Large); + } return true; } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index e0266f43b..8ec4c85c8 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -60,6 +60,16 @@ #include "LuaEngine.h" #endif +constexpr float VisibilityDistances[AsUnderlyingType(VisibilityDistanceType::Max)] = +{ + DEFAULT_VISIBILITY_DISTANCE, + VISIBILITY_DISTANCE_TINY, + VISIBILITY_DISTANCE_SMALL, + VISIBILITY_DISTANCE_LARGE, + VISIBILITY_DISTANCE_GIGANTIC, + MAX_VISIBILITY_DISTANCE +}; + Object::Object() : m_PackGUID(sizeof(uint64) + 1) { m_objectTypeId = TYPEID_OBJECT; @@ -1099,7 +1109,7 @@ WorldObject::WorldObject(bool isWorldObject) : WorldLocation(), #ifdef ELUNA elunaEvents(nullptr), #endif - LastUsedScriptID(0), m_name(""), m_isActive(false), m_isVisibilityDistanceOverride(false), m_isWorldObject(isWorldObject), m_zoneScript(nullptr), + LastUsedScriptID(0), m_name(""), m_isActive(false), m_visibilityDistanceOverride(false), m_isWorldObject(isWorldObject), m_zoneScript(nullptr), _zoneId(0), _areaId(0), _floorZ(INVALID_HEIGHT), _outdoors(false), _liquidData(), _updatePositionData(false), m_transport(nullptr), m_currMap(nullptr), m_InstanceId(0), m_phaseMask(PHASEMASK_NORMAL), m_useCombinedPhases(true), m_notifyflags(0), m_executed_notifies(0) { @@ -1170,12 +1180,15 @@ void WorldObject::setActive(bool on) } } -void WorldObject::SetVisibilityDistanceOverride(bool isVisibilityDistanceOverride) +void WorldObject::SetVisibilityDistanceOverride(VisibilityDistanceType type) { + ASSERT(type < VisibilityDistanceType::Max); if (GetTypeId() == TYPEID_PLAYER) + { return; + } - m_isVisibilityDistanceOverride = isVisibilityDistanceOverride; + m_visibilityDistanceOverride = VisibilityDistances[AsUnderlyingType(type)]; } void WorldObject::CleanupsBeforeDelete(bool /*finalCleanup*/) @@ -1814,15 +1827,25 @@ float WorldObject::GetGridActivationRange() const float WorldObject::GetVisibilityRange() const { if (IsVisibilityOverridden() && GetTypeId() == TYPEID_UNIT) + { return MAX_VISIBILITY_DISTANCE; + } else if (GetTypeId() == TYPEID_GAMEOBJECT) { - if (IsInWintergrasp()) - return VISIBILITY_DIST_WINTERGRASP + VISIBILITY_INC_FOR_GOBJECTS; - else if (IsVisibilityOverridden()) - return MAX_VISIBILITY_DISTANCE; - else - return GetMap()->GetVisibilityRange() + VISIBILITY_INC_FOR_GOBJECTS; + { + if (IsInWintergrasp()) + { + return VISIBILITY_DIST_WINTERGRASP + VISIBILITY_INC_FOR_GOBJECTS; + } + else if (IsVisibilityOverridden()) + { + return MAX_VISIBILITY_DISTANCE; + } + else + { + return GetMap()->GetVisibilityRange() + VISIBILITY_INC_FOR_GOBJECTS; + } + } } else return IsInWintergrasp() ? VISIBILITY_DIST_WINTERGRASP : GetMap()->GetVisibilityRange(); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 079b5375d..a57b5e0f7 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -25,6 +25,7 @@ #include "Map.h" #include "ObjectDefines.h" #include "ObjectGuid.h" +#include "Optional.h" #include "UpdateData.h" #include "UpdateMask.h" #include @@ -842,8 +843,9 @@ public: [[nodiscard]] bool isActiveObject() const { return m_isActive; } void setActive(bool isActiveObject); - [[nodiscard]] bool IsVisibilityOverridden() const { return m_isVisibilityDistanceOverride; } - void SetVisibilityDistanceOverride(bool isVisibilityDistanceOverride); + [[nodiscard]] bool IsFarVisible() const { return m_isFarVisible; } + [[nodiscard]] bool IsVisibilityOverridden() const { return m_visibilityDistanceOverride.has_value(); } + void SetVisibilityDistanceOverride(VisibilityDistanceType type); void SetWorldObject(bool apply); [[nodiscard]] bool IsPermanentWorldObject() const { return m_isWorldObject; } [[nodiscard]] bool IsWorldObject() const; @@ -900,7 +902,8 @@ public: protected: std::string m_name; bool m_isActive; - bool m_isVisibilityDistanceOverride; + bool m_isFarVisible; + Optional m_visibilityDistanceOverride; const bool m_isWorldObject; ZoneScript* m_zoneScript; diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index c8d2ba0c5..b578b5e6a 100644 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -20,19 +20,26 @@ #include "Define.h" -#define CONTACT_DISTANCE 0.5f -#define INTERACTION_DISTANCE 5.5f -#define ATTACK_DISTANCE 5.0f -#define MAX_SEARCHER_DISTANCE 150.0f // pussywizard: replace the use of MAX_VISIBILITY_DISTANCE in searchers, because MAX_VISIBILITY_DISTANCE is quite too big for this purpose -#define MAX_VISIBILITY_DISTANCE 250.0f // max distance for visible objects, experimental -#define VISIBILITY_INC_FOR_GOBJECTS 30.0f // pussywizard -#define VISIBILITY_COMPENSATION 15.0f // increase searchers -#define SPELL_SEARCHER_COMPENSATION 30.0f // increase searchers size in case we have large npc near cell border -#define VISIBILITY_DIST_WINTERGRASP 175.0f -#define SIGHT_RANGE_UNIT 50.0f -#define DEFAULT_VISIBILITY_DISTANCE 90.0f // default visible distance, 90 yards on continents -#define DEFAULT_VISIBILITY_INSTANCE 120.0f // default visible distance in instances, 120 yards -#define DEFAULT_VISIBILITY_BGARENAS 150.0f // default visible distance in BG/Arenas, 150 yards +#define CONTACT_DISTANCE 0.5f +#define INTERACTION_DISTANCE 5.5f +#define ATTACK_DISTANCE 5.0f +#define VISIBILITY_COMPENSATION 15.0f // increase searchers +#define INSPECT_DISTANCE 28.0f +#define VISIBILITY_INC_FOR_GOBJECTS 30.0f // pussywizard +#define SPELL_SEARCHER_COMPENSATION 30.0f // increase searchers size in case we have large npc near cell border +#define TRADE_DISTANCE 11.11f +#define MAX_VISIBILITY_DISTANCE 250.0f // max distance for visible objects, experimental +#define SIGHT_RANGE_UNIT 50.0f +#define MAX_SEARCHER_DISTANCE 150.0f // pussywizard: replace the use of MAX_VISIBILITY_DISTANCE in searchers, because MAX_VISIBILITY_DISTANCE is quite too big for this purpose +#define VISIBILITY_DISTANCE_GIGANTIC 400.0f +#define VISIBILITY_DISTANCE_LARGE 200.0f +#define VISIBILITY_DISTANCE_NORMAL 100.0f +#define VISIBILITY_DISTANCE_SMALL 50.0f +#define VISIBILITY_DISTANCE_TINY 25.0f +#define DEFAULT_VISIBILITY_DISTANCE 100.0f // default visible distance, 100 yards on continents +#define DEFAULT_VISIBILITY_INSTANCE 170.0f // default visible distance in instances, 170 yards +#define VISIBILITY_DIST_WINTERGRASP 175.0f +#define DEFAULT_VISIBILITY_BGARENAS 533.0f // default visible distance in BG/Arenas, roughly 533 yards #define DEFAULT_WORLD_OBJECT_SIZE 0.388999998569489f // player size, also currently used (correctly?) for any non Unit world objects #define DEFAULT_COMBAT_REACH 1.5f @@ -49,6 +56,18 @@ inline uint32 MAKE_PAIR32(uint16 l, uint16 h); inline uint16 PAIR32_HIPART(uint32 x); inline uint16 PAIR32_LOPART(uint32 x); +enum class VisibilityDistanceType : uint8 +{ + Normal = 0, + Tiny = 1, + Small = 2, + Large = 3, + Gigantic = 4, + Infinite = 5, + + Max +}; + uint32 PAIR64_HIPART(uint64 x) { return (uint32)((x >> 32) & UI64LIT(0x00000000FFFFFFFF)); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index abc7d16ab..1841a1803 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -717,8 +717,8 @@ void ObjectMgr::LoadCreatureTemplateAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 7 - QueryResult result = WorldDatabase.Query("SELECT entry, path_id, mount, bytes1, bytes2, emote, isLarge, auras FROM creature_template_addon"); + // 0 1 2 3 4 5 6 7 + QueryResult result = WorldDatabase.Query("SELECT entry, path_id, mount, bytes1, bytes2, emote, visibilityDistanceType, auras FROM creature_template_addon"); if (!result) { @@ -747,7 +747,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() creatureAddon.bytes1 = fields[3].GetUInt32(); creatureAddon.bytes2 = fields[4].GetUInt32(); creatureAddon.emote = fields[5].GetUInt32(); - creatureAddon.isLarge = fields[6].GetBool(); + creatureAddon.visibilityDistanceType = VisibilityDistanceType(fields[6].GetUInt8()); Tokenizer tokens(fields[7].GetString(), ' '); uint8 i = 0; @@ -778,6 +778,11 @@ void ObjectMgr::LoadCreatureTemplateAddons() creatureAddon.emote = 0; } + if (creatureAddon.visibilityDistanceType >= VisibilityDistanceType::Max) + { + LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid visibilityDistanceType (%u) defined in `creature_template_addon`.", entry, AsUnderlyingType(creatureAddon.visibilityDistanceType)); + creatureAddon.visibilityDistanceType = VisibilityDistanceType::Normal; + } ++count; } while (result->NextRow()); @@ -1135,8 +1140,8 @@ void ObjectMgr::LoadCreatureAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 7 - QueryResult result = WorldDatabase.Query("SELECT guid, path_id, mount, bytes1, bytes2, emote, isLarge, auras FROM creature_addon"); + // 0 1 2 3 4 5 6 7 + QueryResult result = WorldDatabase.Query("SELECT guid, path_id, mount, bytes1, bytes2, emote, visibilityDistanceType, auras FROM creature_addon"); if (!result) { @@ -1172,7 +1177,7 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.bytes1 = fields[3].GetUInt32(); creatureAddon.bytes2 = fields[4].GetUInt32(); creatureAddon.emote = fields[5].GetUInt32(); - creatureAddon.isLarge = fields[6].GetBool(); + creatureAddon.visibilityDistanceType = VisibilityDistanceType(fields[6].GetUInt8()); Tokenizer tokens(fields[7].GetString(), ' '); uint8 i = 0; @@ -1203,6 +1208,12 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.emote = 0; } + if (creatureAddon.visibilityDistanceType >= VisibilityDistanceType::Max) + { + LOG_ERROR("sql.sql", "Creature (GUID: %u) has invalid visibilityDistanceType (%u) defined in `creature_addon`.", guid, AsUnderlyingType(creatureAddon.visibilityDistanceType)); + creatureAddon.visibilityDistanceType = VisibilityDistanceType::Normal; + } + ++count; } while (result->NextRow());