diff --git a/data/sql/updates/db_world/2022_03_11_00.sql b/data/sql/updates/db_world/2022_03_11_00.sql new file mode 100644 index 000000000..5b40a328b --- /dev/null +++ b/data/sql/updates/db_world/2022_03_11_00.sql @@ -0,0 +1,29 @@ +-- DB update 2022_03_10_02 -> 2022_03_11_00 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2022_03_10_02'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2022_03_10_02 2022_03_11_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1646684893315098900'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1646684893315098900'); + +UPDATE `quest_template_addon` SET `SpecialFlags` = `SpecialFlags` &~1 WHERE `ID` IN (8166, 8167, 8168, 8169, 8170, 8171, 8105, 8120); + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2022_03_11_00' WHERE sql_rev = '1646684893315098900'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2022_03_11_01.sql b/data/sql/updates/db_world/2022_03_11_01.sql new file mode 100644 index 000000000..21de40ab5 --- /dev/null +++ b/data/sql/updates/db_world/2022_03_11_01.sql @@ -0,0 +1,31 @@ +-- DB update 2022_03_11_00 -> 2022_03_11_01 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2022_03_11_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2022_03_11_00 2022_03_11_01 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1646700419097300800'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1646700419097300800'); + +DELETE FROM `areatrigger_scripts` WHERE `entry` = 3960; +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(3960, 'at_zulgurub_temple_speech'); + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2022_03_11_01' WHERE sql_rev = '1646700419097300800'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2022_03_12_00.sql b/data/sql/updates/db_world/2022_03_12_00.sql new file mode 100644 index 000000000..8514edbdf --- /dev/null +++ b/data/sql/updates/db_world/2022_03_12_00.sql @@ -0,0 +1,29 @@ +-- DB update 2022_03_11_01 -> 2022_03_12_00 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2022_03_11_01'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2022_03_11_01 2022_03_12_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1646883386946549000'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1646883386946549000'); + +UPDATE `creature` SET `MovementType` = 0 WHERE `guid` = 2000058; + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2022_03_12_00' WHERE sql_rev = '1646883386946549000'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2022_03_12_01.sql b/data/sql/updates/db_world/2022_03_12_01.sql new file mode 100644 index 000000000..ee326b6ad --- /dev/null +++ b/data/sql/updates/db_world/2022_03_12_01.sql @@ -0,0 +1,313 @@ +-- DB update 2022_03_12_00 -> 2022_03_12_01 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2022_03_12_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2022_03_12_00 2022_03_12_01 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1646834195276318302'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1646834195276318302'); + +DELETE FROM `quest_request_items_locale` WHERE `id` IN (11001,11005,11006,11007,11016,11023,11026,11027,11029,11030,11036,11051,11056,11058,11059,11060,11061,11066,11070,11071,11073,11074,11078,11079,11098,11099,11100,11101,11108,11118,11120,11126,11130,11132,11133,11134,11137,11138,11139,11140,11145,11146,11147,11153,11154,11155,11156,11157,11164,11166,11171,11178,11180,11184,11188,11190,11192,11193,11195,11198,11200,11201,11202,11205,11209,11218,11219,11224,11231,11236,11237,11238,11239,11242,11243,11244,11245,11246,11247,11249,11250,11252,11255,11269,11277,11278,11284,11288,11289,11290,11291,11292,11300,11322,11326,11327,11328,11329,11332,11333,11339,11340,11346,11348,11349,11354,11355,11358,11359,11360,11361,11362,11363,11364,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,11378,11379,11380,11381,11382,11383,11384,11385,11386,11387,11388,11389,11390,11391,11394,11395,11396,11405,11407,11408,11409,11410,11412,11416,11418,11420,11421,11426,11427,11429,11432,11436,11439,11440,11443,11448,11449,11450,11451,11452,11460,11465,11468,11470,11475,11478,11483,11484,11485,11486,11487,11488,11490,11491,11492,11496,11499,11500,11513,11515,11516,11520,11524,11526,11531,11532,11535,11539,11542,11545,11559,11560,11561,11563,11564,11565,11566,11569,11570,11571,11593,11600,11603,11613,11619,11625,11645,11650,11652,11653,11658,11661,11665,11667,11668,11669,11670,11690,11699,11705,11708,11710,11712,11713,11715,11718,11723,11726,11728,11729,11730,11788,11789,11792,11793,11794,11795,11796,11797,11798,11807,11866,11867,11868,11869,11871,11872,11877,11880,11881,11884,11886,11889,11891,11892,11893,11897,11903,11904,11908,11923,11942,11944,11949,11956,11957,11958,11959,11960,11964,11965,11966,11967,11969,11972,11985,11988,11993,12000) AND `locale` = 'ruRU'; +INSERT INTO `quest_request_items_locale` (`ID`, `locale`, `CompletionText`, `VerifiedBuild`) VALUES +(11001, 'ruRU', 'Какие новости из Сетеккских залов? Ты $Gпобедил:победила; Анзу?', 0), +(11005, 'ruRU', 'Дело сделано, $N? Я бы сам убил этих проклятых жрецов когтя, если бы не мои травмы.', 0), +(11006, 'ruRU', 'Похоже, командир все же не бредил. Принесите мне еще пыли, и я приготовлю вам другой эликсир.', 0), +(11007, 'ruRU', 'Ты $Gуслышал:услышала; мой зов...', 0), +(11016, 'ruRU', 'Нам нужны эти шкуры на подкладку для брони и прочие технические нужды.', 0), +(11023, 'ruRU', 'Ну, как бомбардировка?', 0), +(11026, 'ruRU', 'Мы так думаем, ты $Gиспользовал:использовала; кристалл изгнания, чтобы послать целую кучу этих демонов Пылающего Легиона паковать вещички?!', 0), +(11027, 'ruRU', 'Демоны из этого лагеря постоянно ремонтируют транспортера.$B$BГахку нужна темная руна, чтобы сделать выкованную кристалл с темными рунами.$B$BЕсли у маленького $R нет темной руны, поговори с Кронком. Он делает одну темную руну каждый день!', 0), +(11029, 'ruRU', 'Книга, $N. Ты $Gдостал:достала; её?', 0), +(11030, 'ruRU', 'Ты уже $Gдобыл:добыла; этот магический настой? Для Торкуса-младшего он имеет большое значение.', 0), +(11036, 'ruRU', 'Это поставка от старины Орока?', 0), +(11051, 'ruRU', '$GТакой:Такая; $Gопытный:опытная; $Gпрофессионал:профессионалка; с легкостью сможет изгнать демонов. Правда же, $R?', 0), +(11056, 'ruRU', 'Ты вернулся, $N. Я уже начал думать, что ты меня бросил.', 0), +(11058, 'ruRU', 'Вы уже научились пользоваться апекситовой реликвией? И нам, и Ша\'тарским Небесным Стражам к северу интересно, что вы о них узнали.', 0), +(11059, 'ruRU', 'Мы чураемся жестокости, но, по крайней мере, создание, которое мы послали тебя уничтожить, не было живым.$B$BКстати – голова при тебе?', 0), +(11060, 'ruRU', 'Демоны скоро станут слишком сильными и раздавят нас. Ты сокрушишь их!$B$BТранспортер Шартуула - ключ, но он защищен магическим щитом и демоном, называемым деградером. Мы могущественные, $C, и сделаем особую темную руну, которая даст тебе контроль над деградером. $R, отдай Гахку темную руну, мы вернем закаленную в кристаллах темную руну.$B$BВозьми под свой контроль деградера и овладей как можно большим количеством демонов, прошедших через врата, чтобы остановить их!', 0), +(11061, 'ruRU', 'Этот настой волшебника непременно сделает моих мальчиков еще умнее, чем они есть, и очень поможет им выполнять свои обязанности, как только их возьмут в Стражу Небес Ша\'тар.', 0), +(11066, 'ruRU', 'Ты хорошо $Gпотрудился:потрудилась; для нас, $N. Знай – мы действительно очень тебе благодарны за сменных летунов!', 0), +(11070, 'ruRU', 'Малверик - самый одаренный гонщик, которого я когда-либо видел. Единственное, что удерживает его от высшей позиции орков, - это его безрассудство.', 0), +(11071, 'ruRU', 'Второе место не так уж и плохо, $N. Ты можешь занять место Малверика...', 0), +(11073, 'ruRU', 'Готово, $N? Террок побежден?', 0), +(11074, 'ruRU', 'Для того чтобы призвать Терокка, потребуются вещи от каждого из потомков его величайших врагов.', 0), +(11078, 'ruRU', 'И как дела, $C? Думаю, незачем напоминать тебе, что мы должны постоянно патрулировать эти места с воздуха.', 0), +(11079, 'ruRU', 'Ты $Gпринес:принесла; бич?', 0), +(11098, 'ruRU', 'Что ты $Gпринес:принесла;?', 0), +(11099, 'ruRU', 'Присаживайся, дитя мое.', 0), +(11100, 'ruRU', '<Аркус кивает.>', 0), +(11101, 'ruRU', 'Ты $Gсокрушил:сокрушила; их? Командир?', 0), +(11108, 'ruRU', 'У тебя было настоящее приключение, $N.', 0), +(11118, 'ruRU', 'Эти надоедливые розовые пятнышки уже ушли?', 0), +(11120, 'ruRU', 'Ты $Gпрояснил:прояснила; ту маленькую проблему, о которой мы говорили?', 0), +(11126, 'ruRU', 'Вы изгнали дезертиров из Терамора?', 0), +(11130, 'ruRU', '<Бадд подозрительно смотрит на записку.>$B$BЧто у тебя там, $C?', 0), +(11132, 'ruRU', 'Аааа да, $N, не так ли?$B$BТы еще не $Gвернул:вернула; мою карту?', 0), +(11133, 'ruRU', 'Мне показалось, что из барака доносится смех. Вы раздавали те листовки, которые я вам дал?', 0), +(11134, 'ruRU', 'Вы завершили штурм базы дезертиров?', 0), +(11137, 'ruRU', 'Удалось ли вам выследить их лидера?', 0), +(11138, 'ruRU', 'Добро пожаловать, $C. Что привело вас сюда?', 0), +(11139, 'ruRU', 'Посмотрим, что вам удалось «позаимствовать» у Братства Справедливости.', 0), +(11140, 'ruRU', 'Ваш поиск обломков показал что-нибудь о грузе Справедливости?', 0), +(11145, 'ruRU', 'Удалось ли вам освободить пленников в деревне Черного Копыта?', 0), +(11146, 'ruRU', 'Ты поймал этих хищников?', 0), +(11147, 'ruRU', 'Вы выпустили хищников в деревне Черного Копыта?', 0), +(11153, 'ruRU', 'Мы снова говорим? Это должно означать, что ты это $Gсделал:сделала;! Ты кое-что $Gпоказал:показала; этим гнилым пиратам Северного моря!', 0), +(11154, 'ruRU', 'Пожалуйста, скажи мне, что ты $Gпринес:принесла; гуано!', 0), +(11155, 'ruRU', 'Нет ничего вкуснее нежного мяса черпорога, срезанного с боков!', 0), +(11156, 'ruRU', 'Удалось ли вам остановить атаки Зловещего Тотема?', 0), +(11157, 'ruRU', 'Как продвигаются ваши усилия?', 0), +(11164, 'ruRU', 'Поторопись, $Gдружище:подружка;!$B$BМожет, пошлют меня в Зул\'Аман одного, если я в ближайшее время не отдам ему эти бивни!', 0), +(11166, 'ruRU', 'Я верю, что мои созданные вручную маскировки обеспечили вам адекватную защиту в Зул\'Амане.$B$BВы обследовали эти места для меня? Или мне начать искать замену?', 0), +(11171, 'ruRU', 'Я надеюсь, вы оценили масштабы возможность, что я дал вам, $N.$B$BВы уже позаботились о Малакрассе?', 0), +(11178, 'ruRU', '<Бадд пытается скрыть свое недовольство вашим присутствием.>$B$BСнова ты....$B$BНе знаю, как еще это сказать - я просто слишком занят своими приготовлениями, чтобы держать тебя за ручку.$B$BПоверь, $N, все к лучшему. Возможно, каким-то чудом ты в конечном итоге сможешь создать себе имя.$B$BЕсли да, то ты можешь говорить, что $Gначинал:начинала; с несравненного Бадда Недрека!', 0), +(11180, 'ruRU', 'Что ты $Gузнал:узнала; от духов, обитающих в этом месте?', 0), +(11184, 'ruRU', 'Ты очень $Gдоволен:довольна; собой. $GПришел:Пришла; требовать награду за этого чудовищного хищника?', 0), +(11188, 'ruRU', 'К сожалению, капитану пришлось заставить тебя разозлить протодраконов. Хотя им, кажется, не хватает интеллекта, они все же кажутся благородными существами. Не говоря уже о ситуации, в которую мы попадаем.$B$BОсмелюсь спросить, я...', 0), +(11190, 'ruRU', 'Этак у нас скоро совсем не останется ядер, |3-6($C). А враги наши не спят, особенно в Скорне!$B$BНу теперь-то нам есть, чем стрелять, правда?', 0), +(11192, 'ruRU', 'Тебе удалось достать масло для молотилки?', 0), +(11193, 'ruRU', 'Что будет сегодня? Снук неплохой.', 0), +(11195, 'ruRU', 'Привет, $N! Я слышал, ты $Gработал:работала; в команде Бадда. Ты не доживешь до того момента,когда пожалеешь об этом шаге, друг, я могу тебе это обещать.$B$BЧто там у тебя, $Gдружище:подружка;?', 0), +(11198, 'ruRU', 'Сделайте свой отчет.', 0), +(11200, 'ruRU', 'Что показали твои поиски в Деревне Черного Копыта?', 0), +(11201, 'ruRU', 'Удалось ли найти какие-либо следы?', 0), +(11202, 'ruRU', 'С самого начала было трудно сказать, что именно там происходит. Тебе удалось поджечь эти чумные танки?', 0), +(11205, 'ruRU', 'Вы применили этот фонарик с пользой?', 0), +(11209, 'ruRU', 'Помни, главное - «не возвращайся, пока что-то тебя не укусит».', 0), +(11218, 'ruRU', 'Кажется, мы никогда не закончим возводить эту крепость. Надеюсь, ты несешь нам припасы, необходимые для продолжения строительства.', 0), +(11219, 'ruRU', '$N, вы обещали спасти детей!', 0), +(11224, 'ruRU', 'Это серьезный удар по нам. Я даже не хочу знать, что они там обнаружили.$B$BЭтого достаточно, чтобы я не могла уснуть по ночам, просто пытаясь представить, что это могло быть.', 0), +(11231, 'ruRU', 'После освобождения заключенных в Гьялерброне врайкулы не смогут продолжать свои нечестивые обряды.$B$BТы наша единственная надежда остановить их.', 0), +(11236, 'ruRU', 'Ты $Gуверен:уверена;, что $Gубил:убила; Межена и его некролордов, $C?', 0), +(11237, 'ruRU', 'Что это?! Планы нападения на крепость?$B$BОНИ ПОСЫЛАЮТ ЛЕДЯНОГО ЗМЕЯ?!', 0), +(11238, 'ruRU', 'Ледяной змей и его хозяин мертвы?', 0), +(11239, 'ruRU', 'Святой Свет пронизывает ваши действия и все.$B$BНи одно существо, ни одно место, каким бы злым оно ни было, не может избежать его гнева!', 0), +(11242, 'ruRU', 'У тебя есть что-то хорошее для меня, $N?', 0), +(11243, 'ruRU', 'Судьба мира вполне может быть с нами.', 0), +(11244, 'ruRU', 'Найди этих разведчиков!', 0), +(11245, 'ruRU', 'Подобраться слишком близко к этим башням - верная смерть, пока эти заклинатели там.', 0), +(11246, 'ruRU', 'Одно я знаю наверняка, это то, что я не хочу, чтобы кто-нибудь из этих врайкулов восстал после того, как мы их разрубили!', 0), +(11247, 'ruRU', 'Могу посоветовать, когда поджигаешь здания, не задерживайся в них слишком долго.', 0), +(11249, 'ruRU', 'Чем я могу помочь тебе, дитя мое?', 0), +(11250, 'ruRU', 'Полагаю, раз ты $Gвернулся:вернулась; то Скорн больше нам не угрожает?', 0), +(11252, 'ruRU', 'Рад видеть, что ты $Gздоров:здорова;, $N.$B$BУ нас было столько жертв и мы выдержали.', 0), +(11255, 'ruRU', 'Вложи в него опору, $N! На карту поставлены жизни людей!', 0), +(11269, 'ruRU', 'Ты $Gнашел:нашла; пух гиппогрифов? Ох, как он мне сейчас нужен!', 0), +(11277, 'ruRU', 'Проверь каждый уголок!', 0), +(11278, 'ruRU', 'Ты $Gвернулся:вернулась;!', 0), +(11284, 'ruRU', 'Тебе удалось как-нибудь убрать этого глупого йети с моей шахты?', 0), +(11288, 'ruRU', '<Арес без сознания.>', 0), +(11289, 'ruRU', 'Во имя Света!', 0), +(11290, 'ruRU', 'Военные планы у тебя?', 0), +(11291, 'ruRU', 'Валгард еще стоит на месте? Вот чудеса.$B$BСомневаюсь, что Келлер обошелся без твоей помощи.', 0), +(11292, 'ruRU', 'Надеюсь, ты $Gвернулся:вернулась; не с пустыми руками. Мы же договорились!', 0), +(11300, 'ruRU', 'Где Дегарн? А тайнопись?', 0), +(11322, 'ruRU', 'Вы нашли душевный покой в святыне? Ваша суматоха ушла?', 0), +(11326, 'ruRU', '$N! Какие новости об Улклыке?', 0), +(11327, 'ruRU', 'Какое ужасное место! Даже врайкулы не заслуживают страшной гибели от рук Королевского фармацевтического сообщества.$B$BХорошо, что здесь я в безопасности. Кстати, ты уже $Gотыскал:отыскала; сверток?', 0), +(11328, 'ruRU', 'Эй, чего надо... ик?', 0), +(11329, 'ruRU', 'Ты смотри – кажется, рыбки тебя не сильно покусали. Наживку-то $Gпринес:принесла;?', 0), +(11332, 'ruRU', 'Эти чумные танки уже уничтожены? Эта новая чума нависла над нашими головами, как верная смерть, $C!', 0), +(11333, 'ruRU', 'Где мой мешочек с реагентами?', 0), +(11339, 'ruRU', 'Ты уже $Gвернулся:вернулась;, $N. Ты $Gпринес:принесла; новости о победе?', 0), +(11340, 'ruRU', 'Ты $Gвернулся:вернулась;. Ты несешь весть о победе?', 0), +(11346, 'ruRU', 'Ты $Gдостал:достала; книгу?', 0), +(11348, 'ruRU', 'Руна испытана?', 0), +(11349, 'ruRU', 'Неужели ты несешь мне инструменты?', 0), +(11354, 'ruRU', 'Прошу предъявить ездовой хлыст.', 0), +(11355, 'ruRU', 'Что ты $Gнашел:нашла;?', 0), +(11358, 'ruRU', '$GУзнал:Узнала; что привлекает великанов?', 0), +(11359, 'ruRU', 'Какие новости по Мегалиту?', 0), +(11360, 'ruRU', 'Привет, $N. Вы совершенствовали свои методы пожаротушения? Не забывайте о тренировочной зоне на севере!', 0), +(11361, 'ruRU', 'Вы затушили пожары, $N? Тренировочная зона находится к западу от западного выхода Колючего Холма.', 0), +(11362, 'ruRU', 'Раз мы с вами снова беседуем... То посох у вас.', 0), +(11363, 'ruRU', 'Слышал я, что у вождя вместо на месте рук клинки... Это правда?', 0), +(11364, 'ruRU', 'Вы вернулись. Все центурионы мертвы?', 0), +(11368, 'ruRU', 'Надеюсь, ты знаешь, как сохранить сердце при транспортировке?', 0), +(11369, 'ruRU', 'Так ты хочешь получить награду за вождя Муммаки?', 0), +(11370, 'ruRU', 'Мой клиент уже нервничает. Я думаю, он хочет самолично опробовать тактические уловки Калитреша на своих недругах как можно скорее.', 0), +(11371, 'ruRU', 'Как твоя борьба с мирмидонами Резервуара Кривого Клыка?', 0), +(11372, 'ruRU', 'Церемония все ближе.', 0), +(11373, 'ruRU', 'Немногие знают, что магические силы Шаффара напрямую связаны с его амулетом. Без него он бессилен.$B$BЕсли амулет у тебя, то Шаффар, очевидно, мертв.', 0), +(11374, 'ruRU', 'Представляешь, каково это – быть навечно заключенным в камне.', 0), +(11375, 'ruRU', 'Не могу себе представить, как можно поймать шепот, но профессор заявил, что ты все поймешь, как только увидишь его.$B$BВозможно, тебе понадобится что-то вроде \'бормотографа\'...', 0), +(11376, 'ruRU', 'Инструкторы, они все мертвы? Нет?$B$BРазве я не говорил не возвращаться, если ты их всех не $Gубил:убила;?', 0), +(11377, 'ruRU', 'Какой восхитительный аромат! Неужто наяву?', 0), +(11378, 'ruRU', 'Голова охотника эпохи... как можно прийти к решению, что они хотят, чтобы он был установлен на их стене?$B$BИ даже тогда, чтобы самому не охотиться на зверя, что говорят своим друзьям, когда спрашивают, как прошел бой?$B$BНаверное, он соврет.', 0), +(11379, 'ruRU', 'Ну, как, удался мой экспериментик?', 0), +(11380, 'ruRU', 'Ну как, повезло?', 0), +(11381, 'ruRU', 'Что за божественный запах?', 0), +(11382, 'ruRU', 'На твоем месте я был бы очень осторожен с путешествиями во времени. Вы же не хотите случайно сделать что-то, например, убить одного из своих предков, а затем случайно стереть себя из настоящего!', 0), +(11383, 'ruRU', 'Я чувствую не все повелители разломов ещё мертвы. Вернись когда сделаешь, $C.', 0), +(11384, 'ruRU', 'Вы сбились с пути и не нашли Ботанику? Нет. Ее не заметить нельзя... Это же в Крепости Бурь на восточном краю Пустоверти.', 0), +(11385, 'ruRU', 'О чем нам говорить, когда еще не все заклинатели мертвы?', 0), +(11386, 'ruRU', 'Технология проекции сама по себе не сложна, но мощность этой модели – настоящий прорыв!', 0), +(11387, 'ruRU', '<Преследователь пустоты смотрит в явном замешательстве.>$B$BЕще не все разрушители уничтожены.', 0), +(11388, 'ruRU', 'Должно быть, очень опасно вмешиваться непосредственно в дела Древних Богов.$B$BЛучше ты, чем я!', 0), +(11389, 'ruRU', 'Вы не знаете, как добраться до Крепости Бурь и Аркатраца? На восток через Пустоверть, а затем взлетайте или падайте, выбор за вами.', 0), +(11390, 'ruRU', 'А? Ты $Gзакончил:закончила; со всей этой перевозкой?', 0), +(11391, 'ruRU', 'Горгульи ?! Я их там видел! Ты обо всех $Gпозаботился:позаботилась;?$B$BЧто ждет мир, если дварф не может даже копать будучи атакованным.', 0), +(11394, 'ruRU', 'Не знаю, $C, похоже, ты их еще не $Gуничтожил:уничтожила;.', 0), +(11395, 'ruRU', 'Какое странное устройство! Дай-ка я на него взгляну...', 0), +(11396, 'ruRU', 'Не знаю, $N. Я думаю, тебе нужно уничтожить еще несколько.', 0), +(11405, 'ruRU', 'Эта земля совсем свежая. В ней ползают черви, пытаясь спрятаться поглубже.', 0), +(11407, 'ruRU', 'Ты уже всем $Gрассказал:рассказала; о Хмельном фестивале?', 0), +(11408, 'ruRU', 'Ты уже всем $Gрассказал:рассказала; о Хмельном фестивале? И, что самое главное, о чудесном тролльском пиве?', 0), +(11409, 'ruRU', 'У тебя есть навыки вождения на баранах?', 0), +(11410, 'ruRU', 'Мне не терпится опробовать новую приманку.$B$BТебе повезло с Ледяным Плавником?', 0), +(11412, 'ruRU', 'Ты $Gвидел:видела; беспорядок, который устроил гоблин? Надеюсь, ты не слишком $Gлихачил:лихачила;.', 0), +(11416, 'ruRU', 'Ты $Gпринес:принесла; глаза орлицы?', 0), +(11418, 'ruRU', 'Подействовали ли чары Адерана?', 0), +(11420, 'ruRU', 'Ты $Gнашел:нашла; руководство?', 0), +(11421, 'ruRU', 'Горит ли Драконий Череп?', 0), +(11426, 'ruRU', 'Ты $Gнашел:нашла; устройство?', 0), +(11427, 'ruRU', 'Это еще зачем? Я что, похож на няньку?', 0), +(11429, 'ruRU', 'Ты смотри, на тебе ни царапинки. Можно подумать, ты ни с кем не $Gсражался:сражалась;!', 0), +(11432, 'ruRU', '$N, мне кажется неправдоподобным, что ты разобрался со спящими врайкулами. Вернись, когда сделаешь это.', 0), +(11436, 'ruRU', '<Зорек поднимает бровь, глядя на вас.>', 0), +(11439, 'ruRU', 'Привет, $N. Вы совершенствовали свою технику пожаротушения? Не забывайте о тренировочной зоне на юге!', 0), +(11440, 'ruRU', 'Привет, $N. Вы совершенствовали свою технику пожаротушения? Не забывайте о тренировочной зоне на западе!', 0), +(11443, 'ruRU', 'Ну, где припасы?', 0), +(11448, 'ruRU', '<Станвад недовольно ворчит.>', 0), +(11449, 'ruRU', 'Вы затушили пожары, $N? Тренировочная зона находится к западу от Брилла.', 0), +(11450, 'ruRU', 'Вы затушили пожары, $N? Тренировочная зона находится к югу.', 0), +(11451, 'ruRU', 'Ой, стишок?', 0), +(11452, 'ruRU', '$N, какие новости ты $Gпринес:принесла;?', 0), +(11460, 'ruRU', 'Это важное упражнение, $N. Если ты хочешь стать сокольником, ты $Gдолжен:должна; научиться кормить свою птицу.', 0), +(11465, 'ruRU', 'Всегда корми сокола до отвала перед охотой – иначе он съест всю добычу!', 0), +(11468, 'ruRU', 'Всегда корми сокола до отвала перед охотой – иначе он съест всю добычу!', 0), +(11470, 'ruRU', 'Ты $Gхозяин:хозяйка; сокола, $N. Пошли его на добычу яиц.', 0), +(11475, 'ruRU', 'Этап первый: вернуть Уолту инструменты.', 0), +(11478, 'ruRU', 'Новости от Донни?', 0), +(11483, 'ruRU', 'Ты $Gпринес:принесла; строительные материалы?', 0), +(11484, 'ruRU', 'Очень скоро мы снова займемся раскопками!', 0), +(11485, 'ruRU', 'Не принимай близко слова этих скептиков!', 0), +(11486, 'ruRU', 'Что это?', 0), +(11487, 'ruRU', 'Что это у тебя там?', 0), +(11488, 'ruRU', 'Я не помню, чтобы заказывал услуги по очистке ... ну да, я аптекарь Хаммел.$B$B... подождите, что это значит? Думаешь, эти бессмысленные бумаги могут меня остановить? Ха!', 0), +(11490, 'ruRU', 'Иди и смотри в шар, $Gсмертный:смертная;', 0), +(11491, 'ruRU', 'Не беспокойся о нем, $N. Он переживет это ...', 0), +(11492, 'ruRU', 'Да, $C, должен признаться, я не был уверен, что увижу тебя снова.', 0), +(11496, 'ruRU', 'Вы активировали кристалл, $N?', 0), +(11499, 'ruRU', 'Терраса Магистров, наверное, очень опасное место – слишком уж близко оно к Солнечному Колодцу.$B$BНадеюсь, вы не передумали?', 0), +(11500, 'ruRU', 'Вы еще не разобрались с сестрами.', 0), +(11513, 'ruRU', 'Ты $Gдобыл:добыла; контейнеры с маной?', 0), +(11515, 'ruRU', 'Эти уроды - позор для нашей расы. Уничтожь их, $N.', 0), +(11516, 'ruRU', 'Готово, $N? Мы должны помешать дальнейшим силам Легиона усилить Кель\'тас.', 0), +(11520, 'ruRU', 'Честное слово, $N, мне не до разговоров.$B$BПросто дай мне знать, когда добудешь корни.', 0), +(11524, 'ruRU', 'Удалось перенастроить стражей, $N?', 0), +(11526, 'ruRU', 'Тссс, |3-6($C). К югу от портала – сторожевой пост Легиона.', 0), +(11531, 'ruRU', 'О мой Бог! Что у тебя там, $N?', 0), +(11532, 'ruRU', 'Ты $Gисполнил:исполнила; свое поручение, $N?', 0), +(11535, 'ruRU', 'Ты $Gсобрал:собрала; руду, которая мне нужна?', 0), +(11539, 'ruRU', 'Задание выполнено, $N?', 0), +(11542, 'ruRU', 'Задание выполнено, $N?', 0), +(11545, 'ruRU', 'Вы хотите сделать пожертвование?', 0), +(11559, 'ruRU', 'Что это? Кто это?$B$BТы ведь $C! Разве ты можешь говорить по-нашему?', 0), +(11560, 'ruRU', 'Если не спасти головастиков, все остальное не будет иметь значения: у мурлоков Зимних Плавников не останется шансов выжить!', 0), +(11561, 'ruRU', 'Если ты уже $Gубил:убила; так много этих предателей Зимних Плавников, почему же, когда я смотрю на ту сторону, я по-прежнему вижу их в таком количестве?', 0), +(11563, 'ruRU', 'Если у тебя нет головы Глрггла, мне с тобой говорить не о чем!', 0), +(11564, 'ruRU', 'Ну что, $Gпринес:принесла; мне мясистые сальники?', 0), +(11565, 'ruRU', 'У тебя с собой мой запасной костюм, $N?', 0), +(11566, 'ruRU', 'Ну что, $C, дело сделано? Клаксимус мертв?', 0), +(11569, 'ruRU', 'Ну, где же ключ?$B$BНет, до других мне нет никакого дела. Я просто хочу убраться отсюда!', 0), +(11570, 'ruRU', 'Да, $N? Чем могу служить?', 0), +(11571, 'ruRU', 'Тебе удалось наполнить ракушку паром Скольдера?', 0), +(11593, 'ruRU', 'Я просто смотрел на трупы наших павших,которые все ещё там.$B$BИсполни свой долг перед Ордой, $C!', 0), +(11600, 'ruRU', 'Удалось поговорить с Вильямом, $N?', 0), +(11603, 'ruRU', '<Старик смотрит на вас с отсутствующим выражением лица.>', 0), +(11613, 'ruRU', 'Тебе сопутствовал успех, $N? Квалдиры - жестокие воины. От них пощады не жди.', 0), +(11619, 'ruRU', 'Удалось ли тебе одолеть Геймела, $C?', 0), +(11625, 'ruRU', 'Ты уже $Gраздобыл:раздобыла; трезубец?', 0), +(11645, 'ruRU', 'Ну что, все мои припасы целы, |3-6($R)? Я без этих вещей как без рук!', 0), +(11650, 'ruRU', 'Что-то мне не верится, будто ты уже $Gсобрал:собрала; все, что было перечислено в списке!', 0), +(11652, 'ruRU', 'Так? Что произошло?', 0), +(11653, 'ruRU', 'Вы $Gуверен:уверена;, что $Gиспытал:испытала; бластер на этих чудовищных тварях?', 0), +(11658, 'ruRU', 'Нам понадобится куча их одежд, если мы хотим, чтобы все сработало как надо. Я тебе не швея... нужно просто подобрать что-нибудь, что тебе подойдет!$B$BА потом я просто пройдусь прикосновением своего инженерного гения, и вуаля! – ты будешь выглядеть так, как и надо для твоей роли.', 0), +(11661, 'ruRU', 'Орабуса нужно уничтожить!', 0), +(11665, 'ruRU', 'Ну, чего, еще не $Gвыудил:выудила; крока из Стоков?', 0), +(11667, 'ruRU', 'Скажи – ты ее $Gпоймал:поймала;? Пожалуйста, скажи, что ты поймал эту щучью дочь!', 0), +(11668, 'ruRU', 'Как улов, $Gпарень:девочка;?', 0), +(11669, 'ruRU', 'Эти сквернокровики – чудо эволюции. Выживает в любых водах, даже в лаве, и единственным природным врагом этой рыбки является рыбак.$B$BНу, как, удалось рыбку поймать?', 0), +(11670, 'ruRU', 'Ну, как? Ты $Gсделал:сделала; грязное дело и $Gподставил:подставила; орков с заставы Бор\'горока?', 0), +(11690, 'ruRU', 'Убери их с полей, кишащих Плетью!', 0), +(11699, 'ruRU', 'Ну что, все удалось собрать?', 0), +(11705, 'ruRU', '<Адский Крик приподнимает бровь, глядя на вас.>$B$BЧто по Варидусу Свежевателю?', 0), +(11708, 'ruRU', 'Эй, привет!', 0), +(11710, 'ruRU', 'Понадобится много запчастей, чтобы заставить эту штуку работать!$B$BСкажите, вы ведь достали все, что нужно, да?', 0), +(11712, 'ruRU', 'Сколько механогномов тебе удалось проклясть, $C?', 0), +(11713, 'ruRU', 'Ну что, все воронки отмечены на карте?', 0), +(11715, 'ruRU', 'Ну что, удалось тебе набрать топлива?', 0), +(11718, 'ruRU', 'Неси шкуры как можно быстрее! Я не смогу без них закончить подготовку машины!', 0), +(11723, 'ruRU', 'Ну что, ты уже $Gиспользовал:использовала; \'Страх и ужас 5000\'?', 0), +(11726, 'ruRU', 'Удалось найти мешочки со специями?', 0), +(11728, 'ruRU', 'Ну что, нашли пленку?', 0), +(11729, 'ruRU', 'Эй!', 0), +(11730, 'ruRU', 'Сколько роботов тебе удалось перепрограммировать?', 0), +(11788, 'ruRU', 'Они ликвидированы?', 0), +(11789, 'ruRU', 'Противоядие... ты $Gнашел:нашла; его?', 0), +(11792, 'ruRU', 'Ты уже $Gвернулся:вернулась;, $N?', 0), +(11793, 'ruRU', 'Тебя прислал предвестник Вуренн?', 0), +(11794, 'ruRU', 'Ты $Gвыполнил;выполнила; свою задачу, $N?', 0), +(11795, 'ruRU', 'Тебе удалось найти все знаки?', 0), +(11796, 'ruRU', 'Ты уже $Gзатопил:затопила; обломки?', 0), +(11797, 'ruRU', 'Ты $Gвернулся:вернулась;. Надеюсь, ты $Gсократил:сократила; численность врага.', 0), +(11798, 'ruRU', 'Джинки сказала мне, что ты придешь. Ну что, дело сделано?', 0), +(11807, 'ruRU', 'Поклонитесь огню Острогорья!', 0), +(11866, 'ruRU', 'Да, уши отлично подойдут!', 0), +(11867, 'ruRU', 'Будь то искатели сокровищ или кровожадные охотники с пустошей, любые существа, поддерживающие Эрнестуэя и осмеливающиеся губить нашу драгоценную природу, объявляются врагами Д.Э.Г.О.Ж. Если вам случится убить кого-то из этих грязных прихвостней Эрнестуэя, принесите мне доказательства их смерти, и получите в награду благословение друидов Д.Э.Г.О.Ж.!', 0), +(11868, 'ruRU', 'Природа требует справедливости!', 0), +(11869, 'ruRU', 'Мы делаем ужасную работу, $N.', 0), +(11871, 'ruRU', 'Мы устроим этим животным достойное погребение...', 0), +(11872, 'ruRU', 'Несешь мне хорошие новости?', 0), +(11877, 'ruRU', 'Планы у тебя?', 0), +(11880, 'ruRU', 'Ты $Gпровел:провела; считывание? Этот гном опять будет на меня орать, если я не доставлю ему его драгоценных данных.', 0), +(11881, 'ruRU', 'Не подведи! Я рассчитываю на тебя.', 0), +(11884, 'ruRU', 'Ты их $Gуничтожил:уничтожила;?', 0), +(11886, 'ruRU', 'Что удалось узнать?', 0), +(11889, 'ruRU', 'Ты $Gвернулся:вернулась;. Надеюсь, хорошие новости?', 0), +(11891, 'ruRU', 'Удалось ли тебе узнать их тайны?', 0), +(11892, 'ruRU', 'Борейский мясник убит?', 0), +(11893, 'ruRU', 'Тотем заряжен?', 0), +(11897, 'ruRU', 'Нам нужно замедлить работу Плети, иначе Крепость Отваги будет захвачена.', 0), +(11903, 'ruRU', 'Надеюсь, ты хорошенько $Gизбил:избила; этих упырей?', 0), +(11904, 'ruRU', 'Руда, $N, безопасна?', 0), +(11908, 'ruRU', 'Тебе удалось вынести мою книгу?', 0), +(11923, 'ruRU', 'Ловля факелов - это очень весело, тебе не кажется? Но будь $Gосторожен:осторожна;! Ты же не хочешь опалиться!', 0), +(11942, 'ruRU', 'Я смотрю, ты не торопишься? Не знаю, сколько еще я смогу сдерживать этого лича.', 0), +(11944, 'ruRU', 'Ты $Gдобился:добилась; прогресса? Мы здесь в безвыходном положении.', 0), +(11949, 'ruRU', 'Мы сражаемся изо всех сил, $N. Мы не дадим этим Квадирам ни пяди, заставив их дорого заплатить за это.', 0), +(11956, 'ruRU', 'Ты $Gвернулся:вернулась;, $N. Тебе удалось добыть талисман?', 0), +(11957, 'ruRU', 'Сарагоса не должна остаться в живых!', 0), +(11958, 'ruRU', 'В последнее время природное равновесие то и дело нарушается!$B$BНадеюсь, ты сумеешь помочь нам пережить изменение нашего образа жизни!', 0), +(11959, 'ruRU', 'Это кровь Логуна или твоя, $R?', 0), +(11960, 'ruRU', 'Ну, сколько щенков можно было спасти за такое короткое время?', 0), +(11964, 'ruRU', 'Пламенный привет тебе, почтенный |3-6($C). Добро пожаловать на священную землю праздника Огненного солнцеворота.', 0), +(11965, 'ruRU', 'Ты $Gсплотил:сплотила; выживших, $N?', 0), +(11966, 'ruRU', 'Пламенный привет тебе, почтенный $C. Добро пожаловать на священную землю праздника Огненного солнцеворота.', 0), +(11967, 'ruRU', 'У тебя есть вести для меня, $N?', 0), +(11969, 'ruRU', 'Ты $Gвстречался:встречалась; с Керистразой?', 0), +(11972, 'ruRU', 'Приветствую, $N. Вид у тебя встревоженный – но возрадуйся! Повелитель Холода побежден!', 0), +(11985, 'ruRU', 'Удалось убить командира?', 0), +(11988, 'ruRU', 'Ты $Gсобрал:собрала; все обломки краеугольного камня?', 0), +(11993, 'ruRU', 'Что ты $Gузнал:узнала;?', 0), +(12000, 'ruRU', 'Ты снова здесь. Что тебе удалось узнать?', 0); + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2022_03_12_01' WHERE sql_rev = '1646834195276318302'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2022_03_12_02.sql b/data/sql/updates/db_world/2022_03_12_02.sql new file mode 100644 index 000000000..ffc4f4c38 --- /dev/null +++ b/data/sql/updates/db_world/2022_03_12_02.sql @@ -0,0 +1,30 @@ +-- DB update 2022_03_12_01 -> 2022_03_12_02 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2022_03_12_01'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2022_03_12_01 2022_03_12_02 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1646846735975559298'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1646846735975559298'); + +-- Fixed ruRU translation of the objectives field for quest 5624 +UPDATE `quest_template_locale` SET `VerifiedBuild`=0, `Objectives`='Разыщите стражника Робертса и исцелите его раны, пользуясь "Малым исцелением" (уровень 2), а затем одарите его заклинанием "Слово силы: Стойкость", после чего вернитесь в Златоземье к жрице Жозетте.' WHERE `ID`=5624 AND `locale`='ruRU'; + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2022_03_12_02' WHERE sql_rev = '1646846735975559298'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2022_03_12_03.sql b/data/sql/updates/db_world/2022_03_12_03.sql new file mode 100644 index 000000000..af9084830 --- /dev/null +++ b/data/sql/updates/db_world/2022_03_12_03.sql @@ -0,0 +1,68 @@ +-- DB update 2022_03_12_02 -> 2022_03_12_03 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2022_03_12_02'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2022_03_12_02 2022_03_12_03 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1646152616244410200'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1646152616244410200'); + +SET @NPC := 35073; +SET @GOSSIP_MENU_ID := 10631; +SET @ITEM_ID := 46978; +SET @QUEST_ID := 14111; + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = @NPC; + +DELETE FROM `gossip_menu_option` WHERE `MenuId` = @GOSSIP_MENU_ID; +INSERT INTO `gossip_menu_option` (`MenuId`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`) VALUES +(@GOSSIP_MENU_ID, 0, 0, "I lost my totems. Can you help?", 35455, 1, 1, 0, 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` = @GOSSIP_MENU_ID; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15, @GOSSIP_MENU_ID, 0, 0, 0, 8, 0, @QUEST_ID, 0, 0, 0, 0, '', 'Requires Quest Completed'), +(15, @GOSSIP_MENU_ID, 0, 0, 0, 2, 0, @ITEM_ID, 1, 0, 1, 0, '', 'Requires Missing Item'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC, 0, 0, 1, 62, 0, 100, 0, @GOSSIP_MENU_ID, 0, 0, 0, 56, @ITEM_ID, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Farsser Eannu - On Gossip Option Select - Add Item to Player'), +(@NPC, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Farsser Eannu - On Gossip Option Select - Close Gossip'); + +SET @NPC := 35068; +SET @GOSSIP_MENU_ID := 10630; +SET @QUEST_ID := 14100; + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = @NPC; + +DELETE FROM `gossip_menu_option` WHERE `MenuId` = @GOSSIP_MENU_ID; +INSERT INTO `gossip_menu_option` (`MenuId`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`) VALUES +(@GOSSIP_MENU_ID, 0, 0, "I lost my totems. Can you help?", 35455, 1, 1, 0, 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` = @GOSSIP_MENU_ID; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15, @GOSSIP_MENU_ID, 0, 0, 0, 8, 0, @QUEST_ID, 0, 0, 0, 0, '', 'Requires Quest Completed'), +(15, @GOSSIP_MENU_ID, 0, 0, 0, 2, 0, @ITEM_ID, 1, 0, 1, 0, '', 'Requires Missing Item'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC, 0, 0, 1, 62, 0, 100, 0, @GOSSIP_MENU_ID, 0, 0, 0, 56, @ITEM_ID, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Gotura Fourwinds - On Gossip Option Select - Add Item to Player'), +(@NPC, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Gotura Fourwinds - On Gossip Option Select - Close Gossip'); + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2022_03_12_03' WHERE sql_rev = '1646152616244410200'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2022_03_13_00.sql b/data/sql/updates/db_world/2022_03_13_00.sql new file mode 100644 index 000000000..f2eae76cb --- /dev/null +++ b/data/sql/updates/db_world/2022_03_13_00.sql @@ -0,0 +1,46 @@ +-- DB update 2022_03_12_03 -> 2022_03_13_00 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2022_03_12_03'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2022_03_12_03 2022_03_13_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1647042448722452100'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1647042448722452100'); + +UPDATE `creature_template` SET `unit_flags` = `unit_flags`|256|512|33554432, `AIName` = 'SmartAI', `flags_extra` = `flags_extra`|2|64 WHERE `entry` IN (14307, 14309, 14310, 14311, 14312); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (14307, 14309, 14310, 14311, 14312) AND `source_type` = 0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(14307, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 11, 22653, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - On Respawn - Cast \'Serverside - Drakonid Spawner\''), +(14307, 0, 1, 0, 1, 0, 100, 1, 1000, 60000, 60000, 60000, 0, 11, 22680, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - Out of Combat - Cast \'Spawn Chromatic Drakonid\' (No Repeat)'), +(14309, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 11, 22653, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - On Respawn - Cast \'Serverside - Drakonid Spawner\''), +(14309, 0, 1, 0, 1, 0, 100, 1, 1000, 60000, 60000, 60000, 0, 11, 22680, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - Out of Combat - Cast \'Spawn Chromatic Drakonid\' (No Repeat)'), +(14310, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 11, 22653, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - On Respawn - Cast \'Serverside - Drakonid Spawner\''), +(14310, 0, 1, 0, 1, 0, 100, 1, 1000, 60000, 60000, 60000, 0, 11, 22680, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - Out of Combat - Cast \'Spawn Chromatic Drakonid\' (No Repeat)'), +(14311, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 11, 22653, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - On Respawn - Cast \'Serverside - Drakonid Spawner\''), +(14311, 0, 1, 0, 1, 0, 100, 1, 1000, 60000, 60000, 60000, 0, 11, 22680, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - Out of Combat - Cast \'Spawn Chromatic Drakonid\' (No Repeat)'), +(14312, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 11, 22653, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - On Respawn - Cast \'Serverside - Drakonid Spawner\''), +(14312, 0, 1, 0, 1, 0, 100, 1, 1000, 60000, 60000, 60000, 0, 11, 22680, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Black Drakonid Spawner - Out of Combat - Cast \'Spawn Chromatic Drakonid\' (No Repeat)'); + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_spawn_drakonid'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(22659, 'spell_spawn_drakonid'); + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2022_03_13_00' WHERE sql_rev = '1647042448722452100'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index cdb3523a4..2aca121e6 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -64,7 +64,7 @@ void SmartWaypointMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty."); LOG_INFO("server.loading", " "); return; } @@ -136,7 +136,7 @@ void SmartAIMgr::LoadSmartAIFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 SmartAI scripts. DB table `smart_scripts` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 SmartAI scripts. DB table `smart_scripts` is empty."); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index cf937c257..5d12cd8db 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2455,7 +2455,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() if (sAchievementCriteriaStore.GetNumRows() == 0) { - LOG_INFO("server.loading", ">> Loaded 0 achievement criteria."); + LOG_WARN("server.loading", ">> Loaded 0 achievement criteria."); LOG_INFO("server.loading", " "); return; } @@ -2604,7 +2604,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() if (sAchievementStore.GetNumRows() == 0) { - LOG_INFO("server.loading", ">> Loaded 0 achievement references."); + LOG_WARN("server.loading", ">> Loaded 0 achievement references."); LOG_INFO("server.loading", " "); return; } @@ -2635,7 +2635,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2776,7 +2776,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 completed achievements. DB table `character_achievement` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 completed achievements. DB table `character_achievement` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2818,7 +2818,7 @@ void AchievementGlobalMgr::LoadRewards() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2939,7 +2939,7 @@ void AchievementGlobalMgr::LoadRewardLocales() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 achievement reward locale strings. DB table `achievement_reward_locale` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 achievement reward locale strings. DB table `achievement_reward_locale` is empty"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Addons/AddonMgr.cpp b/src/server/game/Addons/AddonMgr.cpp index 8a9c58772..396babbda 100644 --- a/src/server/game/Addons/AddonMgr.cpp +++ b/src/server/game/Addons/AddonMgr.cpp @@ -42,7 +42,7 @@ namespace AddonMgr QueryResult result = CharacterDatabase.Query("SELECT name, crc FROM addons"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 known addons. DB table `addons` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 known addons. DB table `addons` is empty!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 2d88c21d1..e31fd234c 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -493,7 +493,7 @@ void AuctionHouseMgr::LoadAuctionItems() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -538,7 +538,7 @@ void AuctionHouseMgr::LoadAuctions() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 auctions. DB table `auctionhouse` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 auctions. DB table `auctionhouse` is empty."); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index acce71e3e..3ac05c425 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -157,7 +157,7 @@ void ArenaTeamMgr::LoadArenaTeams() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 arena teams. DB table `arena_team` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 arena teams. DB table `arena_team` is empty!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index aee60c95a..fbb612410 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -663,7 +663,7 @@ void BattlegroundMgr::LoadBattleMastersEntry() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index faef47175..b04cc8301 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -662,10 +662,7 @@ enum BG_AV_CreaturePlace AV_CPLACE_TRIGGER18 = 319, AV_CPLACE_TRIGGER19 = 320, - AV_CPLACE_MAX = 321, - - AV_CPLACE_A_BOSS = 381, - AV_CPLACE_H_BOSS = 445 + AV_CPLACE_MAX = 321 }; //x, y, z, o diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp index 3eb76c783..bd1f0a952 100644 --- a/src/server/game/Chat/Channels/ChannelMgr.cpp +++ b/src/server/game/Chat/Channels/ChannelMgr.cpp @@ -56,7 +56,7 @@ void ChannelMgr::LoadChannels() QueryResult result = CharacterDatabase.Query("SELECT channelId, name, team, announce, ownership, password FROM channels ORDER BY channelId ASC"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 channels. DB table `channels` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 channels. DB table `channels` is empty."); return; } @@ -171,7 +171,7 @@ void ChannelMgr::LoadChannelRights() QueryResult result = CharacterDatabase.Query("SELECT name, flags, speakdelay, joinmessage, delaymessage, moderators FROM channels_rights"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 Channel Rights!"); + LOG_WARN("server.loading", ">> Loaded 0 Channel Rights!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 4fb805da1..2d7afe538 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -935,7 +935,7 @@ void ConditionMgr::LoadConditions(bool isReload) if (!result) { - LOG_ERROR("server.loading", ">> Loaded 0 conditions. DB table `conditions` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 conditions. DB table `conditions` is empty!"); return; } diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index d31413cc6..e9fbe974a 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -63,7 +63,7 @@ namespace DisableMgr if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 disables. DB table `disables` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 disables. DB table `disables` is empty!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 1c065e554..a276a9746 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -25,8 +25,6 @@ #include "SpellMgr.h" #include "TransportMgr.h" #include "World.h" -#include -#include #include typedef std::map AreaFlagByAreaID; @@ -190,8 +188,6 @@ DBCStorage sWMOAreaTableStore(WMOAreaTableEntryfmt); DBCStorage sWorldMapAreaStore(WorldMapAreaEntryfmt); DBCStorage sWorldMapOverlayStore(WorldMapOverlayEntryfmt); -std::unordered_map sFlyByCameraStore; - typedef std::list StoreProblemList; uint32 DBCFileCount = 0; @@ -635,278 +631,10 @@ void LoadDBCStores(const std::string& dataPath) exit(1); } - LoadM2Cameras(dataPath); - LOG_INFO("server.loading", ">> Initialized {} data stores in {} ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime)); LOG_INFO("server.loading", " "); } -// Convert the geomoetry from a spline value, to an actual WoW XYZ -G3D::Vector3 TranslateLocation(G3D::Vector4 const* DBCPosition, G3D::Vector3 const* basePosition, G3D::Vector3 const* splineVector) -{ - G3D::Vector3 work; - float x = basePosition->x + splineVector->x; - float y = basePosition->y + splineVector->y; - float z = basePosition->z + splineVector->z; - float const distance = std::sqrt((x * x) + (y * y)); - float angle = std::atan2(x, y) - DBCPosition->w; - - if (angle < 0) - { - angle += 2 * float(M_PI); - } - - work.x = DBCPosition->x + (distance * std::sin(angle)); - work.y = DBCPosition->y + (distance * cos(angle)); - work.z = DBCPosition->z + z; - return work; -} - -// Number of cameras not used. Multiple cameras never used in 3.3.5 -bool readCamera(M2Camera const* cam, uint32 buffSize, M2Header const* header, CinematicCameraEntry const* dbcentry) -{ - char const* buffer = reinterpret_cast(header); - - FlyByCameraCollection cameras; - FlyByCameraCollection targetcam; - - G3D::Vector4 DBCData; - DBCData.x = dbcentry->base_x; - DBCData.y = dbcentry->base_y; - DBCData.z = dbcentry->base_z; - DBCData.w = dbcentry->base_o; - - // Read target locations, only so that we can calculate orientation - for (uint32 k = 0; k < cam->target_positions.timestamps.number; ++k) - { - // Extract Target positions - if (cam->target_positions.timestamps.offset_elements + sizeof(M2Array) > buffSize) - { - return false; - } - M2Array const* targTsArray = reinterpret_cast(buffer + cam->target_positions.timestamps.offset_elements); - if (targTsArray->offset_elements + sizeof(uint32) > buffSize || cam->target_positions.values.offset_elements + sizeof(M2Array) > buffSize) - { - return false; - } - uint32 const* targTimestamps = reinterpret_cast(buffer + targTsArray->offset_elements); - M2Array const* targArray = reinterpret_cast(buffer + cam->target_positions.values.offset_elements); - - if (targArray->offset_elements + sizeof(M2SplineKey) > buffSize) - { - return false; - } - M2SplineKey const* targPositions = reinterpret_cast const*>(buffer + targArray->offset_elements); - - // Read the data for this set - uint32 currPos = targArray->offset_elements; - for (uint32 i = 0; i < targTsArray->number; ++i) - { - if (currPos + sizeof(M2SplineKey) > buffSize) - { - return false; - } - // Translate co-ordinates - G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->target_position_base, &targPositions->p0); - - // Add to vector - FlyByCamera thisCam; - thisCam.timeStamp = targTimestamps[i]; - thisCam.locations.x = newPos.x; - thisCam.locations.y = newPos.y; - thisCam.locations.z = newPos.z; - thisCam.locations.w = 0.0f; - targetcam.push_back(thisCam); - targPositions++; - currPos += sizeof(M2SplineKey); - } - } - - // Read camera positions and timestamps (translating first position of 3 only, we don't need to translate the whole spline) - for (uint32 k = 0; k < cam->positions.timestamps.number; ++k) - { - // Extract Camera positions for this set - if (cam->positions.timestamps.offset_elements + sizeof(M2Array) > buffSize) - { - return false; - } - M2Array const* posTsArray = reinterpret_cast(buffer + cam->positions.timestamps.offset_elements); - if (posTsArray->offset_elements + sizeof(uint32) > buffSize || cam->positions.values.offset_elements + sizeof(M2Array) > buffSize) - { - return false; - } - uint32 const* posTimestamps = reinterpret_cast(buffer + posTsArray->offset_elements); - M2Array const* posArray = reinterpret_cast(buffer + cam->positions.values.offset_elements); - if (posArray->offset_elements + sizeof(M2SplineKey) > buffSize) - { - return false; - } - M2SplineKey const* positions = reinterpret_cast const*>(buffer + posArray->offset_elements); - - // Read the data for this set - uint32 currPos = posArray->offset_elements; - for (uint32 i = 0; i < posTsArray->number; ++i) - { - if (currPos + sizeof(M2SplineKey) > buffSize) - { - return false; - } - // Translate co-ordinates - G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->position_base, &positions->p0); - - // Add to vector - FlyByCamera thisCam; - thisCam.timeStamp = posTimestamps[i]; - thisCam.locations.x = newPos.x; - thisCam.locations.y = newPos.y; - thisCam.locations.z = newPos.z; - - if (targetcam.size() > 0) - { - // Find the target camera before and after this camera - FlyByCamera lastTarget; - FlyByCamera nextTarget; - - // Pre-load first item - lastTarget = targetcam[0]; - nextTarget = targetcam[0]; - for (uint32 j = 0; j < targetcam.size(); ++j) - { - nextTarget = targetcam[j]; - if (targetcam[j].timeStamp > posTimestamps[i]) - { - break; - } - - lastTarget = targetcam[j]; - } - - float x = lastTarget.locations.x; - float y = lastTarget.locations.y; - // float z = lastTarget.locations.z; - - // Now, the timestamps for target cam and position can be different. So, if they differ we interpolate - if (lastTarget.timeStamp != posTimestamps[i]) - { - uint32 timeDiffTarget = nextTarget.timeStamp - lastTarget.timeStamp; - uint32 timeDiffThis = posTimestamps[i] - lastTarget.timeStamp; - float xDiff = nextTarget.locations.x - lastTarget.locations.x; - float yDiff = nextTarget.locations.y - lastTarget.locations.y; - // float zDiff = nextTarget.locations.z - lastTarget.locations.z; - x = lastTarget.locations.x + (xDiff * (float(timeDiffThis) / float(timeDiffTarget))); - y = lastTarget.locations.y + (yDiff * (float(timeDiffThis) / float(timeDiffTarget))); - // z = lastTarget.locations.z + (zDiff * (float(timeDiffThis) / float(timeDiffTarget))); - } - float xDiff = x - thisCam.locations.x; - float yDiff = y - thisCam.locations.y; - thisCam.locations.w = std::atan2(yDiff, xDiff); - - if (thisCam.locations.w < 0) - { - thisCam.locations.w += 2 * float(M_PI); - } - } - - cameras.push_back(thisCam); - positions++; - currPos += sizeof(M2SplineKey); - } - } - - sFlyByCameraStore[dbcentry->id] = cameras; - return true; -} - -void LoadM2Cameras(const std::string& dataPath) -{ - sFlyByCameraStore.clear(); - LOG_INFO("server.loading", ">> Loading Cinematic Camera files"); - - uint32 oldMSTime = getMSTime(); - for (uint32 i = 0; i < sCinematicCameraStore.GetNumRows(); ++i) - { - if (CinematicCameraEntry const* dbcentry = sCinematicCameraStore.LookupEntry(i)) - { - std::string filename = dataPath.c_str(); - filename.append(dbcentry->filename); - - // Replace slashes - size_t loc = filename.find("\\"); - while (loc != std::string::npos) - { - filename.replace(loc, 1, "/"); - loc = filename.find("\\"); - } - - // Replace mdx to .m2 - loc = filename.find(".mdx"); - if (loc != std::string::npos) - { - filename.replace(loc, 4, ".m2"); - } - - std::ifstream m2file(filename.c_str(), std::ios::in | std::ios::binary); - if (!m2file.is_open()) - { - continue; - } - - // Get file size - m2file.seekg(0, std::ios::end); - std::streamoff const fileSize = m2file.tellg(); - - // Reject if not at least the size of the header - if (static_cast(fileSize) < sizeof(M2Header)) - { - LOG_ERROR("dbc", "Camera file {} is damaged. File is smaller than header size", filename); - m2file.close(); - continue; - } - - // Read 4 bytes (signature) - m2file.seekg(0, std::ios::beg); - char fileCheck[5]; - m2file.read(fileCheck, 4); - fileCheck[4] = 0; - - // Check file has correct magic (MD20) - if (strcmp(fileCheck, "MD20")) - { - LOG_ERROR("dbc", "Camera file {} is damaged. File identifier not found", filename); - m2file.close(); - continue; - } - - // Now we have a good file, read it all into a vector of char's, then close the file. - std::vector buffer(fileSize); - m2file.seekg(0, std::ios::beg); - if (!m2file.read(buffer.data(), fileSize)) - { - m2file.close(); - continue; - } - m2file.close(); - - // Read header - M2Header const* header = reinterpret_cast(buffer.data()); - - if (header->ofsCameras + sizeof(M2Camera) > static_cast(fileSize)) - { - LOG_ERROR("dbc", "Camera file {} is damaged. Camera references position beyond file end", filename); - continue; - } - - // Get camera(s) - Main header, then dump them. - M2Camera const* cam = reinterpret_cast(buffer.data() + header->ofsCameras); - if (!readCamera(cam, fileSize, header, dbcentry)) - { - LOG_ERROR("dbc", "Camera file {} is damaged. Camera references position beyond file end", filename); - } - } - } - LOG_INFO("server.loading", ">> Loaded {} cinematic waypoint sets in {} ms", (uint32)sFlyByCameraStore.size(), GetMSTimeDiffToNow(oldMSTime)); -} - SimpleFactionsList const* GetFactionTeamList(uint32 faction) { FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 7294c32d5..b2913e309 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -26,7 +26,6 @@ #include typedef std::list SimpleFactionsList; -typedef std::vector FlyByCameraCollection; SimpleFactionsList const* GetFactionTeamList(uint32 faction); @@ -183,9 +182,7 @@ extern DBCStorage sVehicleSeatStore; extern DBCStorage sWMOAreaTableStore; //extern DBCStorage sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates extern DBCStorage sWorldMapOverlayStore; -extern std::unordered_map sFlyByCameraStore; void LoadDBCStores(const std::string& dataPath); -void LoadM2Cameras(const std::string& dataPath); #endif diff --git a/src/server/game/DataStores/M2Stores.cpp b/src/server/game/DataStores/M2Stores.cpp new file mode 100644 index 000000000..ca8f5008f --- /dev/null +++ b/src/server/game/DataStores/M2Stores.cpp @@ -0,0 +1,259 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "DBCStores.h" +#include "Common.h" +#include "Containers.h" +#include "Log.h" +#include "M2Structure.h" +#include "M2Stores.h" +#include "World.h" +#include +#include +#include +#include + +typedef std::vector FlyByCameraCollection; +std::unordered_map sFlyByCameraStore; + +// Convert the geomoetry from a spline value, to an actual WoW XYZ +G3D::Vector3 TranslateLocation(G3D::Vector4 const* DBCPosition, G3D::Vector3 const* basePosition, G3D::Vector3 const* splineVector) +{ + G3D::Vector3 work; + float x = basePosition->x + splineVector->x; + float y = basePosition->y + splineVector->y; + float z = basePosition->z + splineVector->z; + float const distance = std::sqrt((x * x) + (y * y)); + float angle = std::atan2(x, y) - DBCPosition->w; + + if (angle < 0) + angle += 2 * float(M_PI); + + work.x = DBCPosition->x + (distance * sin(angle)); + work.y = DBCPosition->y + (distance * cos(angle)); + work.z = DBCPosition->z + z; + return work; +} + +// Number of cameras not used. Multiple cameras never used in 3.3.5 +bool readCamera(M2Camera const* cam, uint32 buffSize, M2Header const* header, CinematicCameraEntry const* dbcentry) +{ + char const* buffer = reinterpret_cast(header); + + FlyByCameraCollection cameras; + FlyByCameraCollection targetcam; + + G3D::Vector4 DBCData; + DBCData.x = dbcentry->Origin.X; + DBCData.y = dbcentry->Origin.Y; + DBCData.z = dbcentry->Origin.Z; + DBCData.w = dbcentry->OriginFacing; + + // Read target locations, only so that we can calculate orientation + for (uint32 k = 0; k < cam->target_positions.timestamps.number; ++k) + { + // Extract Target positions + if (cam->target_positions.timestamps.offset_elements + sizeof(M2Array) > buffSize) + return false; + M2Array const* targTsArray = reinterpret_cast(buffer + cam->target_positions.timestamps.offset_elements); + if (targTsArray->offset_elements + sizeof(uint32) > buffSize || cam->target_positions.values.offset_elements + sizeof(M2Array) > buffSize) + return false; + uint32 const* targTimestamps = reinterpret_cast(buffer + targTsArray->offset_elements); + M2Array const* targArray = reinterpret_cast(buffer + cam->target_positions.values.offset_elements); + + if (targArray->offset_elements + sizeof(M2SplineKey) > buffSize) + return false; + M2SplineKey const* targPositions = reinterpret_cast const*>(buffer + targArray->offset_elements); + + // Read the data for this set + uint32 currPos = targArray->offset_elements; + for (uint32 i = 0; i < targTsArray->number; ++i) + { + if (currPos + sizeof(M2SplineKey) > buffSize) + return false; + // Translate co-ordinates + G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->target_position_base, &targPositions->p0); + + // Add to vector + FlyByCamera thisCam; + thisCam.timeStamp = targTimestamps[i]; + thisCam.locations.Relocate(newPos.x, newPos.y, newPos.z, 0.0f); + targetcam.push_back(thisCam); + targPositions++; + currPos += sizeof(M2SplineKey); + } + } + + // Read camera positions and timestamps (translating first position of 3 only, we don't need to translate the whole spline) + for (uint32 k = 0; k < cam->positions.timestamps.number; ++k) + { + // Extract Camera positions for this set + if (cam->positions.timestamps.offset_elements + sizeof(M2Array) > buffSize) + return false; + M2Array const* posTsArray = reinterpret_cast(buffer + cam->positions.timestamps.offset_elements); + if (posTsArray->offset_elements + sizeof(uint32) > buffSize || cam->positions.values.offset_elements + sizeof(M2Array) > buffSize) + return false; + uint32 const* posTimestamps = reinterpret_cast(buffer + posTsArray->offset_elements); + M2Array const* posArray = reinterpret_cast(buffer + cam->positions.values.offset_elements); + if (posArray->offset_elements + sizeof(M2SplineKey) > buffSize) + return false; + M2SplineKey const* positions = reinterpret_cast const*>(buffer + posArray->offset_elements); + + // Read the data for this set + uint32 currPos = posArray->offset_elements; + for (uint32 i = 0; i < posTsArray->number; ++i) + { + if (currPos + sizeof(M2SplineKey) > buffSize) + return false; + // Translate co-ordinates + G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->position_base, &positions->p0); + + // Add to vector + FlyByCamera thisCam; + thisCam.timeStamp = posTimestamps[i]; + thisCam.locations.Relocate(newPos.x, newPos.y, newPos.z); + + if (targetcam.size() > 0) + { + // Find the target camera before and after this camera + FlyByCamera lastTarget; + FlyByCamera nextTarget; + + // Pre-load first item + lastTarget = targetcam[0]; + nextTarget = targetcam[0]; + for (uint32 j = 0; j < targetcam.size(); ++j) + { + nextTarget = targetcam[j]; + if (targetcam[j].timeStamp > posTimestamps[i]) + break; + + lastTarget = targetcam[j]; + } + + float x, y, z; + lastTarget.locations.GetPosition(x, y, z); + + // Now, the timestamps for target cam and position can be different. So, if they differ we interpolate + if (lastTarget.timeStamp != posTimestamps[i]) + { + uint32 timeDiffTarget = nextTarget.timeStamp - lastTarget.timeStamp; + uint32 timeDiffThis = posTimestamps[i] - lastTarget.timeStamp; + float xDiff = nextTarget.locations.GetPositionX() - lastTarget.locations.GetPositionX(); + float yDiff = nextTarget.locations.GetPositionY() - lastTarget.locations.GetPositionY(); + x = lastTarget.locations.GetPositionX() + (xDiff * (float(timeDiffThis) / float(timeDiffTarget))); + y = lastTarget.locations.GetPositionY() + (yDiff * (float(timeDiffThis) / float(timeDiffTarget))); + } + float xDiff = x - thisCam.locations.GetPositionX(); + float yDiff = y - thisCam.locations.GetPositionY(); + thisCam.locations.SetOrientation(std::atan2(yDiff, xDiff)); + } + + cameras.push_back(thisCam); + positions++; + currPos += sizeof(M2SplineKey); + } + } + + sFlyByCameraStore[dbcentry->ID] = cameras; + return true; +} + +void LoadM2Cameras(std::string const& dataPath) +{ + sFlyByCameraStore.clear(); + LOG_INFO("server.loading", ">> Loading Cinematic Camera files"); + + uint32 oldMSTime = getMSTime(); + for (CinematicCameraEntry const* dbcentry : sCinematicCameraStore) + { + std::string filenameWork = dataPath; + filenameWork.append(dbcentry->Model); + + // Replace slashes (always to forward slash, because boost!) + std::replace(filenameWork.begin(), filenameWork.end(), '\\', '/'); + + boost::filesystem::path filename = filenameWork; + + // Convert to native format + filename.make_preferred(); + + // Replace mdx to .m2 + filename.replace_extension("m2"); + + std::ifstream m2file(filename.string().c_str(), std::ios::in | std::ios::binary); + if (!m2file.is_open()) + continue; + + // Get file size + m2file.seekg(0, std::ios::end); + std::streamoff fileSize = m2file.tellg(); + + // Reject if not at least the size of the header + if (static_cast(fileSize) < sizeof(M2Header)) + { + LOG_ERROR("server.loading", "Camera file %s is damaged. File is smaller than header size", filename.string().c_str()); + m2file.close(); + continue; + } + + // Read 4 bytes (signature) + m2file.seekg(0, std::ios::beg); + char fileCheck[5]; + m2file.read(fileCheck, 4); + fileCheck[4] = 0; + + // Check file has correct magic (MD20) + if (strcmp(fileCheck, "MD20")) + { + LOG_ERROR("server.loading", "Camera file %s is damaged. File identifier not found", filename.string().c_str()); + m2file.close(); + continue; + } + + // Now we have a good file, read it all into a vector of char's, then close the file. + std::vector buffer(fileSize); + m2file.seekg(0, std::ios::beg); + if (!m2file.read(buffer.data(), fileSize)) + { + m2file.close(); + continue; + } + m2file.close(); + + // Read header + M2Header const* header = reinterpret_cast(buffer.data()); + + if (header->ofsCameras + sizeof(M2Camera) > static_cast(fileSize)) + { + LOG_ERROR("server.loading", "Camera file %s is damaged. Camera references position beyond file end", filename.string().c_str()); + continue; + } + + // Get camera(s) - Main header, then dump them. + M2Camera const* cam = reinterpret_cast(buffer.data() + header->ofsCameras); + if (!readCamera(cam, fileSize, header, dbcentry)) + LOG_ERROR("server.loading", "Camera file %s is damaged. Camera references position beyond file end", filename.string().c_str()); + } + + LOG_INFO("server.loading", ">> Loaded %u cinematic waypoint sets in %u ms", (uint32)sFlyByCameraStore.size(), GetMSTimeDiffToNow(oldMSTime)); +} + +std::vector const* GetFlyByCameras(uint32 cinematicCameraId) +{ + return Acore::Containers::MapGetValuePtr(sFlyByCameraStore, cinematicCameraId); +} diff --git a/src/server/game/DataStores/M2Stores.h b/src/server/game/DataStores/M2Stores.h new file mode 100644 index 000000000..66de48de2 --- /dev/null +++ b/src/server/game/DataStores/M2Stores.h @@ -0,0 +1,35 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef ACORE_M2STORES_H +#define ACORE_M2STORES_H + +#include "Define.h" +#include "Position.h" +#include + +struct FlyByCamera +{ + uint32 timeStamp; + Position locations; +}; + +AC_GAME_API void LoadM2Cameras(std::string const& dataPath); + +AC_GAME_API std::vector const* GetFlyByCameras(uint32 cinematicCameraId); + +#endif diff --git a/src/server/game/DataStores/M2Structure.h b/src/server/game/DataStores/M2Structure.h new file mode 100644 index 000000000..6f9004f86 --- /dev/null +++ b/src/server/game/DataStores/M2Structure.h @@ -0,0 +1,133 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef ACORE_M2STRUCTURE_H +#define ACORE_M2STRUCTURE_H + +#include +#include + +// Structures for M2 file. Source: https://wowdev.wiki +#pragma pack(push, 1) +template +struct M2SplineKey +{ + T p0; + T p1; + T p2; +}; + +struct M2Header +{ + char Magic[4]; // "MD20" + uint32 Version; // The version of the format. + uint32 lName; // Length of the model's name including the trailing \0 + uint32 ofsName; // Offset to the name, it seems like models can get reloaded by this name.should be unique, i guess. + uint32 GlobalModelFlags; // 0x0001: tilt x, 0x0002: tilt y, 0x0008: add 2 fields in header, 0x0020: load .phys data (MoP+), 0x0080: has _lod .skin files (MoP?+), 0x0100: is camera related. + uint32 nGlobalSequences; + uint32 ofsGlobalSequences; // A list of timestamps. + uint32 nAnimations; + uint32 ofsAnimations; // Information about the animations in the model. + uint32 nAnimationLookup; + uint32 ofsAnimationLookup; // Mapping of global IDs to the entries in the Animation sequences block. + uint32 nBones; // MAX_BONES = 0x100 + uint32 ofsBones; // Information about the bones in this model. + uint32 nKeyBoneLookup; + uint32 ofsKeyBoneLookup; // Lookup table for key skeletal bones. + uint32 nVertices; + uint32 ofsVertices; // Vertices of the model. + uint32 nViews; // Views (LOD) are now in .skins. + uint32 nSubmeshAnimations; + uint32 ofsSubmeshAnimations; // Submesh color and alpha animations definitions. + uint32 nTextures; + uint32 ofsTextures; // Textures of this model. + uint32 nTransparency; + uint32 ofsTransparency; // Transparency of textures. + uint32 nUVAnimation; + uint32 ofsUVAnimation; + uint32 nTexReplace; + uint32 ofsTexReplace; // Replaceable Textures. + uint32 nRenderFlags; + uint32 ofsRenderFlags; // Blending modes / render flags. + uint32 nBoneLookupTable; + uint32 ofsBoneLookupTable; // A bone lookup table. + uint32 nTexLookup; + uint32 ofsTexLookup; // The same for textures. + uint32 nTexUnits; // possibly removed with cata?! + uint32 ofsTexUnits; // And texture units. Somewhere they have to be too. + uint32 nTransLookup; + uint32 ofsTransLookup; // Everything needs its lookup. Here are the transparencies. + uint32 nUVAnimLookup; + uint32 ofsUVAnimLookup; + G3D::AABox BoundingBox; // min/max( [1].z, 2.0277779f ) - 0.16f seems to be the maximum camera height + float BoundingSphereRadius; + G3D::AABox CollisionBox; + float CollisionSphereRadius; + uint32 nBoundingTriangles; + uint32 ofsBoundingTriangles; // Our bounding volumes. Similar structure like in the old ofsViews. + uint32 nBoundingVertices; + uint32 ofsBoundingVertices; + uint32 nBoundingNormals; + uint32 ofsBoundingNormals; + uint32 nAttachments; + uint32 ofsAttachments; // Attachments are for weapons etc. + uint32 nAttachLookup; + uint32 ofsAttachLookup; // Of course with a lookup. + uint32 nEvents; + uint32 ofsEvents; // Used for playing sounds when dying and a lot else. + uint32 nLights; + uint32 ofsLights; // Lights are mainly used in loginscreens but in wands and some doodads too. + uint32 nCameras; // Format of Cameras changed with version 271! + uint32 ofsCameras; // The cameras are present in most models for having a model in the Character-Tab. + uint32 nCameraLookup; + uint32 ofsCameraLookup; // And lookup-time again. + uint32 nRibbonEmitters; + uint32 ofsRibbonEmitters; // Things swirling around. See the CoT-entrance for light-trails. + uint32 nParticleEmitters; + uint32 ofsParticleEmitters; // Spells and weapons, doodads and loginscreens use them. Blood dripping of a blade? Particles. + uint32 nBlendMaps; // This has to deal with blending. Exists IFF (flags & 0x8) != 0. When set, textures blending is overriden by the associated array. See M2/WotLK#Blend_mode_overrides + uint32 ofsBlendMaps; // Same as above. Points to an array of uint16 of nBlendMaps entries -- From WoD information.}; +}; + +struct M2Array +{ + uint32_t number; + uint32 offset_elements; +}; +struct M2Track +{ + uint16_t interpolation_type; + uint16_t global_sequence; + M2Array timestamps; + M2Array values; +}; + +struct M2Camera +{ + uint32_t type; // 0: portrait, 1: characterinfo; -1: else (flyby etc.); referenced backwards in the lookup table. + float fov; // No radians, no degrees. Multiply by 35 to get degrees. + float far_clip; + float near_clip; + M2Track positions; // How the camera's position moves. Should be 3*3 floats. + G3D::Vector3 position_base; + M2Track target_positions; // How the target moves. Should be 3*3 floats. + G3D::Vector3 target_position_base; + M2Track rolldata; // The camera can have some roll-effect. Its 0 to 2*Pi. +}; +#pragma pack(pop) + +#endif diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index 84c73a892..161919439 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -86,7 +86,7 @@ void FormationMgr::LoadCreatureFormations() QueryResult result = WorldDatabase.Query("SELECT leaderGUID, memberGUID, dist, angle, groupAI, point_1, point_2 FROM creature_formations ORDER BY leaderGUID"); if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index 78754bb46..7e17d61aa 100644 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -73,7 +73,7 @@ void LoadRandomEnchantmentsTable() } else { - LOG_ERROR("sql.sql", ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty."); LOG_INFO("server.loading", " "); } } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index eb4b4715a..4dba85af0 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1621,7 +1621,7 @@ float WorldObject::GetGridActivationRange() const { if (ToPlayer()) { - if (ToPlayer()->IsOnCinematic()) + if (ToPlayer()->GetCinematicMgr()->IsOnCinematic()) { return DEFAULT_VISIBILITY_INSTANCE; } @@ -1688,7 +1688,7 @@ float WorldObject::GetSightRange(WorldObject const* target) const { return MAX_VISIBILITY_DISTANCE; } - else if (ToPlayer()->IsOnCinematic()) + else if (ToPlayer()->GetCinematicMgr()->IsOnCinematic()) { return DEFAULT_VISIBILITY_INSTANCE; } diff --git a/src/server/game/Entities/Player/CinematicMgr.cpp b/src/server/game/Entities/Player/CinematicMgr.cpp new file mode 100644 index 000000000..39d67e45e --- /dev/null +++ b/src/server/game/Entities/Player/CinematicMgr.cpp @@ -0,0 +1,170 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "CinematicMgr.h" +#include "Map.h" +#include "M2Stores.h" +#include "MotionMaster.h" +#include "Player.h" +#include "TemporarySummon.h" + +CinematicMgr::CinematicMgr(Player* playerref) +{ + player = playerref; + m_cinematicDiff = 0; + m_lastCinematicCheck = 0; + m_activeCinematicCameraId = 0; + m_cinematicLength = 0; + m_cinematicCamera = nullptr; + m_remoteSightPosition = Position(0.0f, 0.0f, 0.0f); + m_CinematicObject = nullptr; +} + +CinematicMgr::~CinematicMgr() +{ + if (m_cinematicCamera && m_activeCinematicCameraId) + EndCinematic(); +} + +void CinematicMgr::BeginCinematic() +{ + // Sanity check for active camera set + if (m_activeCinematicCameraId == 0) + return; + + if (std::vector const* flyByCameras = GetFlyByCameras(m_activeCinematicCameraId)) + { + // Initialize diff, and set camera + m_cinematicDiff = 0; + m_cinematicCamera = flyByCameras; + + auto camitr = m_cinematicCamera->begin(); + if (camitr != m_cinematicCamera->end()) + { + Position const& pos = camitr->locations; + if (!pos.IsPositionValid()) + return; + + player->GetMap()->LoadGrid(pos.GetPositionX(), pos.GetPositionY()); + m_CinematicObject = player->SummonCreature(VISUAL_WAYPOINT, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 120000); + if (m_CinematicObject) + { + m_CinematicObject->setActive(true); + player->SetViewpoint(m_CinematicObject, true); + } + + // Get cinematic length + m_cinematicLength = flyByCameras->back().timeStamp; + } + } +} + +void CinematicMgr::EndCinematic() +{ + if (m_activeCinematicCameraId == 0) + return; + + m_cinematicDiff = 0; + m_cinematicCamera = nullptr; + m_activeCinematicCameraId = 0; + if (m_CinematicObject) + { + if (WorldObject* vpObject = player->GetViewpoint()) + if (vpObject == m_CinematicObject) + player->SetViewpoint(m_CinematicObject, false); + + m_CinematicObject->AddObjectToRemoveList(); + } +} + +void CinematicMgr::UpdateCinematicLocation(uint32 /*diff*/) +{ + if (m_activeCinematicCameraId == 0 || !m_cinematicCamera || m_cinematicCamera->size() == 0) + return; + + Position lastPosition; + uint32 lastTimestamp = 0; + Position nextPosition; + uint32 nextTimestamp = 0; + + // Obtain direction of travel + for (FlyByCamera cam : *m_cinematicCamera) + { + if (cam.timeStamp > m_cinematicDiff) + { + nextPosition.Relocate(cam.locations); + nextTimestamp = cam.timeStamp; + break; + } + lastPosition.Relocate(cam.locations); + lastTimestamp = cam.timeStamp; + } + float angle = lastPosition.GetAbsoluteAngle(&nextPosition); + angle -= lastPosition.GetOrientation(); + if (angle < 0) + angle += 2 * float(M_PI); + + // Look for position around 2 second ahead of us. + int32 workDiff = m_cinematicDiff; + + // Modify result based on camera direction (Humans for example, have the camera point behind) + workDiff += static_cast(float(CINEMATIC_LOOKAHEAD) * cos(angle)); + + // Get an iterator to the last entry in the cameras, to make sure we don't go beyond the end + auto endItr = m_cinematicCamera->rbegin(); + if (endItr != m_cinematicCamera->rend() && workDiff > static_cast(endItr->timeStamp)) + workDiff = endItr->timeStamp; + + // Never try to go back in time before the start of cinematic! + if (workDiff < 0) + workDiff = m_cinematicDiff; + + // Obtain the previous and next waypoint based on timestamp + for (FlyByCamera cam : *m_cinematicCamera) + { + if (static_cast(cam.timeStamp) >= workDiff) + { + nextPosition.Relocate(cam.locations); + nextTimestamp = cam.timeStamp; + break; + } + lastPosition.Relocate(cam.locations); + lastTimestamp = cam.timeStamp; + } + + // Never try to go beyond the end of the cinematic + if (workDiff > static_cast(nextTimestamp)) + workDiff = static_cast(nextTimestamp); + + // Interpolate the position for this moment in time (or the adjusted moment in time) + uint32 timeDiff = nextTimestamp - lastTimestamp; + uint32 interDiff = workDiff - lastTimestamp; + float xDiff = nextPosition.m_positionX - lastPosition.m_positionX; + float yDiff = nextPosition.m_positionY - lastPosition.m_positionY; + float zDiff = nextPosition.m_positionZ - lastPosition.m_positionZ; + Position interPosition(lastPosition.m_positionX + (xDiff * (float(interDiff) / float(timeDiff))), lastPosition.m_positionY + + (yDiff * (float(interDiff) / float(timeDiff))), lastPosition.m_positionZ + (zDiff * (float(interDiff) / float(timeDiff)))); + + // Advance (at speed) to this position. The remote sight object is used + // to send update information to player in cinematic + if (m_CinematicObject && interPosition.IsPositionValid()) + m_CinematicObject->MonsterMoveWithSpeed(interPosition.m_positionX, interPosition.m_positionY, interPosition.m_positionZ, 500.0f); + + // If we never received an end packet 10 seconds after the final timestamp then force an end + if (m_cinematicDiff > m_cinematicLength + 10 * IN_MILLISECONDS) + EndCinematic(); +} diff --git a/src/server/game/Entities/Player/CinematicMgr.h b/src/server/game/Entities/Player/CinematicMgr.h new file mode 100644 index 000000000..66eeaa4b9 --- /dev/null +++ b/src/server/game/Entities/Player/CinematicMgr.h @@ -0,0 +1,59 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef CinematicMgr_h__ +#define CinematicMgr_h__ + +#include "Define.h" +#include "Object.h" + +constexpr auto CINEMATIC_UPDATEDIFF = 500; +constexpr auto CINEMATIC_LOOKAHEAD = 2000; + +class Player; +struct FlyByCamera; + +class AC_GAME_API CinematicMgr +{ + friend class Player; +public: + explicit CinematicMgr(Player* playerref); + ~CinematicMgr(); + + // Cinematic camera data and remote sight functions + uint32 GetActiveCinematicCamera() const { return m_activeCinematicCameraId; } + void SetActiveCinematicCamera(uint32 cinematicCameraId = 0) { m_activeCinematicCameraId = cinematicCameraId; } + bool IsOnCinematic() const { return (m_cinematicCamera != nullptr); } + void BeginCinematic(); + void EndCinematic(); + void UpdateCinematicLocation(uint32 diff); + +private: + // Remote location information + Player* player; + +protected: + uint32 m_cinematicDiff; + uint32 m_lastCinematicCheck; + uint32 m_activeCinematicCameraId; + uint32 m_cinematicLength; + std::vector const* m_cinematicCamera; + Position m_remoteSightPosition; + TempSummon* m_CinematicObject; +}; + +#endif diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c72439e7c..590e9d8c8 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -383,12 +383,7 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this) _activeCheats = CHEAT_NONE; - m_cinematicDiff = 0; - m_lastCinematicCheck = 0; - m_activeCinematicCameraId = 0; - m_cinematicCamera = nullptr; - m_remoteSightPosition = Position(0.0f, 0.0f, 0.0f); - m_CinematicObject = nullptr; + _cinematicMgr = new CinematicMgr(this); m_achievementMgr = new AchievementMgr(this); m_reputationMgr = new ReputationMgr(this); @@ -5574,14 +5569,14 @@ void Player::SendDirectMessage(WorldPacket const* data) const m_session->SendPacket(data); } -void Player::SendCinematicStart(uint32 CinematicSequenceId) +void Player::SendCinematicStart(uint32 CinematicSequenceId) const { WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4); data << uint32(CinematicSequenceId); SendDirectMessage(&data); - if (const CinematicSequencesEntry* sequence = sCinematicSequencesStore.LookupEntry(CinematicSequenceId)) + if (CinematicSequencesEntry const* sequence = sCinematicSequencesStore.LookupEntry(CinematicSequenceId)) { - SetActiveCinematicCamera(sequence->cinematicCamera); + _cinematicMgr->SetActiveCinematicCamera(sequence->cinematicCamera); } } @@ -15498,56 +15493,6 @@ bool Player::SetFeatherFall(bool apply, bool packetOnly /*= false*/) return true; } -void Player::BeginCinematic() -{ - // Sanity check for active camera set - if (m_activeCinematicCameraId == 0) - { - return; - } - - auto itr = sFlyByCameraStore.find(m_activeCinematicCameraId); - if (itr != sFlyByCameraStore.end()) - { - // Initialize diff, and set camera - m_cinematicDiff = 0; - m_cinematicCamera = &itr->second; - - auto camitr = m_cinematicCamera->begin(); - if (camitr != m_cinematicCamera->end()) - { - Position pos(camitr->locations.x, camitr->locations.y, camitr->locations.z, camitr->locations.w); - if (!pos.IsPositionValid()) - { - return; - } - - m_mapRef->LoadGrid(camitr->locations.x, camitr->locations.y); - m_CinematicObject = SummonCreature(VISUAL_WAYPOINT, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000); - if (m_CinematicObject) - { - m_CinematicObject->setActive(true); - SetViewpoint(m_CinematicObject, true); - } - } - } -} - -void Player::EndCinematic() -{ - m_cinematicDiff = 0; - m_cinematicCamera = nullptr; - m_activeCinematicCameraId = 0; - if (m_CinematicObject) - { - if (m_seer && m_seer == m_CinematicObject) - { - SetViewpoint(m_CinematicObject, false); - } - m_CinematicObject->AddObjectToRemoveList(); - } -} - Guild* Player::GetGuild() const { uint32 guildId = GetGuildId(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 53f8fd56a..3896615e5 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -21,6 +21,7 @@ #include "ArenaTeam.h" #include "Battleground.h" #include "CharacterCache.h" +#include "CinematicMgr.h" #include "DBCStores.h" #include "DatabaseEnvFwd.h" #include "GroupReference.h" @@ -1036,6 +1037,7 @@ struct EntryPointData class Player : public Unit, public GridObject { friend class WorldSession; + friend class CinematicMgr; friend void Item::AddToUpdateQueueOf(Player* player); friend void Item::RemoveFromUpdateQueueOf(Player* player); public: @@ -1326,6 +1328,8 @@ public: [[nodiscard]] TradeData* GetTradeData() const { return m_trade; } void TradeCancel(bool sendback); + CinematicMgr* GetCinematicMgr() const { return _cinematicMgr; } + void UpdateEnchantTime(uint32 time); void UpdateSoulboundTradeItems(); void AddTradeableItem(Item* item); @@ -2368,7 +2372,7 @@ public: [[nodiscard]] bool IsPetNeedBeTemporaryUnsummoned() const { return GetSession()->PlayerLogout() || !IsInWorld() || !IsAlive() || IsMounted()/*+in flight*/ || GetVehicle() || IsBeingTeleported(); } bool CanResummonPet(uint32 spellid); - void SendCinematicStart(uint32 CinematicSequenceId); + void SendCinematicStart(uint32 CinematicSequenceId) const; void SendMovieStart(uint32 MovieId); uint32 DoRandomRoll(uint32 minimum, uint32 maximum); @@ -2561,17 +2565,6 @@ public: static std::unordered_map bgZoneIdToFillWorldStates; // zoneId -> FillInitialWorldStates - // Cinematic camera data and remote sight functions - [[nodiscard]] uint32 GetActiveCinematicCamera() const { return m_activeCinematicCameraId; } - void SetActiveCinematicCamera(uint32 cinematicCameraId = 0) { m_activeCinematicCameraId = cinematicCameraId; } - [[nodiscard]] bool IsOnCinematic() const { return (m_cinematicCamera != nullptr); } - void BeginCinematic(); - void EndCinematic(); - void UpdateCinematicLocation(uint32 diff); - - std::string GetMapAreaAndZoneString(); - std::string GetCoordsMapAreaAndZoneString(); - void SetFarSightDistance(float radius); void ResetFarSightDistance(); [[nodiscard]] Optional GetFarSightDistance() const; @@ -2866,6 +2859,8 @@ private: Item* _StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update); Item* _LoadItem(CharacterDatabaseTransaction trans, uint32 zoneId, uint32 timeDiff, Field* fields); + CinematicMgr* _cinematicMgr; + typedef GuidSet RefundableItemsSet; RefundableItemsSet m_refundableItems; void SendRefundInfo(Item* item); @@ -2931,14 +2926,6 @@ private: uint32 m_flightSpellActivated; - // Remote location information - uint32 m_cinematicDiff; - uint32 m_lastCinematicCheck; - uint32 m_activeCinematicCameraId; - FlyByCameraCollection* m_cinematicCamera; - Position m_remoteSightPosition; - Creature* m_CinematicObject; - WorldLocation _corpseLocation; Optional _farSightDistance = { }; diff --git a/src/server/game/Entities/Player/PlayerUpdates.cpp b/src/server/game/Entities/Player/PlayerUpdates.cpp index d147a03c3..8a743f195 100644 --- a/src/server/game/Entities/Player/PlayerUpdates.cpp +++ b/src/server/game/Entities/Player/PlayerUpdates.cpp @@ -47,9 +47,6 @@ // Zone Interval should be 1 second constexpr auto ZONE_UPDATE_INTERVAL = 1000; -constexpr auto CINEMATIC_UPDATEDIFF = 500; -constexpr auto CINEMATIC_LOOKAHEAD = 2000; - void Player::Update(uint32 p_time) { if (!IsInWorld()) @@ -70,12 +67,11 @@ void Player::Update(uint32 p_time) // Update cinematic location, if 500ms have passed and we're doing a // cinematic now. - m_cinematicDiff += p_time; - if (m_cinematicCamera && m_activeCinematicCameraId && - GetMSTimeDiffToNow(m_lastCinematicCheck) > CINEMATIC_UPDATEDIFF) + _cinematicMgr->m_cinematicDiff += p_time; + if (_cinematicMgr->m_cinematicCamera && _cinematicMgr->m_activeCinematicCameraId && GetMSTimeDiffToNow(_cinematicMgr->m_lastCinematicCheck) > CINEMATIC_UPDATEDIFF) { - m_lastCinematicCheck = getMSTime(); - UpdateCinematicLocation(p_time); + _cinematicMgr->m_lastCinematicCheck = getMSTime(); + _cinematicMgr->UpdateCinematicLocation(p_time); } // used to implement delayed far teleports @@ -1508,107 +1504,6 @@ void Player::UpdatePotionCooldown(Spell* spell) SetLastPotionId(0); } -void Player::UpdateCinematicLocation(uint32 /*diff*/) -{ - Position lastPosition; - uint32 lastTimestamp = 0; - Position nextPosition; - uint32 nextTimestamp = 0; - - if (m_cinematicCamera->size() == 0) - { - return; - } - - // Obtain direction of travel - for (FlyByCamera cam : *m_cinematicCamera) - { - if (cam.timeStamp > m_cinematicDiff) - { - nextPosition = Position(cam.locations.x, cam.locations.y, - cam.locations.z, cam.locations.w); - nextTimestamp = cam.timeStamp; - break; - } - lastPosition = Position(cam.locations.x, cam.locations.y, - cam.locations.z, cam.locations.w); - lastTimestamp = cam.timeStamp; - } - float angle = lastPosition.GetAngle(&nextPosition); - angle -= lastPosition.GetOrientation(); - if (angle < 0) - { - angle += 2 * float(M_PI); - } - - // Look for position around 2 second ahead of us. - int32 workDiff = m_cinematicDiff; - - // Modify result based on camera direction (Humans for example, have the - // camera point behind) - workDiff += static_cast(float(CINEMATIC_LOOKAHEAD) * cos(angle)); - - // Get an iterator to the last entry in the cameras, to make sure we don't - // go beyond the end - FlyByCameraCollection::const_reverse_iterator endItr = - m_cinematicCamera->rbegin(); - if (endItr != m_cinematicCamera->rend() && - workDiff > static_cast(endItr->timeStamp)) - { - workDiff = endItr->timeStamp; - } - - // Never try to go back in time before the start of cinematic! - if (workDiff < 0) - { - workDiff = m_cinematicDiff; - } - - // Obtain the previous and next waypoint based on timestamp - for (FlyByCamera cam : *m_cinematicCamera) - { - if (static_cast(cam.timeStamp) >= workDiff) - { - nextPosition = Position(cam.locations.x, cam.locations.y, - cam.locations.z, cam.locations.w); - nextTimestamp = cam.timeStamp; - break; - } - lastPosition = Position(cam.locations.x, cam.locations.y, - cam.locations.z, cam.locations.w); - lastTimestamp = cam.timeStamp; - } - - // Never try to go beyond the end of the cinematic - if (workDiff > static_cast(nextTimestamp)) - { - workDiff = static_cast(nextTimestamp); - } - - // Interpolate the position for this moment in time (or the adjusted moment - // in time) - uint32 timeDiff = nextTimestamp - lastTimestamp; - uint32 interDiff = workDiff - lastTimestamp; - float xDiff = nextPosition.m_positionX - lastPosition.m_positionX; - float yDiff = nextPosition.m_positionY - lastPosition.m_positionY; - float zDiff = nextPosition.m_positionZ - lastPosition.m_positionZ; - Position interPosition(lastPosition.m_positionX + - (xDiff * (float(interDiff) / float(timeDiff))), - lastPosition.m_positionY + - (yDiff * (float(interDiff) / float(timeDiff))), - lastPosition.m_positionZ + - (zDiff * (float(interDiff) / float(timeDiff)))); - - // Advance (at speed) to this position. The remote sight object is used - // to send update information to player in cinematic - if (m_CinematicObject && interPosition.IsPositionValid()) - { - m_CinematicObject->MonsterMoveWithSpeed( - interPosition.m_positionX, interPosition.m_positionY, - interPosition.m_positionZ, 200.0f); - } -} - template void Player::UpdateVisibilityOf(Player* target, UpdateData& data, std::vector& visibleNow); template void Player::UpdateVisibilityOf(Creature* target, UpdateData& data, diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 2902bb661..54787a29b 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -246,7 +246,7 @@ void GameEventMgr::LoadFromDB() if (!result) { mGameEvent.clear(); - LOG_ERROR("sql.sql", ">> Loaded 0 game events. DB table `game_event` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 game events. DB table `game_event` is empty."); LOG_INFO("server.loading", " "); return; } @@ -314,7 +314,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); LOG_INFO("server.loading", " "); } else @@ -359,7 +359,7 @@ void GameEventMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); LOG_INFO("server.loading", " "); } else @@ -410,7 +410,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); LOG_INFO("server.loading", " "); } else @@ -458,7 +458,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); LOG_INFO("server.loading", " "); } else @@ -507,7 +507,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); LOG_INFO("server.loading", " "); } else @@ -566,7 +566,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); LOG_INFO("server.loading", " "); } else @@ -606,7 +606,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); LOG_INFO("server.loading", " "); } else @@ -646,7 +646,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); LOG_INFO("server.loading", " "); } else @@ -688,7 +688,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); LOG_INFO("server.loading", " "); } else @@ -729,7 +729,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); LOG_INFO("server.loading", " "); } else @@ -776,7 +776,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); LOG_INFO("server.loading", " "); } else @@ -815,7 +815,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); LOG_INFO("server.loading", " "); } else @@ -861,7 +861,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); LOG_INFO("server.loading", " "); } else @@ -926,7 +926,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 battleground holidays in game events. DB table `game_event_battleground_holiday` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 battleground holidays in game events. DB table `game_event_battleground_holiday` is empty."); LOG_INFO("server.loading", " "); } else @@ -964,7 +964,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); LOG_INFO("server.loading", " "); } else @@ -1012,7 +1012,7 @@ void GameEventMgr::LoadHolidayDates() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 holiday dates. DB table `holiday_dates` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 holiday dates. DB table `holiday_dates` is empty."); return; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6c4959cf5..427cb7c6a 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -497,7 +497,7 @@ void ObjectMgr::LoadCreatureTemplates() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature template definitions. DB table `creature_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creature template definitions. DB table `creature_template` is empty."); return; } @@ -663,7 +663,7 @@ void ObjectMgr::LoadCreatureTemplateResistances() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature template resistance definitions. DB table `creature_template_resistance` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creature template resistance definitions. DB table `creature_template_resistance` is empty."); LOG_INFO("server.loading", " "); return; } @@ -709,7 +709,7 @@ void ObjectMgr::LoadCreatureTemplateSpells() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature template spell definitions. DB table `creature_template_spell` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creature template spell definitions. DB table `creature_template_spell` is empty."); LOG_INFO("server.loading", " "); return; } @@ -755,7 +755,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1235,7 +1235,7 @@ void ObjectMgr::LoadCreatureAddons() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1336,7 +1336,7 @@ void ObjectMgr::LoadGameObjectAddons() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 gameobject addon definitions. DB table `gameobject_addon` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 gameobject addon definitions. DB table `gameobject_addon` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1446,7 +1446,7 @@ void ObjectMgr::LoadEquipmentTemplates() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -1535,7 +1535,7 @@ void ObjectMgr::LoadCreatureMovementOverrides() "LEFT JOIN creature_template_movement AS ctm ON ctm.CreatureId = c.id1"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature movement overrides. DB table `creature_movement_override` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 creature movement overrides. DB table `creature_movement_override` is empty!"); return; } @@ -1660,7 +1660,7 @@ void ObjectMgr::LoadCreatureModelInfo() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1718,7 +1718,7 @@ void ObjectMgr::LoadLinkedRespawn() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 linked respawns. DB table `linked_respawn` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 linked respawns. DB table `linked_respawn` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1949,7 +1949,7 @@ void ObjectMgr::LoadTempSummons() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 temp summons. DB table `creature_summon_groups` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 temp summons. DB table `creature_summon_groups` is empty."); return; } @@ -2042,7 +2042,7 @@ void ObjectMgr::LoadCreatures() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 creatures. DB table `creature` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creatures. DB table `creature` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2367,7 +2367,7 @@ void ObjectMgr::LoadGameobjects() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 gameobjects. DB table `gameobject` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 gameobjects. DB table `gameobject` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2617,7 +2617,7 @@ void ObjectMgr::LoadItemTemplates() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 item templates. DB table `item_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 item templates. DB table `item_template` is empty."); LOG_INFO("server.loading", " "); return; } @@ -3223,7 +3223,7 @@ void ObjectMgr::LoadItemSetNames() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 item set names. DB table `item_set_names` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 item set names. DB table `item_set_names` is empty."); LOG_INFO("server.loading", " "); return; } @@ -3295,7 +3295,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty."); LOG_INFO("server.loading", " "); return; } @@ -3351,7 +3351,7 @@ void ObjectMgr::LoadVehicleAccessories() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 Vehicle Accessories in {} ms", GetMSTimeDiffToNow(oldMSTime)); + LOG_WARN("server.loading", ">> Loaded 0 Vehicle Accessories in {} ms", GetMSTimeDiffToNow(oldMSTime)); LOG_INFO("server.loading", " "); return; } @@ -3391,7 +3391,7 @@ void ObjectMgr::LoadPetLevelInfo() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty."); LOG_INFO("server.loading", " "); return; } @@ -3532,7 +3532,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { LOG_INFO("server.loading", " "); - LOG_ERROR("sql.sql", ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty."); exit(1); } else @@ -3618,7 +3618,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty."); LOG_INFO("server.loading", " "); } else @@ -3689,7 +3689,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - LOG_ERROR("server.loading", ">> Loaded 0 player create skills. DB table `playercreateinfo_skills` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 player create skills. DB table `playercreateinfo_skills` is empty."); } else { @@ -3763,7 +3763,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 player create spells. DB table `playercreateinfo_spell_custom` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 player create spells. DB table `playercreateinfo_spell_custom` is empty."); } else { @@ -3821,7 +3821,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - LOG_ERROR("server.loading", ">> Loaded 0 player create cast spells. DB table `playercreateinfo_cast_spell` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 player create cast spells. DB table `playercreateinfo_cast_spell` is empty."); } else { @@ -3879,7 +3879,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty."); LOG_INFO("server.loading", " "); } else @@ -4007,7 +4007,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty."); LOG_INFO("server.loading", " "); exit(1); } @@ -4120,7 +4120,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty."); LOG_INFO("server.loading", " "); exit(1); } @@ -4310,7 +4310,7 @@ void ObjectMgr::LoadQuests() " FROM quest_template"); if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 quests definitions. DB table `quest_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quests definitions. DB table `quest_template` is empty."); LOG_INFO("server.loading", " "); return; } @@ -4352,7 +4352,7 @@ void ObjectMgr::LoadQuests() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 quest details. DB table `quest_details` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest details. DB table `quest_details` is empty."); } else { @@ -4375,7 +4375,7 @@ void ObjectMgr::LoadQuests() if (!result) { - LOG_ERROR("server.loading", ">> Loaded 0 quest request items. DB table `quest_request_items` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest request items. DB table `quest_request_items` is empty."); } else { @@ -4398,7 +4398,7 @@ void ObjectMgr::LoadQuests() if (!result) { - LOG_ERROR("server.loading", ">> Loaded 0 quest reward emotes. DB table `quest_offer_reward` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest reward emotes. DB table `quest_offer_reward` is empty."); } else { @@ -4423,7 +4423,7 @@ void ObjectMgr::LoadQuests() if (!result) { - LOG_ERROR("server.loading", ">> Loaded 0 quest template addons. DB table `quest_template_addon` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest template addons. DB table `quest_template_addon` is empty."); } else { @@ -5079,7 +5079,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 script definitions. DB table `{}` is empty!", tableName); + LOG_WARN("server.loading", ">> Loaded 0 script definitions. DB table `{}` is empty!", tableName); LOG_INFO("server.loading", " "); return; } @@ -5477,7 +5477,7 @@ void ObjectMgr::LoadSpellScriptNames() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell script names. DB table `spell_script_names` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 spell script names. DB table `spell_script_names` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -5606,7 +5606,7 @@ void ObjectMgr::LoadPageTexts() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 page texts. DB table `page_text` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 page texts. DB table `page_text` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -5685,7 +5685,7 @@ void ObjectMgr::LoadInstanceTemplate() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 instance templates. DB table `page_text` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 instance templates. DB table `page_text` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -5735,7 +5735,7 @@ void ObjectMgr::LoadInstanceEncounters() QueryResult result = WorldDatabase.Query("SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters"); if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 instance encounters, table is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 instance encounters, table is empty!"); LOG_INFO("server.loading", " "); return; } @@ -5837,7 +5837,7 @@ void ObjectMgr::LoadGossipText() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 npc texts, table is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 npc texts, table is empty!"); LOG_INFO("server.loading", " "); return; } @@ -6064,7 +6064,7 @@ void ObjectMgr::LoadQuestAreaTriggers() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty."); LOG_INFO("server.loading", " "); return; } @@ -6136,7 +6136,7 @@ void ObjectMgr::LoadQuestGreetings() QueryResult result = WorldDatabase.Query("SELECT ID, Type, GreetEmoteType, GreetEmoteDelay, Greeting FROM quest_greeting"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 quest greetings. DB table `quest_greeting` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest greetings. DB table `quest_greeting` is empty."); return; } @@ -6191,7 +6191,7 @@ void ObjectMgr::LoadQuestGreetingsLocales() QueryResult result = WorldDatabase.Query("SELECT ID, Type, Locale, Greeting FROM quest_greeting_locale"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 quest_greeting locales. DB table `quest_greeting_locale` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest_greeting locales. DB table `quest_greeting_locale` is empty."); return; } @@ -6306,7 +6306,7 @@ void ObjectMgr::LoadTavernAreaTriggers() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty."); LOG_INFO("server.loading", " "); return; } @@ -6344,7 +6344,7 @@ void ObjectMgr::LoadAreaTriggerScripts() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty."); LOG_INFO("server.loading", " "); return; } @@ -6485,7 +6485,7 @@ void ObjectMgr::LoadAreaTriggers() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 area trigger definitions. DB table `areatrigger` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 area trigger definitions. DB table `areatrigger` is empty."); LOG_INFO("server.loading", " "); return; } @@ -6536,7 +6536,7 @@ void ObjectMgr::LoadAreaTriggerTeleports() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty."); LOG_INFO("server.loading", " "); return; } @@ -6622,7 +6622,7 @@ void ObjectMgr::LoadAccessRequirements() QueryResult access_template_result = WorldDatabase.Query("SELECT id, map_id, difficulty, min_level, max_level, min_avg_item_level FROM dungeon_access_template"); if (!access_template_result) { - LOG_INFO("server.loading", ">> Loaded 0 access requirement definitions. DB table `dungeon_access_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 access requirement definitions. DB table `dungeon_access_template` is empty."); LOG_INFO("server.loading", " "); return; } @@ -7008,7 +7008,7 @@ void ObjectMgr::LoadGameObjectTemplate() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty."); LOG_INFO("server.loading", " "); return; } @@ -7188,7 +7188,7 @@ void ObjectMgr::LoadGameObjectTemplateAddons() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 gameobject template addon definitions. DB table `gameobject_template_addon` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 gameobject template addon definitions. DB table `gameobject_template_addon` is empty."); LOG_INFO("server.loading", " "); return; } @@ -7251,7 +7251,7 @@ void ObjectMgr::LoadExplorationBaseXP() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty."); LOG_INFO("server.loading", " "); return; } @@ -7291,7 +7291,7 @@ void ObjectMgr::LoadPetNames() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -7459,7 +7459,7 @@ void ObjectMgr::LoadReputationOnKill() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty."); LOG_INFO("server.loading", " "); return; } @@ -7640,7 +7640,7 @@ void ObjectMgr::LoadPointsOfInterest() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty."); LOG_INFO("server.loading", " "); return; } @@ -7688,7 +7688,7 @@ void ObjectMgr::LoadQuestPOI() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); LOG_INFO("server.loading", " "); return; } @@ -7761,7 +7761,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty."); LOG_INFO("server.loading", " "); return; } @@ -7850,7 +7850,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string const& if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 quest relations from `{}`, table is empty.", table); + LOG_WARN("server.loading", ">> Loaded 0 quest relations from `{}`, table is empty.", table); LOG_INFO("server.loading", " "); return; } @@ -7949,7 +7949,7 @@ void ObjectMgr::LoadReservedPlayersNames() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -8170,7 +8170,7 @@ void ObjectMgr::LoadGameObjectForQuests() if (sObjectMgr->GetGameObjectTemplates()->empty()) { - LOG_INFO("server.loading", ">> Loaded 0 GameObjects for quests"); + LOG_WARN("server.loading", ">> Loaded 0 GameObjects for quests"); LOG_INFO("server.loading", " "); return; } @@ -8245,7 +8245,7 @@ bool ObjectMgr::LoadAcoreStrings() QueryResult result = WorldDatabase.Query("SELECT entry, content_default, locale_koKR, locale_frFR, locale_deDE, locale_zhCN, locale_zhTW, locale_esES, locale_esMX, locale_ruRU FROM acore_string"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 acore strings. DB table `acore_strings` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 acore strings. DB table `acore_strings` is empty."); LOG_INFO("server.loading", " "); return false; } @@ -8295,7 +8295,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty."); LOG_INFO("server.loading", " "); return; } @@ -8436,7 +8436,7 @@ void ObjectMgr::LoadGameTele() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 GameTeleports. DB table `game_tele` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 GameTeleports. DB table `game_tele` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -8576,7 +8576,7 @@ void ObjectMgr::LoadMailLevelRewards() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty."); LOG_INFO("server.loading", " "); return; } @@ -8723,7 +8723,7 @@ void ObjectMgr::LoadTrainerSpell() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 Trainers. DB table `npc_trainer` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 Trainers. DB table `npc_trainer` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -8805,7 +8805,7 @@ void ObjectMgr::LoadVendors() if (!result) { LOG_INFO("server.loading", " "); - LOG_ERROR("sql.sql", ">> Loaded 0 Vendors. DB table `npc_vendor` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 Vendors. DB table `npc_vendor` is empty!"); return; } @@ -8851,7 +8851,7 @@ void ObjectMgr::LoadGossipMenu() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -8891,7 +8891,7 @@ void ObjectMgr::LoadGossipMenuItems() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 gossip_menu_option IDs. DB table `gossip_menu_option` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 gossip_menu_option IDs. DB table `gossip_menu_option` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -9157,7 +9157,7 @@ void ObjectMgr::LoadBroadcastTexts() QueryResult result = WorldDatabase.Query("SELECT ID, LanguageID, MaleText, FemaleText, EmoteID1, EmoteID2, EmoteID3, EmoteDelay1, EmoteDelay2, EmoteDelay3, SoundEntriesID, EmotesID, Flags FROM broadcast_text"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 broadcast texts. DB table `broadcast_text` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 broadcast texts. DB table `broadcast_text` is empty."); LOG_INFO("server.loading", " "); return; } @@ -9241,7 +9241,7 @@ void ObjectMgr::LoadBroadcastTextLocales() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 broadcast text locales. DB table `broadcast_text_locale` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 broadcast text locales. DB table `broadcast_text_locale` is empty."); LOG_INFO("server.loading", " "); return; } @@ -9307,7 +9307,7 @@ void ObjectMgr::LoadCreatureClassLevelStats() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty."); LOG_INFO("server.loading", " "); return; } @@ -9390,7 +9390,7 @@ void ObjectMgr::LoadFactionChangeAchievements() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty."); LOG_INFO("server.loading", " "); return; } @@ -9426,7 +9426,7 @@ void ObjectMgr::LoadFactionChangeItems() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty."); LOG_INFO("server.loading", " "); return; } @@ -9462,7 +9462,7 @@ void ObjectMgr::LoadFactionChangeQuests() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 faction change quest pairs. DB table `player_factionchange_quests` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 faction change quest pairs. DB table `player_factionchange_quests` is empty."); LOG_INFO("server.loading", " "); return; } @@ -9498,7 +9498,7 @@ void ObjectMgr::LoadFactionChangeReputations() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty."); LOG_INFO("server.loading", " "); return; } @@ -9534,7 +9534,7 @@ void ObjectMgr::LoadFactionChangeSpells() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty."); LOG_INFO("server.loading", " "); return; } @@ -9570,7 +9570,7 @@ void ObjectMgr::LoadFactionChangeTitles() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 faction change title pairs. DB table `player_factionchange_title` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 faction change title pairs. DB table `player_factionchange_title` is empty."); return; } @@ -9664,7 +9664,7 @@ void ObjectMgr::LoadGameObjectQuestItems() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 gameobject quest items. DB table `gameobject_questitem` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 gameobject quest items. DB table `gameobject_questitem` is empty."); return; } @@ -9694,7 +9694,7 @@ void ObjectMgr::LoadCreatureQuestItems() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creature quest items. DB table `creature_questitem` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creature quest items. DB table `creature_questitem` is empty."); return; } @@ -9725,7 +9725,7 @@ void ObjectMgr::LoadQuestMoneyRewards() QueryResult result = WorldDatabase.Query("SELECT `Level`, Money0, Money1, Money2, Money3, Money4, Money5, Money6, Money7, Money8, Money9 FROM `quest_money_reward` ORDER BY `Level`"); if (!result) { - LOG_ERROR("server.loading", ">> Loaded 0 quest money rewards. DB table `quest_money_reward` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 quest money rewards. DB table `quest_money_reward` is empty."); return; } diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index af9567aa1..de74e204f 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -121,7 +121,7 @@ void GroupMgr::LoadGroups() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 group definitions. DB table `groups` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 group definitions. DB table `groups` is empty!"); LOG_INFO("server.loading", " "); } else @@ -161,7 +161,7 @@ void GroupMgr::LoadGroups() QueryResult result = CharacterDatabase.Query("SELECT guid, memberGuid, memberFlags, subgroup, roles FROM group_member ORDER BY guid"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 group members. DB table `group_member` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 group members. DB table `group_member` is empty!"); LOG_INFO("server.loading", " "); } else diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 30a38aa8e..69668c6a7 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -106,7 +106,7 @@ void GuildMgr::LoadGuilds() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 guild definitions. DB table `guild` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 guild definitions. DB table `guild` is empty."); LOG_INFO("server.loading", " "); } else @@ -146,7 +146,7 @@ void GuildMgr::LoadGuilds() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 guild ranks. DB table `guild_rank` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 guild ranks. DB table `guild_rank` is empty."); LOG_INFO("server.loading", " "); } else @@ -187,7 +187,7 @@ void GuildMgr::LoadGuilds() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 guild members. DB table `guild_member` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 guild members. DB table `guild_member` is empty."); LOG_INFO("server.loading", " "); } else @@ -223,7 +223,7 @@ void GuildMgr::LoadGuilds() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty."); LOG_INFO("server.loading", " "); } else @@ -257,7 +257,7 @@ void GuildMgr::LoadGuilds() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty."); LOG_INFO("server.loading", " "); } else @@ -292,7 +292,7 @@ void GuildMgr::LoadGuilds() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty."); LOG_INFO("server.loading", " "); } else @@ -327,7 +327,7 @@ void GuildMgr::LoadGuilds() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty."); LOG_INFO("server.loading", " "); } else @@ -364,7 +364,7 @@ void GuildMgr::LoadGuilds() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty."); LOG_INFO("server.loading", " "); } else diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp index 7dd25be19..b3d84d5ec 100644 --- a/src/server/game/Handlers/CombatHandler.cpp +++ b/src/server/game/Handlers/CombatHandler.cpp @@ -16,6 +16,7 @@ */ #include "CreatureAI.h" +#include "CombatPackets.h" #include "Log.h" #include "ObjectAccessor.h" #include "ObjectDefines.h" @@ -70,18 +71,15 @@ void WorldSession::HandleAttackStopOpcode(WorldPacket& /*recvData*/) GetPlayer()->AttackStop(); } -void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData) +void WorldSession::HandleSetSheathedOpcode(WorldPackets::Combat::SetSheathed& packet) { - uint32 sheathed; - recvData >> sheathed; - - if (sheathed >= MAX_SHEATH_STATE) + if (packet.CurrentSheathState >= MAX_SHEATH_STATE) { - LOG_ERROR("network.opcode", "Unknown sheath state {} ??", sheathed); + LOG_ERROR("network.opcode", "Unknown sheath state {} ??", packet.CurrentSheathState); return; } - GetPlayer()->SetSheath(SheathState(sheathed)); + _player->SetSheath(SheathState(packet.CurrentSheathState)); } void WorldSession::SendAttackStop(Unit const* enemy) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index bbfed5792..dc3c426f2 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -958,7 +958,7 @@ void WorldSession::HandleCompleteCinematic(WorldPacket& /*recv_data*/) LOG_DEBUG("network", "WORLD: Received CMSG_COMPLETE_CINEMATIC"); } // If player has sight bound to visual waypoint NPC we should remove it - GetPlayer()->EndCinematic(); + GetPlayer()->GetCinematicMgr()->EndCinematic(); } void WorldSession::HandleNextCinematicCamera(WorldPacket& /*recv_data*/) @@ -967,7 +967,7 @@ void WorldSession::HandleNextCinematicCamera(WorldPacket& /*recv_data*/) LOG_DEBUG("network", "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA"); } // Sent by client when cinematic actually begun. So we begin the server side process - GetPlayer()->BeginCinematic(); + GetPlayer()->GetCinematicMgr()->BeginCinematic(); } void WorldSession::HandleFeatherFallAck(WorldPacket& recv_data) diff --git a/src/server/game/Loot/LootItemStorage.cpp b/src/server/game/Loot/LootItemStorage.cpp index def74faff..3f111a842 100644 --- a/src/server/game/Loot/LootItemStorage.cpp +++ b/src/server/game/Loot/LootItemStorage.cpp @@ -43,7 +43,7 @@ void LootItemStorage::LoadStorageFromDB() PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 stored items!"); + LOG_WARN("server.loading", ">> Loaded 0 stored items!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 90809919b..7e3b6d94f 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -1923,7 +1923,7 @@ void LoadLootTemplates_Creature() if (count) LOG_INFO("server.loading", ">> Loaded {} creature loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -1958,7 +1958,7 @@ void LoadLootTemplates_Disenchant() if (count) LOG_INFO("server.loading", ">> Loaded {} disenchanting loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -1983,7 +1983,7 @@ void LoadLootTemplates_Fishing() if (count) LOG_INFO("server.loading", ">> Loaded {} fishing loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -2019,7 +2019,7 @@ void LoadLootTemplates_Gameobject() if (count) LOG_INFO("server.loading", ">> Loaded {} gameobject loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -2045,7 +2045,7 @@ void LoadLootTemplates_Item() if (count) LOG_INFO("server.loading", ">> Loaded {} item loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -2076,7 +2076,7 @@ void LoadLootTemplates_Milling() if (count) LOG_INFO("server.loading", ">> Loaded {} milling loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -2112,7 +2112,7 @@ void LoadLootTemplates_Pickpocketing() if (count) LOG_INFO("server.loading", ">> Loaded {} pickpocketing loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -2143,7 +2143,7 @@ void LoadLootTemplates_Prospecting() if (count) LOG_INFO("server.loading", ">> Loaded {} prospecting loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -2169,7 +2169,7 @@ void LoadLootTemplates_Mail() if (count) LOG_INFO("server.loading", ">> Loaded {} mail loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -2205,7 +2205,7 @@ void LoadLootTemplates_Skinning() if (count) LOG_INFO("server.loading", ">> Loaded {} skinning loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -2249,7 +2249,7 @@ void LoadLootTemplates_Spell() if (count) LOG_INFO("server.loading", ">> Loaded {} spell loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); else - LOG_ERROR("sql.sql", ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty"); LOG_INFO("server.loading", " "); } @@ -2268,7 +2268,7 @@ void LoadLootTemplates_Player() } else { - LOG_ERROR("sql.sql", ">> Loaded 0 player loot templates. DB table `player_loot_template` is empty"); + LOG_WARN("server.loading", ">> Loaded 0 player loot templates. DB table `player_loot_template` is empty"); } LOG_INFO("server.loading", " "); diff --git a/src/server/game/Maps/TransportMgr.cpp b/src/server/game/Maps/TransportMgr.cpp index 502ccf27f..ec11e11c9 100644 --- a/src/server/game/Maps/TransportMgr.cpp +++ b/src/server/game/Maps/TransportMgr.cpp @@ -55,7 +55,7 @@ void TransportMgr::LoadTransportTemplates() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 transport templates. DB table `gameobject_template` has no transports!"); + LOG_WARN("server.loading", ">> Loaded 0 transport templates. DB table `gameobject_template` has no transports!"); return; } diff --git a/src/server/game/Misc/GameGraveyard.cpp b/src/server/game/Misc/GameGraveyard.cpp index 4542e9077..bc8199324 100644 --- a/src/server/game/Misc/GameGraveyard.cpp +++ b/src/server/game/Misc/GameGraveyard.cpp @@ -36,7 +36,7 @@ void Graveyard::LoadGraveyardFromDB() QueryResult result = WorldDatabase.Query("SELECT ID, Map, x, y, z, Comment FROM game_graveyard"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 graveyard. Table `game_graveyard` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 graveyard. Table `game_graveyard` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -362,7 +362,7 @@ void Graveyard::LoadGraveyardZones() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 graveyard-zone links. DB table `graveyard_zone` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 graveyard-zone links. DB table `graveyard_zone` is empty."); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Movement/Waypoints/WaypointMgr.cpp b/src/server/game/Movement/Waypoints/WaypointMgr.cpp index 9fda92109..9be0b3bd0 100644 --- a/src/server/game/Movement/Waypoints/WaypointMgr.cpp +++ b/src/server/game/Movement/Waypoints/WaypointMgr.cpp @@ -52,7 +52,7 @@ void WaypointMgr::Load() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 waypoints. DB table `waypoint_data` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 waypoints. DB table `waypoint_data` is empty!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index da080b709..57fe3166b 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -52,7 +52,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty."); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Petitions/PetitionMgr.cpp b/src/server/game/Petitions/PetitionMgr.cpp index c2b7fc30d..a3c5c69ff 100644 --- a/src/server/game/Petitions/PetitionMgr.cpp +++ b/src/server/game/Petitions/PetitionMgr.cpp @@ -45,7 +45,7 @@ void PetitionMgr::LoadPetitions() QueryResult result = CharacterDatabase.Query("SELECT ownerguid, petitionguid, name, type FROM petition"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 Petitions!"); + LOG_WARN("server.loading", ">> Loaded 0 Petitions!"); LOG_INFO("server.loading", " "); return; } @@ -70,7 +70,7 @@ void PetitionMgr::LoadSignatures() QueryResult result = CharacterDatabase.Query("SELECT petitionguid, playerguid, player_account FROM petition_sign"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 Petition signs!"); + LOG_WARN("server.loading", ">> Loaded 0 Petition signs!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 84d3c55e5..37a9bc41f 100644 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -581,7 +581,7 @@ void PoolMgr::LoadFromDB() if (!result) { mPoolTemplate.clear(); - LOG_INFO("server.loading", ">> Loaded 0 object pools. DB table `pool_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 object pools. DB table `pool_template` is empty."); LOG_INFO("server.loading", " "); return; } @@ -614,7 +614,7 @@ void PoolMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); LOG_INFO("server.loading", " "); } else @@ -672,7 +672,7 @@ void PoolMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); LOG_INFO("server.loading", " "); } else @@ -742,7 +742,7 @@ void PoolMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 pools in pools"); + LOG_WARN("server.loading", ">> Loaded 0 pools in pools"); LOG_INFO("server.loading", " "); } else @@ -832,7 +832,7 @@ void PoolMgr::LoadFromDB() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 quests in pools"); + LOG_WARN("server.loading", ">> Loaded 0 quests in pools"); LOG_INFO("server.loading", " "); } else diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 73760cb8c..7ca83b623 100644 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -48,7 +48,7 @@ void SystemMgr::LoadScriptWaypoints() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Server/Packets/AllPackets.h b/src/server/game/Server/Packets/AllPackets.h index 33caecf09..012400299 100644 --- a/src/server/game/Server/Packets/AllPackets.h +++ b/src/server/game/Server/Packets/AllPackets.h @@ -24,6 +24,7 @@ #include "ChatPackets.h" #include "PetPackets.h" #include "CombatLogPackets.h" +#include "CombatPackets.h" #include "GuildPackets.h" #include "MiscPackets.h" #include "TotemPackets.h" diff --git a/src/server/game/Server/Packets/CombatPackets.cpp b/src/server/game/Server/Packets/CombatPackets.cpp new file mode 100644 index 000000000..7a82cf0b8 --- /dev/null +++ b/src/server/game/Server/Packets/CombatPackets.cpp @@ -0,0 +1,23 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "CombatPackets.h" + +void WorldPackets::Combat::SetSheathed::Read() +{ + _worldPacket >> CurrentSheathState; +} diff --git a/src/server/game/Server/Packets/CombatPackets.h b/src/server/game/Server/Packets/CombatPackets.h new file mode 100644 index 000000000..7c221d8e7 --- /dev/null +++ b/src/server/game/Server/Packets/CombatPackets.h @@ -0,0 +1,40 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef CombatPackets_h__ +#define CombatPackets_h__ + +#include "Packet.h" +#include "ObjectGuid.h" + +namespace WorldPackets +{ + namespace Combat + { + class SetSheathed final : public ClientPacket + { + public: + SetSheathed(WorldPacket&& packet) : ClientPacket(CMSG_SET_SHEATHED, std::move(packet)) { } + + void Read() override; + + uint32 CurrentSheathState = 0; + }; + } +} + +#endif // CombatPackets_h__ diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3691f1f42..77052de11 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -608,7 +608,7 @@ void OpcodeTable::Initialize() /*0x1DD*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER); /*0x1DE*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER); /*0x1DF*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER); - /*0x1E0*/ DEFINE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleSetSheathedOpcode ); + /*0x1E0*/ DEFINE_HANDLER(CMSG_SET_SHEATHED, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleSetSheathedOpcode ); /*0x1E1*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER); /*0x1E2*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER); /*0x1E3*/ DEFINE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestPOIQuery ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index c3b06bfe2..037949916 100644 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -507,7 +507,7 @@ enum Opcodes : uint16 SMSG_PONG = 0x1DD, SMSG_CLEAR_COOLDOWN = 0x1DE, SMSG_GAMEOBJECT_PAGETEXT = 0x1DF, - CMSG_SETSHEATHED = 0x1E0, + CMSG_SET_SHEATHED = 0x1E0, SMSG_COOLDOWN_CHEAT = 0x1E1, SMSG_SPELL_DELAYED = 0x1E2, CMSG_QUEST_POI_QUERY = 0x1E3, diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index c07b31b6d..e54c94c92 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -1363,7 +1363,7 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co case CMSG_CORPSE_MAP_POSITION_QUERY: // 0 1 case CMSG_MOVE_TIME_SKIPPED: // 0 1 case MSG_QUERY_NEXT_MAIL_TIME: // 0 1 - case CMSG_SETSHEATHED: // 0 1 + case CMSG_SET_SHEATHED: // 0 1 case MSG_RAID_TARGET_UPDATE: // 0 1 case CMSG_PLAYER_LOGOUT: // 0 1 case CMSG_LOGOUT_REQUEST: // 0 1 diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 9960232ea..ea2375a9f 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -104,6 +104,11 @@ namespace WorldPackets class BuyBankSlot; } + namespace Combat + { + class SetSheathed; + } + namespace Guild { class QueryGuildInfo; @@ -794,7 +799,7 @@ public: // opcodes handlers void HandleAttackSwingOpcode(WorldPacket& recvPacket); void HandleAttackStopOpcode(WorldPacket& recvPacket); - void HandleSetSheathedOpcode(WorldPacket& recvPacket); + void HandleSetSheathedOpcode(WorldPackets::Combat::SetSheathed& packet); void HandleUseItemOpcode(WorldPacket& recvPacket); void HandleOpenItemOpcode(WorldPacket& recvPacket); diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 1ec03570d..f597ef06c 100644 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -54,7 +54,7 @@ void LoadSkillDiscoveryTable() if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty."); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp index 763d229e3..e6b757a2f 100644 --- a/src/server/game/Skills/SkillExtraItems.cpp +++ b/src/server/game/Skills/SkillExtraItems.cpp @@ -60,7 +60,7 @@ void LoadSkillPerfectItemTable() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell perfection definitions. DB table `skill_perfect_item_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell perfection definitions. DB table `skill_perfect_item_template` is empty."); LOG_INFO("server.loading", " "); return; } @@ -146,7 +146,7 @@ void LoadSkillExtraItemTable() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty."); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index f19f55562..5a7c615d1 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1300,7 +1300,7 @@ void SpellMgr::LoadSpellRanks() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1411,7 +1411,7 @@ void SpellMgr::LoadSpellRequired() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell required records. DB table `spell_required` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell required records. DB table `spell_required` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1528,7 +1528,7 @@ void SpellMgr::LoadSpellTargetPositions() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1632,7 +1632,7 @@ void SpellMgr::LoadSpellGroups() QueryResult result = WorldDatabase.Query("SELECT id, spell_id, special_flag FROM spell_group"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell group definitions. DB table `spell_group` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell group definitions. DB table `spell_group` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1692,7 +1692,7 @@ void SpellMgr::LoadSpellGroupStackRules() QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1743,7 +1743,7 @@ void SpellMgr::LoadSpellProcEvents() QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, procPhase, ppmRate, CustomChance, Cooldown FROM spell_proc_event"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty."); return; } @@ -1837,7 +1837,7 @@ void SpellMgr::LoadSpellProcs() QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); LOG_INFO("server.loading", " "); return; } @@ -1975,7 +1975,7 @@ void SpellMgr::LoadSpellBonusess() QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2016,7 +2016,7 @@ void SpellMgr::LoadSpellThreats() QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2057,7 +2057,7 @@ void SpellMgr::LoadSpellMixology() QueryResult result = WorldDatabase.Query("SELECT entry, pctMod FROM spell_mixology"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 mixology bonuses. DB table `spell_mixology` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 mixology bonuses. DB table `spell_mixology` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2115,7 +2115,7 @@ void SpellMgr::LoadSpellPetAuras() QueryResult result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2219,7 +2219,7 @@ void SpellMgr::LoadSpellEnchantProcData() QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2263,7 +2263,7 @@ void SpellMgr::LoadSpellLinked() QueryResult result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell"); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2505,7 +2505,7 @@ void SpellMgr::LoadSpellAreas() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell area requirements. DB table `spell_area` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell area requirements. DB table `spell_area` is empty."); LOG_INFO("server.loading", " "); return; } @@ -2776,7 +2776,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 spell custom attributes from DB. DB table `spell_custom_attr` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 spell custom attributes from DB. DB table `spell_custom_attr` is empty."); } else { diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index b0f82b65e..8e66af3ac 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -91,7 +91,7 @@ void CreatureTextMgr::LoadCreatureTexts() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_texts` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 ceature texts. DB table `creature_texts` is empty."); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 6cf59cba4..9b19143ac 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -313,7 +313,7 @@ void TicketMgr::LoadTickets() PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 GM tickets. DB table `gm_ticket` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 GM tickets. DB table `gm_ticket` is empty!"); return; } diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index 18b575587..301659781 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -50,7 +50,7 @@ void WardenCheckMgr::LoadWardenChecks() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 Warden checks. DB table `warden_checks` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 Warden checks. DB table `warden_checks` is empty!"); LOG_INFO("server.loading", " "); return; } @@ -176,7 +176,7 @@ void WardenCheckMgr::LoadWardenOverrides() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp index 0ff17a875..b1a22c2e5 100644 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -96,7 +96,7 @@ namespace WeatherMgr if (!result) { - LOG_ERROR("sql.sql", ">> Loaded 0 weather definitions. DB table `game_weather` is empty."); + LOG_WARN("server.loading", ">> Loaded 0 weather definitions. DB table `game_weather` is empty."); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 37ad4880e..b7d427100 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -62,6 +62,7 @@ #include "MMapFactory.h" #include "MapMgr.h" #include "Metric.h" +#include "M2Stores.h" #include "ObjectMgr.h" #include "Opcodes.h" #include "OutdoorPvPMgr.h" @@ -1530,6 +1531,9 @@ void World::SetInitialWorldSettings() LoadDBCStores(m_dataPath); DetectDBCLang(); + // Load cinematic cameras + LoadM2Cameras(m_dataPath); + // Load IP Location Database sIPLocation->Load(); @@ -2196,7 +2200,7 @@ void World::LoadAutobroadcasts() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty for this realm!"); + LOG_WARN("server.loading", ">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty for this realm!"); return; } @@ -3319,7 +3323,7 @@ void World::LoadWorldStates() if (!result) { - LOG_INFO("server.loading", ">> Loaded 0 world states. DB table `worldstates` is empty!"); + LOG_WARN("server.loading", ">> Loaded 0 world states. DB table `worldstates` is empty!"); LOG_INFO("server.loading", " "); return; } diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 871e67bd2..b45c949a2 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -33,6 +33,7 @@ #include "Language.h" #include "Log.h" #include "MapMgr.h" +#include "M2Stores.h" #include "ObjectMgr.h" #include "PoolMgr.h" #include "ScriptMgr.h" @@ -115,7 +116,8 @@ public: // cinematicId - ID from CinematicSequences.dbc static bool HandleDebugPlayCinematicCommand(ChatHandler* handler, uint32 cinematicId) { - if (!sCinematicSequencesStore.LookupEntry(cinematicId)) + CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId); + if (!cineSeq) { handler->PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, cinematicId); handler->SetSentErrorMessage(true); @@ -123,23 +125,19 @@ public: } // Dump camera locations - if (CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId)) + if (std::vector const* flyByCameras = GetFlyByCameras(cineSeq->cinematicCamera)) { - auto const& itr = sFlyByCameraStore.find(cineSeq->cinematicCamera); - if (itr != sFlyByCameraStore.end()) + handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->cinematicCamera); + uint32 count = 1; + for (FlyByCamera const& cam : *flyByCameras) { - handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->cinematicCamera); - uint32 count = 1; - for (FlyByCamera cam : itr->second) - { - handler->PSendSysMessage("%02u - %7ums [%f, %f, %f] Facing %f (%f degrees)", count, cam.timeStamp, cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w, cam.locations.w * (180 / M_PI)); - count++; - } - handler->PSendSysMessage("%lu waypoints dumped", itr->second.size()); + handler->PSendSysMessage("%02u - %7ums [%s (%f degrees)]", count, cam.timeStamp, cam.locations.ToString().c_str(), cam.locations.GetOrientation() * (180 / M_PI)); + ++count; } + handler->PSendSysMessage("%u waypoints dumped", flyByCameras->size()); } - handler->GetSession()->GetPlayer()->SendCinematicStart(cinematicId); + handler->GetPlayer()->SendCinematicStart(cinematicId); return true; } diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp index 566467618..ee428aeab 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ -#include "BattlegroundAV.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" @@ -59,11 +58,6 @@ enum Events EVENT_CHECK_RESET = 6 }; -enum Factions -{ - FACTION_AV_ALLIANCE = 1534 -}; - struct SpellPair { uint32 npcEntry; @@ -110,46 +104,6 @@ public: Reset(); } - void AttackStart(Unit* victim) override - { - ScriptedAI::AttackStart(victim); - - // Boss should attack as well - if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap()) - { - if (Battleground* bg = bgMap->GetBG()) - { - if (Creature* mainBoss = bg->GetBGCreature((me->GetFaction() == FACTION_AV_ALLIANCE ? AV_CPLACE_A_BOSS : AV_CPLACE_H_BOSS))) - { - if (mainBoss->IsAIEnabled && !mainBoss->IsInCombat()) - { - mainBoss->AI()->AttackStart(victim); - } - } - } - } - } - - void EnterEvadeMode() override - { - ScriptedAI::EnterEvadeMode(); - - // Evade boss - if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap()) - { - if (Battleground* bg = bgMap->GetBG()) - { - if (Creature* mainBoss = bg->GetBGCreature((me->GetFaction() == FACTION_AV_ALLIANCE ? AV_CPLACE_A_BOSS : AV_CPLACE_H_BOSS))) - { - if (mainBoss->IsAIEnabled && !mainBoss->IsInEvadeMode()) - { - mainBoss->AI()->EnterEvadeMode(); - } - } - } - } - } - void UpdateAI(uint32 diff) override { // I have a feeling this isn't blizzlike, but owell, I'm only passing by and cleaning up. diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp index 2ca4a38d3..f9a1019a3 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ -#include "BattlegroundAV.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" @@ -65,7 +64,7 @@ public: YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds } - void EnterCombat(Unit* /*victim*/) override + void EnterCombat(Unit* /*who*/) override { Talk(YELL_AGGRO); } @@ -76,52 +75,6 @@ public: Talk(YELL_RESPAWN); } - void AttackStart(Unit* victim) override - { - ScriptedAI::AttackStart(victim); - - // Mini bosses should attack as well - if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap()) - { - if (Battleground* bg = bgMap->GetBG()) - { - for (uint8 i = AV_CPLACE_H_MARSHAL_ICE; i <= AV_CPLACE_H_MARSHAL_WTOWER; ++i) - { - if (Creature* marshall = bg->GetBGCreature(i)) - { - if (marshall->IsAIEnabled && !marshall->IsInCombat()) - { - marshall->AI()->AttackStart(victim); - } - } - } - } - } - } - - void EnterEvadeMode() override - { - ScriptedAI::EnterEvadeMode(); - - // Evade mini bosses - if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap()) - { - if (Battleground* bg = bgMap->GetBG()) - { - for (uint8 i = AV_CPLACE_H_MARSHAL_ICE; i <= AV_CPLACE_H_MARSHAL_WTOWER; ++i) - { - if (Creature* marshall = bg->GetBGCreature(i)) - { - if (marshall->IsAIEnabled && !marshall->IsInEvadeMode()) - { - marshall->AI()->EnterEvadeMode(); - } - } - } - } - } - } - void UpdateAI(uint32 diff) override { if (!UpdateVictim()) diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp index eb1f0a435..f28d7d202 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ -#include "BattlegroundAV.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" @@ -60,57 +59,11 @@ public: YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); } - void EnterCombat(Unit* /*victim*/) override + void EnterCombat(Unit* /*who*/) override { Talk(YELL_AGGRO); } - void AttackStart(Unit* victim) override - { - ScriptedAI::AttackStart(victim); - - // Mini bosses should attack as well - if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap()) - { - if (Battleground* bg = bgMap->GetBG()) - { - for (uint8 i = AV_CPLACE_A_MARSHAL_SOUTH; i <= AV_CPLACE_A_MARSHAL_STONE; ++i) - { - if (Creature* marshall = bg->GetBGCreature(i)) - { - if (marshall->IsAIEnabled && !marshall->IsInCombat()) - { - marshall->AI()->AttackStart(victim); - } - } - } - } - } - } - - void EnterEvadeMode() override - { - ScriptedAI::EnterEvadeMode(); - - // Evade mini bosses - if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap()) - { - if (Battleground* bg = bgMap->GetBG()) - { - for (uint8 i = AV_CPLACE_A_MARSHAL_SOUTH; i <= AV_CPLACE_A_MARSHAL_STONE; ++i) - { - if (Creature* marshall = bg->GetBGCreature(i)) - { - if (marshall->IsAIEnabled && !marshall->IsInEvadeMode()) - { - marshall->AI()->EnterEvadeMode(); - } - } - } - } - } - } - void UpdateAI(uint32 diff) override { if (!UpdateVictim()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h index c3a409dce..fe371cba8 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h @@ -20,7 +20,7 @@ #include "CreatureAIImpl.h" -uint32 const EncounterCount = 8; +constexpr uint32 EncounterCount = 8; #define BWLScriptName "instance_blackwing_lair" #define DataHeader "BWL" @@ -59,7 +59,22 @@ enum BWLCreatureIds NPC_FLAMEGOR = 11981, NPC_CHROMAGGUS = 14020, NPC_VICTOR_NEFARIUS = 10162, - NPC_NEFARIAN = 11583 + NPC_NEFARIAN = 11583, + + // Nefarian fight + NPC_BLACK_SPAWNER = 14307, + NPC_RED_SPAWNER = 14309, + NPC_GREEN_SPAWNER = 14310, + NPC_BRONZE_SPAWNER = 14311, + NPC_BLUE_SPAWNER = 14312, + + NPC_BRONZE_DRAKONID = 14263, + NPC_BLUE_DRAKONID = 14261, + NPC_RED_DRAKONID = 14264, + NPC_GREEN_DRAKONID = 14262, + NPC_BLACK_DRAKONID = 14265, + NPC_CHROMATIC_DRAKONID = 14302, + NPC_BONE_CONSTRUCT = 14605 }; enum BWLGameObjectIds @@ -90,7 +105,12 @@ enum BWLMisc DATA_EGG_EVENT = 2, TALK_EGG_BROKEN_RAND = 3, - SAY_NEFARIAN_VAEL_INTRO = 14 + SAY_NEFARIAN_VAEL_INTRO = 14, + + // Nefarian fight + DATA_NEFARIAN_LEFT_TUNNEL = 15, + DATA_NEFARIAN_RIGHT_TUNNEL = 16, + ACTION_NEFARIUS_ADD_KILLED = 2 }; template diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 2841d6b70..7073db104 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -30,7 +30,8 @@ enum Events { // Victor Nefarius - EVENT_SPAWN_ADD = 1, + EVENT_SPAWN_ADDS = 1, + EVENT_CHECK_PHASE_2, EVENT_START_EVENT, EVENT_SHADOW_BOLT, EVENT_FEAR, @@ -52,7 +53,9 @@ enum Events EVENT_SUCCESS_2, EVENT_SUCCESS_3, - ACTION_RESET = 0 + ACTION_RESET = 0, + ACTION_KILLED = 1, + ACTION_ADD_KILLED = 2 }; enum Says @@ -105,13 +108,6 @@ enum GameObjects enum Creatures { - NPC_BRONZE_DRAKANOID = 14263, - NPC_BLUE_DRAKANOID = 14261, - NPC_RED_DRAKANOID = 14264, - NPC_GREEN_DRAKANOID = 14262, - NPC_BLACK_DRAKANOID = 14265, - NPC_CHROMATIC_DRAKANOID = 14302, - NPC_BONE_CONSTRUCT = 14605, NPC_TOTEM_C_FIRE_NOVA = 14662, NPC_TOTEM_C_STONESKIN = 14663, NPC_TOTEM_C_HEALING = 14664, @@ -136,6 +132,14 @@ enum Spells SPELL_NEFARIANS_BARRIER = 22663, + // Drakonid Spawner + SPELL_SPAWN_BLACK_DRAKONID = 22654, + SPELL_SPAWN_RED_DRAKONID = 22655, + SPELL_SPAWN_GREEN_DRAKONID = 22656, + SPELL_SPAWN_BRONZE_DRAKONID = 22657, + SPELL_SPAWN_BLUE_DRAKONID = 22658, + SPELL_SPAWN_CHROMATIC_DRAKONID = 22680, + // Nefarian SPELL_SHADOWFLAME_INITIAL = 22992, SPELL_SHADOWFLAME = 22539, @@ -167,15 +171,27 @@ enum Spells SPELL_CORRUPTED_WINDFURY_TOTEM = 23423 }; -Position const DrakeSpawnLoc[2] = // drakonid +enum Misc { - {-7591.151855f, -1204.051880f, 476.800476f, 3.0f}, - {-7514.598633f, -1150.448853f, 476.796570f, 3.0f} + MAX_DRAKONID_KILLED = 42 +}; + +Position const spawnerPositions[2] = // drakonid +{ + {-7599.32f, -1191.72f, 475.545f, 3.05f}, + {-7526.27f, -1135.04f, 473.445f, 5.76f} }; Position const NefarianSpawn = { -7348.849f, -1495.134f, 552.5152f, 1.798f }; -uint32 const Entry[5] = {NPC_BRONZE_DRAKANOID, NPC_BLUE_DRAKANOID, NPC_RED_DRAKANOID, NPC_GREEN_DRAKANOID, NPC_BLACK_DRAKANOID}; +std::unordered_map spawnerSpells = +{ + { NPC_BLACK_SPAWNER, SPELL_SPAWN_BLACK_DRAKONID }, + { NPC_BLUE_SPAWNER, SPELL_SPAWN_BLUE_DRAKONID }, + { NPC_BRONZE_SPAWNER, SPELL_SPAWN_BRONZE_DRAKONID }, + { NPC_GREEN_SPAWNER, SPELL_SPAWN_GREEN_DRAKONID }, + { NPC_RED_SPAWNER, SPELL_SPAWN_RED_DRAKONID } +}; class boss_victor_nefarius : public CreatureScript { @@ -187,6 +203,25 @@ public: boss_victor_nefariusAI(Creature* creature) : BossAI(creature, DATA_NEFARIAN) { Initialize(); + + _nefarianLeftTunnel = instance->GetData(DATA_NEFARIAN_LEFT_TUNNEL); + _nefarianRightTunnel = instance->GetData(DATA_NEFARIAN_RIGHT_TUNNEL); + + if (!_nefarianLeftTunnel || !_nefarianRightTunnel) + { + // Victor Nefarius weekly mechanic drakonid spawn + // Pick 2 drakonids and keep them for the whole save duration (the drakonids can't be repeated). + std::vector nefarianDrakonidSpawners = { NPC_BLACK_SPAWNER, NPC_BLUE_SPAWNER, NPC_BRONZE_SPAWNER, NPC_GREEN_SPAWNER, NPC_RED_SPAWNER }; + _nefarianRightTunnel = Acore::Containers::SelectRandomContainerElement(nefarianDrakonidSpawners); + // delete the previous picked one so we don't get any repeated. + nefarianDrakonidSpawners.erase(std::remove(nefarianDrakonidSpawners.begin(), nefarianDrakonidSpawners.end(), _nefarianRightTunnel), nefarianDrakonidSpawners.end()); + // Pick another one + _nefarianLeftTunnel = Acore::Containers::SelectRandomContainerElement(nefarianDrakonidSpawners); + + // save it to instance + instance->SetData(DATA_NEFARIAN_LEFT_TUNNEL, _nefarianLeftTunnel); + instance->SetData(DATA_NEFARIAN_RIGHT_TUNNEL, _nefarianRightTunnel); + } } void Initialize() @@ -200,8 +235,18 @@ public: if (me->GetMapId() == 469) { - if (!me->FindNearestCreature(NPC_NEFARIAN, 1000.0f, true)) + if (Creature* nefarian = me->FindNearestCreature(NPC_NEFARIAN, 1000.0f, true)) + { + // Nefarian is spawned and he didn't finish his intro path yet, despawn it manually. + if (nefarian->GetMotionMaster()->GetCurrentMovementGeneratorType() == MovementGeneratorType::WAYPOINT_MOTION_TYPE) + { + nefarian->DespawnOrUnsummon(); + } + } + else + { _Reset(); + } me->SetVisible(true); me->SetPhaseMask(1, true); @@ -225,6 +270,22 @@ public: me->RemoveAura(SPELL_ROOT_SELF); summons.DespawnAll(); } + + if (action == ACTION_ADD_KILLED) + { + KilledAdds++; + } + + if (action == ACTION_KILLED) + { + Unit::Kill(me, me); + } + } + + void JustDied(Unit* /*killer*/) override + { + instance->SetBossState(DATA_NEFARIAN, DONE); + instance->SaveToDB(); } void BeginEvent() @@ -241,19 +302,8 @@ public: events.ScheduleEvent(EVENT_FEAR, urand(10000, 20000)); events.ScheduleEvent(EVENT_SILENCE, urand(20000, 25000)); events.ScheduleEvent(EVENT_MIND_CONTROL, urand(30000, 35000)); - events.ScheduleEvent(EVENT_SPAWN_ADD, 10000); - } - - void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override - { - if (summon->GetEntry() != NPC_NEFARIAN) - { - summon->UpdateEntry(NPC_BONE_CONSTRUCT); - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summon->SetReactState(REACT_PASSIVE); - summon->SetStandState(UNIT_STAND_STATE_DEAD); - ++KilledAdds; - } + events.ScheduleEvent(EVENT_SPAWN_ADDS, 10000); + events.ScheduleEvent(EVENT_CHECK_PHASE_2, 10000); } void JustSummoned(Creature* summon) override { summons.Summon(summon); } @@ -326,7 +376,7 @@ public: } // Only do this if we haven't spawned nefarian yet - if (UpdateVictim() && KilledAdds <= 42) + if (UpdateVictim() && KilledAdds <= MAX_DRAKONID_KILLED) { events.Update(diff); @@ -368,39 +418,33 @@ public: DoCastSelf(SPELL_SHADOWBLINK); events.ScheduleEvent(EVENT_SHADOWBLINK, urand(30000, 40000)); break; - case EVENT_SPAWN_ADD: - for (uint8 i=0; i<2; ++i) + case EVENT_SPAWN_ADDS: + // Spawn the spawners. + me->SummonCreature(_nefarianLeftTunnel, spawnerPositions[0]); + me->SummonCreature(_nefarianRightTunnel, spawnerPositions[1]); + break; + case EVENT_CHECK_PHASE_2: + if (KilledAdds >= MAX_DRAKONID_KILLED) { - uint32 CreatureID; - if (urand(0, 2) == 0) - CreatureID = NPC_CHROMATIC_DRAKANOID; - else - CreatureID = Entry[urand(0, 4)]; - if (Creature* dragon = me->SummonCreature(CreatureID, DrakeSpawnLoc[i])) + if (Creature* nefarian = me->SummonCreature(NPC_NEFARIAN, NefarianSpawn)) { - dragon->SetFaction(FACTION_DRAGONFLIGHT_BLACK); - dragon->AI()->AttackStart(me->GetVictim()); - } - - if (KilledAdds >= 42) - { - if (Creature* nefarian = me->SummonCreature(NPC_NEFARIAN, NefarianSpawn)) - { - nefarian->setActive(true); - nefarian->SetCanFly(true); - nefarian->SetDisableGravity(true); - nefarian->GetMotionMaster()->MovePath(NEFARIAN_PATH, false); - } - events.CancelEvent(EVENT_MIND_CONTROL); - events.CancelEvent(EVENT_FEAR); - events.CancelEvent(EVENT_SHADOW_BOLT); - events.CancelEvent(EVENT_SILENCE); - DoCastSelf(SPELL_ROOT_SELF, true); - me->SetVisible(false); - return; + nefarian->setActive(true); + nefarian->SetCanFly(true); + nefarian->SetDisableGravity(true); + nefarian->GetMotionMaster()->MovePath(NEFARIAN_PATH, false); } + events.CancelEvent(EVENT_MIND_CONTROL); + events.CancelEvent(EVENT_FEAR); + events.CancelEvent(EVENT_SHADOW_BOLT); + events.CancelEvent(EVENT_SILENCE); + DoCastSelf(SPELL_ROOT_SELF, true); + me->SetVisible(false); + // Despawn the spawners. + summons.DespawnEntry(_nefarianLeftTunnel); + summons.DespawnEntry(_nefarianRightTunnel); + return; } - events.ScheduleEvent(EVENT_SPAWN_ADD, 4000); + events.ScheduleEvent(EVENT_CHECK_PHASE_2, 1000); break; } @@ -431,6 +475,8 @@ public: private: uint32 KilledAdds; + uint32 _nefarianRightTunnel; + uint32 _nefarianLeftTunnel; }; CreatureAI* GetAI(Creature* creature) const override @@ -461,11 +507,11 @@ struct boss_nefarian : public BossAI if (_introDone) // already in combat, reset properly. { _Reset(); - if (Unit* victor = me->FindNearestCreature(NPC_VICTOR_NEFARIUS, 200.f, true)) + if (Creature* victor = me->FindNearestCreature(NPC_VICTOR_NEFARIUS, 200.f, true)) { - if (victor->ToCreature() && victor->ToCreature()->AI()) + if (victor->AI()) { - victor->ToCreature()->AI()->DoAction(ACTION_RESET); + victor->AI()->DoAction(ACTION_RESET); } } me->DespawnOrUnsummon(); @@ -478,6 +524,14 @@ struct boss_nefarian : public BossAI { _JustDied(); Talk(SAY_DEATH); + + if (Creature* victor = me->FindNearestCreature(NPC_VICTOR_NEFARIUS, 200.f, true)) + { + if (victor->AI()) + { + victor->AI()->DoAction(ACTION_KILLED); + } + } } void KilledUnit(Unit* victim) override @@ -725,12 +779,12 @@ struct npc_corrupted_totem : public ScriptedAI std::vector mobsEntries; mobsEntries.push_back(NPC_NEFARIAN); mobsEntries.push_back(NPC_BONE_CONSTRUCT); - mobsEntries.push_back(NPC_BRONZE_DRAKANOID); - mobsEntries.push_back(NPC_BLUE_DRAKANOID); - mobsEntries.push_back(NPC_RED_DRAKANOID); - mobsEntries.push_back(NPC_GREEN_DRAKANOID); - mobsEntries.push_back(NPC_BLACK_DRAKANOID); - mobsEntries.push_back(NPC_CHROMATIC_DRAKANOID); + mobsEntries.push_back(NPC_BRONZE_DRAKONID); + mobsEntries.push_back(NPC_BLUE_DRAKONID); + mobsEntries.push_back(NPC_RED_DRAKONID); + mobsEntries.push_back(NPC_GREEN_DRAKONID); + mobsEntries.push_back(NPC_BLACK_DRAKONID); + mobsEntries.push_back(NPC_CHROMATIC_DRAKONID); for (auto& entry : mobsEntries) { @@ -1125,6 +1179,33 @@ class spell_shadowblink : public SpellScript } }; +// 22659 +class spell_spawn_drakonid : public SpellScript +{ + PrepareSpellScript(spell_spawn_drakonid); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SPAWN_BLACK_DRAKONID, SPELL_SPAWN_BLUE_DRAKONID, SPELL_SPAWN_BRONZE_DRAKONID, SPELL_SPAWN_GREEN_DRAKONID, SPELL_SPAWN_RED_DRAKONID }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (!caster) + { + return; + } + + caster->CastSpell(caster, spawnerSpells[caster->GetEntry()], true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_spawn_drakonid::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + void AddSC_boss_nefarian() { new boss_victor_nefarius(); @@ -1137,4 +1218,5 @@ void AddSC_boss_nefarian() RegisterSpellScript(aura_class_call_berserk); RegisterSpellScript(spell_corrupted_totems); RegisterSpellScript(spell_shadowblink); + RegisterSpellScript(spell_spawn_drakonid); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp index 44d79ceb3..d7dfb96ac 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp @@ -75,6 +75,8 @@ public: // Razorgore EggCount = 0; EggEvent = 0; + NefarianLeftTunnel = 0; + NefarianRightTunnel = 0; } void OnCreatureCreate(Creature* creature) override @@ -90,9 +92,7 @@ public: chromaggusGUID = creature->GetGUID(); break; case NPC_BLACKWING_DRAGON: - case NPC_BLACKWING_TASKMASTER: case NPC_BLACKWING_LEGIONAIRE: - case NPC_BLACKWING_WARLOCK: case NPC_BLACKWING_MAGE: if (Creature* razor = instance->GetCreature(razorgoreGUID)) if (CreatureAI* razorAI = razor->AI()) @@ -104,6 +104,24 @@ public: case NPC_VICTOR_NEFARIUS: victorNefariusGUID = creature->GetGUID(); break; + case NPC_BLACK_DRAKONID: + case NPC_BLUE_DRAKONID: + case NPC_BRONZE_DRAKONID: + case NPC_CHROMATIC_DRAKONID: + case NPC_GREEN_DRAKONID: + case NPC_RED_DRAKONID: + if (Creature* nefarius = instance->GetCreature(victorNefariusGUID)) + { + if (CreatureAI* nefariusAI = nefarius->AI()) + { + nefariusAI->JustSummoned(creature); + } + } + if (creature->AI()) + { + creature->AI()->DoZoneInCombat(); + } + break; default: break; } @@ -168,6 +186,21 @@ public: } } + uint32 GetData(uint32 data) const override + { + switch (data) + { + case DATA_NEFARIAN_LEFT_TUNNEL: + return NefarianLeftTunnel; + case DATA_NEFARIAN_RIGHT_TUNNEL: + return NefarianRightTunnel; + default: + break; + } + + return 0; + } + bool CheckRequiredBosses(uint32 bossId, Player const* /* player */) const override { switch (bossId) @@ -270,6 +303,16 @@ public: break; } } + + if (type == DATA_NEFARIAN_LEFT_TUNNEL) + { + NefarianLeftTunnel = data; + } + + if (type == DATA_NEFARIAN_RIGHT_TUNNEL) + { + NefarianRightTunnel = data; + } } ObjectGuid GetGuidData(uint32 type) const override @@ -278,6 +321,8 @@ public: { case DATA_RAZORGORE_THE_UNTAMED: return razorgoreGUID; + case DATA_LORD_VICTOR_NEFARIUS: + return victorNefariusGUID; case DATA_CHROMAGGUS: return chromaggusGUID; case DATA_GO_CHROMAGGUS_DOOR: @@ -294,6 +339,32 @@ public: //! HACK, needed because of buggy CreatureAI after charm if (unit->GetEntry() == NPC_RAZORGORE && GetBossState(DATA_RAZORGORE_THE_UNTAMED) != DONE) SetBossState(DATA_RAZORGORE_THE_UNTAMED, DONE); + + switch (unit->GetEntry()) + { + case NPC_BLACK_DRAKONID: + case NPC_BLUE_DRAKONID: + case NPC_BRONZE_DRAKONID: + case NPC_CHROMATIC_DRAKONID: + case NPC_GREEN_DRAKONID: + case NPC_RED_DRAKONID: + if (Creature* summon = unit->ToCreature()) + { + summon->UpdateEntry(NPC_BONE_CONSTRUCT); + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summon->SetReactState(REACT_PASSIVE); + summon->SetStandState(UNIT_STAND_STATE_DEAD); + + if (Creature* nefarius = instance->GetCreature(victorNefariusGUID)) + { + if (nefarius->AI()) + { + nefarius->AI()->DoAction(ACTION_NEFARIUS_ADD_KILLED); + } + } + } + break; + } } void Update(uint32 diff) override @@ -331,6 +402,54 @@ public: } } + std::string GetSaveData() override + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "B W L " << GetBossSaveData() << NefarianLeftTunnel << ' ' << NefarianRightTunnel; + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(char const* data) override + { + if (!data) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(data); + + char dataHead1, dataHead2, dataHead3; + + std::istringstream loadStream(data); + loadStream >> dataHead1 >> dataHead2 >> dataHead3; + + if (dataHead1 == 'B' && dataHead2 == 'W' && dataHead3 == 'L') + { + for (uint32 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState == FAIL || tmpState > SPECIAL) + tmpState = NOT_STARTED; + SetBossState(i, EncounterState(tmpState)); + } + + loadStream >> NefarianLeftTunnel; + loadStream >> NefarianRightTunnel; + } + else + { + OUT_LOAD_INST_DATA_FAIL; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } + protected: ObjectGuid razorgoreGUID; ObjectGuid chromaggusGUID; @@ -344,6 +463,10 @@ public: uint32 EggEvent; GuidList EggList; + // Nefarian + uint32 NefarianLeftTunnel; + uint32 NefarianRightTunnel; + // Misc EventMap _events; }; diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp index 0bc55135d..bded06f65 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -22,6 +22,7 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "sunken_temple.h" +#include "Unit.h" class instance_sunken_temple : public InstanceMapScript { @@ -48,6 +49,10 @@ public: case NPC_JAMMAL_AN_THE_PROPHET: _jammalanGUID = creature->GetGUID(); break; + case NPC_SHADE_OF_ERANIKUS: + _shadeOfEranikusGUID = creature->GetGUID(); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + break; } if (creature->IsAlive() && creature->GetSpawnId() && creature->GetCreatureType() == CREATURE_TYPE_DRAGONKIN && creature->GetEntry() != NPC_SHADE_OF_ERANIKUS) @@ -58,6 +63,12 @@ public: { if (unit->GetTypeId() == TYPEID_UNIT && unit->GetCreatureType() == CREATURE_TYPE_DRAGONKIN && unit->GetEntry() != NPC_SHADE_OF_ERANIKUS) _dragonkinList.remove(unit->GetGUID()); + if (unit->GetEntry() == NPC_JAMMAL_AN_THE_PROPHET) + { + if (Creature* cr = instance->GetCreature(_shadeOfEranikusGUID)) + cr->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } void OnGameObjectCreate(GameObject* gameobject) override @@ -193,6 +204,7 @@ public: ObjectGuid _forcefieldGUID; ObjectGuid _jammalanGUID; + ObjectGuid _shadeOfEranikusGUID; GuidList _dragonkinList; EventMap _events; }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index cdbd9e830..563e80ece 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -31,8 +31,8 @@ enum Says { SAY_AGGRO = 0, SAY_FLEEING = 1, - SAY_MINION_DESTROY = 2, // Where does it belong? - SAY_PROTECT_ALTAR = 3 // Where does it belong? + SAY_MINION_DESTROY = 2, + SAY_PROTECT_ALTAR = 3 }; enum Spells @@ -203,8 +203,31 @@ public: } }; +class at_zulgurub_temple_speech : public OnlyOnceAreaTriggerScript +{ +public: + at_zulgurub_temple_speech() : OnlyOnceAreaTriggerScript("at_zulgurub_temple_speech") {} + + bool _OnTrigger(Player* player, const AreaTrigger* /*at*/) override + { + if (InstanceScript* instance = player->GetInstanceScript()) + { + if (Creature* hakkar = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_HAKKAR))) + { + if (hakkar->GetAI()) + { + hakkar->AI()->Talk(SAY_MINION_DESTROY); + } + } + return false; + } + return false; + } +}; + void AddSC_boss_hakkar() { new boss_hakkar(); new at_zulgurub_entrance_speech(); + new at_zulgurub_temple_speech(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 7a40af519..e681e0751 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -226,6 +226,7 @@ public: bool berserk{ false }; bool bAchievCheese{ true }; bool bAchievGettingCold{ true }; + bool bAchievCacheRare{ true }; bool bAchievCoolestFriends{ true }; uint16 addSpawnTimer{ 0 }; @@ -240,6 +241,7 @@ public: berserk = false; bAchievCheese = true; bAchievGettingCold = true; + bAchievCacheRare = true; bAchievCoolestFriends = true; me->SetSheath(SHEATH_STATE_MELEE); @@ -423,6 +425,7 @@ public: case EVENT_HARD_MODE_MISSED: { Talk(TEXT_HM_MISS); + bAchievCacheRare = false; if (pInstance) { if (GameObject* go = pInstance->instance->GetGameObject(pInstance->GetGuidData(GO_HODIR_CHEST_HARD))) @@ -591,6 +594,8 @@ public: return (bAchievCheese ? 1 : 0); case 2: return (bAchievGettingCold ? 1 : 0); + case 3: + return (bAchievCacheRare ? 1 : 0); case 4: return (bAchievCoolestFriends ? 1 : 0); } diff --git a/src/server/shared/DataStores/DBCEnums.h b/src/server/shared/DataStores/DBCEnums.h index 7cf810ac6..e5a1c7008 100644 --- a/src/server/shared/DataStores/DBCEnums.h +++ b/src/server/shared/DataStores/DBCEnums.h @@ -18,6 +18,23 @@ #ifndef DBCENUMS_H #define DBCENUMS_H +#pragma pack(push, 1) + +struct DBCPosition2D +{ + float X; + float Y; +}; + +struct DBCPosition3D +{ + float X; + float Y; + float Z; +}; + +#pragma pack(pop) + // Client expected level limitation, like as used in DBC item max levels for "until max player level" // use as default max player level, must be fit max level for used client // also see MAX_LEVEL and STRONG_MAX_LEVEL define diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h index dbe5ae570..8b09daee0 100644 --- a/src/server/shared/DataStores/DBCStore.h +++ b/src/server/shared/DataStores/DBCStore.h @@ -21,124 +21,9 @@ #include "Common.h" #include "DBCStorageIterator.h" #include "Errors.h" -#include -#include #include #include - // Structures for M4 file. Source: https://wowdev.wiki -template -struct M2SplineKey -{ - T p0; - T p1; - T p2; -}; - -struct M2Header -{ - char Magic[4]; // "MD20" - uint32 Version; // The version of the format. - uint32 lName; // Length of the model's name including the trailing \0 - uint32 ofsName; // Offset to the name, it seems like models can get reloaded by this name.should be unique, i guess. - uint32 GlobalModelFlags; // 0x0001: tilt x, 0x0002: tilt y, 0x0008: add 2 fields in header, 0x0020: load .phys data (MoP+), 0x0080: has _lod .skin files (MoP?+), 0x0100: is camera related. - uint32 nGlobalSequences; - uint32 ofsGlobalSequences; // A list of timestamps. - uint32 nAnimations; - uint32 ofsAnimations; // Information about the animations in the model. - uint32 nAnimationLookup; - uint32 ofsAnimationLookup; // Mapping of global IDs to the entries in the Animation sequences block. - uint32 nBones; // MAX_BONES = 0x100 - uint32 ofsBones; // Information about the bones in this model. - uint32 nKeyBoneLookup; - uint32 ofsKeyBoneLookup; // Lookup table for key skeletal bones. - uint32 nVertices; - uint32 ofsVertices; // Vertices of the model. - uint32 nViews; // Views (LOD) are now in .skins. - uint32 nSubmeshAnimations; - uint32 ofsSubmeshAnimations; // Submesh color and alpha animations definitions. - uint32 nTextures; - uint32 ofsTextures; // Textures of this model. - uint32 nTransparency; - uint32 ofsTransparency; // Transparency of textures. - uint32 nUVAnimation; - uint32 ofsUVAnimation; - uint32 nTexReplace; - uint32 ofsTexReplace; // Replaceable Textures. - uint32 nRenderFlags; - uint32 ofsRenderFlags; // Blending modes / render flags. - uint32 nBoneLookupTable; - uint32 ofsBoneLookupTable; // A bone lookup table. - uint32 nTexLookup; - uint32 ofsTexLookup; // The same for textures. - uint32 nTexUnits; // possibly removed with cata?! - uint32 ofsTexUnits; // And texture units. Somewhere they have to be too. - uint32 nTransLookup; - uint32 ofsTransLookup; // Everything needs its lookup. Here are the transparencies. - uint32 nUVAnimLookup; - uint32 ofsUVAnimLookup; - G3D::AABox BoundingBox; // min/max( [1].z, 2.0277779f ) - 0.16f seems to be the maximum camera height - float BoundingSphereRadius; - G3D::AABox CollisionBox; - float CollisionSphereRadius; - uint32 nBoundingTriangles; - uint32 ofsBoundingTriangles; // Our bounding volumes. Similar structure like in the old ofsViews. - uint32 nBoundingVertices; - uint32 ofsBoundingVertices; - uint32 nBoundingNormals; - uint32 ofsBoundingNormals; - uint32 nAttachments; - uint32 ofsAttachments; // Attachments are for weapons etc. - uint32 nAttachLookup; - uint32 ofsAttachLookup; // Of course with a lookup. - uint32 nEvents; - uint32 ofsEvents; // Used for playing sounds when dying and a lot else. - uint32 nLights; - uint32 ofsLights; // Lights are mainly used in loginscreens but in wands and some doodads too. - uint32 nCameras; // Format of Cameras changed with version 271! - uint32 ofsCameras; // The cameras are present in most models for having a model in the Character-Tab. - uint32 nCameraLookup; - uint32 ofsCameraLookup; // And lookup-time again. - uint32 nRibbonEmitters; - uint32 ofsRibbonEmitters; // Things swirling around. See the CoT-entrance for light-trails. - uint32 nParticleEmitters; - uint32 ofsParticleEmitters; // Spells and weapons, doodads and loginscreens use them. Blood dripping of a blade? Particles. - uint32 nBlendMaps; // This has to deal with blending. Exists IFF (flags & 0x8) != 0. When set, textures blending is overriden by the associated array. See M2/WotLK#Blend_mode_overrides - uint32 ofsBlendMaps; // Same as above. Points to an array of uint16 of nBlendMaps entries -- From WoD information.}; -}; - -struct M2Array -{ - uint32_t number; - uint32 offset_elements; -}; -struct M2Track -{ - uint16_t interpolation_type; - uint16_t global_sequence; - M2Array timestamps; - M2Array values; -}; - -struct M2Camera -{ - uint32_t type; // 0: portrait, 1: characterinfo; -1: else (flyby etc.); referenced backwards in the lookup table. - float fov; // No radians, no degrees. Multiply by 35 to get degrees. - float far_clip; - float near_clip; - M2Track positions; // How the camera's position moves. Should be 3*3 floats. - G3D::Vector3 position_base; - M2Track target_positions; // How the target moves. Should be 3*3 floats. - G3D::Vector3 target_position_base; - M2Track rolldata; // The camera can have some roll-effect. Its 0 to 2*Pi. -}; - -struct FlyByCamera -{ - uint32 timeStamp; - G3D::Vector4 locations; -}; - /// Interface class for common access class DBCStorageBase { diff --git a/src/server/shared/DataStores/DBCStructure.h b/src/server/shared/DataStores/DBCStructure.h index 61e27c622..59b5f19e3 100644 --- a/src/server/shared/DataStores/DBCStructure.h +++ b/src/server/shared/DataStores/DBCStructure.h @@ -692,13 +692,11 @@ struct ChrRacesEntry struct CinematicCameraEntry { - uint32 id; // 0 index - char const* filename; // 1 - uint32 soundid; // 2 in SoundEntries.dbc or 0 - float base_x; // 3 - float base_y; // 4 - float base_z; // 5 - float base_o; // 6 + uint32 ID; // 0 + char const* Model; // 1 Model filename (translate .mdx to .m2) + uint32 SoundID; // 2 Sound ID (voiceover for cinematic) + DBCPosition3D Origin; // 3-5 Position in map used for basis for M2 co-ordinates + float OriginFacing; // 6 Orientation in map used for basis for M2 co-ordinates }; struct CinematicSequencesEntry diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 2f6ab1199..955119f2d 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -1097,7 +1097,7 @@ void ExtractCameraFiles(int locale, bool basicLocale) std::vector camerafiles; size_t cam_count = camdbc.getRecordCount(); - for (uint32 i = 0; i < cam_count; ++i) + for (size_t i = 0; i < cam_count; ++i) { std::string camFile(camdbc.getRecord(i).getString(1)); size_t loc = camFile.find(".mdx");