diff --git a/data/sql/updates/db_world/2022_05_25_04.sql b/data/sql/updates/db_world/2022_05_25_04.sql new file mode 100644 index 000000000..344cf8960 --- /dev/null +++ b/data/sql/updates/db_world/2022_05_25_04.sql @@ -0,0 +1,3 @@ +-- DB update 2022_05_25_03 -> 2022_05_25_04 +-- (Hunter) Set Lock and Load procPhase to 0, allowing Black Arrow procs +UPDATE `spell_proc_event` SET `procPhase`=0 WHERE `entry` = -56342; diff --git a/data/sql/updates/db_world/2022_05_26_00.sql b/data/sql/updates/db_world/2022_05_26_00.sql new file mode 100644 index 000000000..a44dd6a40 --- /dev/null +++ b/data/sql/updates/db_world/2022_05_26_00.sql @@ -0,0 +1,10 @@ +-- DB update 2022_05_25_04 -> 2022_05_26_00 +-- + +-- Content info for Durotar Shaman Quest [Rune-Inscribed Parchment] +-- EN/US Text +UPDATE `page_text` SET `Text` = "Lok-tar, $gbrother:sister;. The elements beckon you closer and bid me to show you the path of the shaman. The spirits of our ancestors watch from beyond and swell with pride knowing you have joined our ranks.$B$BWhen you are ready, seek me out near the entrance to the Den. It is there that I will be training others of our kind. Until then, may the wind be at your back.$B$BShikrik, Shaman Trainer" WHERE `id` = 2461; + +-- FR Text +UPDATE `page_text_locale` SET `Text` = "Lok-tar, $gfrère:sœur;. Les éléments annoncent votre venue et me demandent de vous guider sur la voie du chaman. Les esprits de nos ancêtres observent depuis l'au-delà et tremblent de fierté à l'idée que vous ayez rejoint nos rangs.$B$BQuand vous le jugerez bon, venez me voir à l'entrée de l'Antre. C'est là que je forme les nôtres. Jusque là, que les vents vous soient favorables.$B$BShikrik, Maître des chamans" WHERE `id` = 2461 AND `locale` = 'frFR'; + diff --git a/data/sql/updates/db_world/2022_05_26_01.sql b/data/sql/updates/db_world/2022_05_26_01.sql new file mode 100644 index 000000000..780355371 --- /dev/null +++ b/data/sql/updates/db_world/2022_05_26_01.sql @@ -0,0 +1,13 @@ +-- DB update 2022_05_26_00 -> 2022_05_26_01 + +-- Change text and remove 10601 as the BroadcastTextId 'till sniff data +DELETE FROM `creature_text` WHERE `CreatureID`= 11380 AND `GroupID`=0 AND `ID`=0; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(11380, 0, 0, 'Grats!', 14, 0, 100, 0, 0, 0, 0, 3, 'mandokir SAY_GRATS_JINDO'); + +-- Adjust dual dialogue on level up for Mandokir +UPDATE `creature_text` SET `Probability`=75, `comment`='mandokir SAY_DING_KILL_1' WHERE `CreatureID`=11382 AND `GroupID`=1 AND `ID`=0; +DELETE FROM `creature_text` WHERE `CreatureID`= 11382 AND `GroupID`=1 AND `ID`=1; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Probability`, `comment`) VALUES +('11382', '1', '1', 'Your deaths feed my strength!', '14', '25', 'mandokir SAY_DING_KILL_2'); + diff --git a/data/sql/updates/db_world/2022_05_29_00.sql b/data/sql/updates/db_world/2022_05_29_00.sql new file mode 100644 index 000000000..79298de7a --- /dev/null +++ b/data/sql/updates/db_world/2022_05_29_00.sql @@ -0,0 +1,4 @@ +-- DB update 2022_05_26_01 -> 2022_05_29_00 +-- +UPDATE `smart_scripts` SET `action_type`=45, `action_param1`=0, `action_param2`=1 WHERE `entryorguid`=2471801 AND `source_type`=9 AND `id`=3; +UPDATE `smart_scripts` SET `entryorguid`=24823, `source_type`=0, `event_type`=38, `event_param1`=0, `event_param2`=1 WHERE `entryorguid`=2482300 AND `source_type`=9 AND `id`=0; diff --git a/data/sql/updates/db_world/2022_05_29_01.sql b/data/sql/updates/db_world/2022_05_29_01.sql new file mode 100644 index 000000000..dd53df513 --- /dev/null +++ b/data/sql/updates/db_world/2022_05_29_01.sql @@ -0,0 +1,30 @@ +-- DB update 2022_05_29_00 -> 2022_05_29_01 +-- Quest 8891 "Abandoned Investigations" turn in script + +-- Magister Duskwither SAI +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=15951; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (15951) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (159510) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`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 +(15951,0,0,0,20,0,100,0,8891,0,0,0,0,80,159510,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Magister Duskwither - ON Quest Reward (Abandoned Investigations) - Run Script'), +(159510,9,0,0,0,0,100,0,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Magister Duskwither - Script - Remove npc flags'), +(159510,9,1,0,0,0,100,0,3000,3000,0,0,0,71,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Magister Duskwither - Script - Update equipment to book'), +(159510,9,2,0,0,0,100,0,1500,1500,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0.61086523,'Magister Duskwither - Script - Set facing'), +(159510,9,3,0,0,0,100,0,8000,8000,0,0,0,5,61,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Magister Duskwither - Script - Play emote OneShotAttackThrown'), +(159510,9,4,0,0,0,100,0,0,0,0,0,0,71,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Magister Duskwither - Script - Update equipment to none'), +(159510,9,5,0,0,0,100,0,1000,1000,0,0,0,50,181012,16,0,0,0,0,8,0,0,0,0,9049.71,-7434.27,84.6563,2.09439,'Magister Duskwither - Script - Spawn Magister Duskwithers Journal'), +(159510,9,6,0,0,0,100,0,6000,6000,0,0,0,11,26660,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Magister Duskwither - Script - CAST Duskwither''s Fireball'), +(159510,9,7,0,0,0,100,0,4000,4000,0,0,0,50,181013,12,0,0,0,0,8,0,0,0,0,9049.428,-7434.1753,85.13704,1.2566359,'Magister Duskwither - Script - Spawn Fire'), +(159510,9,8,0,0,0,100,0,2000,2000,0,0,0,71,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Magister Duskwither - Script - Update equipment to staff'), +(159510,9,9,0,0,0,100,0,300,300,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Magister Duskwither - Script - Say Line 1'), +(159510,9,10,0,0,0,100,0,6000,6000,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0,5.1487212,'Magister Duskwither - Script - Set facing'), +(159510,9,11,0,0,0,100,0,2000,2000,0,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Magister Duskwither - Script - Set npc flags'); + +-- Add Missing book equipment +DELETE FROM `creature_equip_template` WHERE `CreatureID`=15951 AND `ID`=2; +INSERT INTO `creature_equip_template` (`CreatureID`,`ID`,`ItemID1`,`ItemID2`,`ItemID3`,`VerifiedBuild`) VALUES (15951,2,12751,0,0,0); + +-- Add missing spell target position +DELETE FROM `spell_target_position` WHERE `ID`=26660; +INSERT INTO `spell_target_position` (`ID`,`EffectIndex`,`MapID`,`PositionX`,`PositionY`,`PositionZ`,`Orientation`,`VerifiedBuild`) VALUES +(26660,0,530,9050,-7434,85,0,0); diff --git a/src/cmake/googletest-download.cmake b/src/cmake/googletest-download.cmake index 1cc4361e5..0d7cd6744 100644 --- a/src/cmake/googletest-download.cmake +++ b/src/cmake/googletest-download.cmake @@ -22,7 +22,7 @@ ExternalProject_Add( SOURCE_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-src" BINARY_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-build" GIT_REPOSITORY - https://github.com/google/googletest.git + https://github.com/Helias/googletest.git GIT_TAG main CONFIGURE_COMMAND "" diff --git a/src/server/database/Database/Implementation/CharacterDatabase.cpp b/src/server/database/Database/Implementation/CharacterDatabase.cpp index 9b7aa0501..314c37b17 100644 --- a/src/server/database/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp @@ -36,7 +36,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_INS_CHARACTER_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC); PrepareStatement(CHAR_UPD_CHARACTER_BAN, "UPDATE character_banned SET active = 0 WHERE guid = ? AND active != 0", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_CHARACTER_BAN, "DELETE cb FROM character_banned cb INNER JOIN characters c ON c.guid = cb.guid WHERE c.account = ?", CONNECTION_ASYNC); - PrepareStatement(CHAR_SEL_BANINFO, "SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM character_banned WHERE guid = ? ORDER BY bandate ASC", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_BANINFO, "SELECT FROM_UNIXTIME(bandate, '%Y-%m-%d %H:%i:%s'), unbandate-bandate, active, unbandate, banreason, bannedby FROM character_banned WHERE guid = ? ORDER BY bandate ASC", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH); PrepareStatement(CHAR_SEL_BANNED_NAME, "SELECT characters.name FROM characters, character_banned WHERE character_banned.guid = ? AND character_banned.guid = characters.guid", CONNECTION_SYNCH); diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index f17e470fc..d8a596b33 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -292,7 +292,7 @@ public: static bool HandleBanInfoHelper(uint32 accountId, char const* accountName, ChatHandler* handler) { - QueryResult result = LoginDatabase.Query("SELECT FROM_UNIXTIME(bandate, '%Y-%m-%d..%H:%I:%s') as bandate, unbandate-bandate, active, unbandate, banreason, bannedby FROM account_banned WHERE id = '{}' ORDER BY bandate ASC", accountId); + QueryResult result = LoginDatabase.Query("SELECT FROM_UNIXTIME(bandate, '%Y-%m-%d..%H:%i:%s') as bandate, unbandate-bandate, active, unbandate, banreason, bannedby FROM account_banned WHERE id = '{}' ORDER BY bandate ASC", accountId); if (!result) { handler->PSendSysMessage(LANG_BANINFO_NOACCOUNTBAN, accountName); @@ -380,7 +380,14 @@ public: std::string IP = ipStr; LoginDatabase.EscapeString(IP); - QueryResult result = LoginDatabase.Query("SELECT ip, FROM_UNIXTIME(bandate), FROM_UNIXTIME(unbandate), unbandate-UNIX_TIMESTAMP(), banreason, bannedby, unbandate-bandate FROM ip_banned WHERE ip = '{}'", IP); + QueryResult result = LoginDatabase.Query("\ + SELECT \ + ip, FROM_UNIXTIME(bandate, '%Y-%m-%d %H:%i:%s'), FROM_UNIXTIME(unbandate, '%Y-%m-%d %H:%i:%s'), \ + IF (unbandate > UNIX_TIMESTAMP(), unbandate - UNIX_TIMESTAMP(), 0) AS timeRemaining, \ + banreason, bannedby, unbandate - bandate = 0 AS permanent \ + FROM ip_banned \ + WHERE ip = '{}' \ + ", IP); if (!result) { handler->PSendSysMessage(LANG_BANINFO_NOIP); @@ -388,7 +395,7 @@ public: } Field* fields = result->Fetch(); - bool permanent = !fields[6].Get(); + bool permanent = fields[6].Get() == 1; handler->PSendSysMessage(LANG_BANINFO_IPENTRY, fields[0].Get().c_str(), fields[1].Get().c_str(), permanent ? handler->GetAcoreString(LANG_BANINFO_NEVER) : fields[2].Get().c_str(), permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[3].Get(), true).c_str(), fields[4].Get().c_str(), fields[5].Get().c_str());