diff options
64 files changed, 781 insertions, 538 deletions
diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index 2b3796fb2fa..f829956b7bf 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -32,10 +32,10 @@ endif() if(SERVERS OR TOOLS) add_subdirectory(g3dlite) add_subdirectory(recastnavigation) + add_subdirectory(cppformat) endif() if(SERVERS) - add_subdirectory(cppformat) add_subdirectory(gsoap) endif() diff --git a/dep/SFMT/SFMT-hotfix1.diff b/dep/SFMT/SFMT-hotfix1.diff new file mode 100644 index 00000000000..ba7810dc100 --- /dev/null +++ b/dep/SFMT/SFMT-hotfix1.diff @@ -0,0 +1,14 @@ +diff --git a/dep/SFMT/SFMT.h b/dep/SFMT/SFMT.h +index 3d15d65..ccf21ce 100644 +--- a/dep/SFMT/SFMT.h ++++ b/dep/SFMT/SFMT.h +@@ -173,7 +173,8 @@ public: + uint32_t statesize = SFMT_N*4; // Size of state vector + + // Fill state vector with random numbers from seed +- ((uint32_t*)state)[0] = y; ++ uint32_t* s = (uint32_t*)&state; ++ s[0] = y; + const uint32_t factor = 1812433253U;// Multiplication factor + + for (i = 1; i < statesize; i++) { diff --git a/dep/SFMT/SFMT.h b/dep/SFMT/SFMT.h index 3d15d651e5b..ccf21cecd5f 100644 --- a/dep/SFMT/SFMT.h +++ b/dep/SFMT/SFMT.h @@ -173,7 +173,8 @@ public: uint32_t statesize = SFMT_N*4; // Size of state vector // Fill state vector with random numbers from seed - ((uint32_t*)state)[0] = y; + uint32_t* s = (uint32_t*)&state; + s[0] = y; const uint32_t factor = 1812433253U;// Multiplication factor for (i = 1; i < statesize; i++) { diff --git a/doc/UnixInstall.txt b/doc/UnixInstall.txt index 7c27e431495..a97fdd2bd31 100644 --- a/doc/UnixInstall.txt +++ b/doc/UnixInstall.txt @@ -6,10 +6,10 @@ WARNING: THIS DOCUMENTATION IS NOT ALWAYS UP TO DATE. FOR MORE UP-TO-DATE INFORMATION, CHECK THE TRINITY WIKI. ========================================================= -CHECK http://www.trinitycore.info/How-to:Linux FOR FURTHER HELP +CHECK http://www.trinitycore.info/ FOR FURTHER HELP These are instructions for installation in a Linux environment, if you are -using Windows refer to http://www.trinitycore.info/How-to:Win +using Windows refer to http://www.trinitycore.info/ Installing TrinityCore is fairly simple on a Linux machine, assuming you have all required applications @@ -25,7 +25,7 @@ you created a dir named build ad want to have your finalcompiled product installed in /home/trinity/server, an example sequence of commands can be : - cmake ../ -DPREFIX=/home/trinity/server -DTOOLS=1 -DWITH_WARNINGS=1 + cmake ../ -DCMAKE_INSTALL_PREFIX=/home/trinity/server -DTOOLS=1 -DWITH_WARNINGS=1 make make install @@ -34,24 +34,24 @@ than where to install using flags built into our cmake files. Just open up CMakeLists.txt in the main folder and take a look at some of the flags like - SERVERS Build worldserver and authserver - SCRIPTS Build core with scripts included - TOOLS Build map/vmap extraction/assembler tools - USE_SCRIPTPCH Use precompiled headers when compiling scripts - USE_COREPCH Use precompiled headers when compiling servers - WITH_WARNINGS Show all warnings during compile - WITH_COREDEBUG Include additional debug-code in core - PREFIX Set installation directory - NOJEM Do not build with jemalloc (advanced users only) - CONF_DIR Set path as default configuration directory - LIBSDIR Set path as default library directory - CMAKE_C_FLAGS Set C_FLAGS for compile (advanced users only) - CMAKE_CXX_FLAGS Set CXX_FLAGS for compile (advanced users only) - CMAKE_BUILD_TYPE Set buildtype - the supported modes are : - Release, MinSizeRel, RelWithDebInfo, Debug - -Of course, replace the paths in PREFIX, CONF_DIR and LIBSDIR with the -directories you wish to install TrinityCore to. The datadir is where maps, + SERVERS Build worldserver and authserver + SCRIPTS Build core with scripts included + TOOLS Build map/mmaps/vmap extraction/assembler tools + USE_SCRIPTPCH Use precompiled headers when compiling scripts + USE_COREPCH Use precompiled headers when compiling servers + WITH_WARNINGS Show all warnings during compile + WITH_COREDEBUG Include additional debug-code in core + CMAKE_INSTALL_PREFIX Set installation directory + NOJEM Do not build with jemalloc (advanced users only) + CONF_DIR Set path as default configuration directory + LIBSDIR Set path as default library directory + CMAKE_C_FLAGS Set C_FLAGS for compile (advanced users only) + CMAKE_CXX_FLAGS Set CXX_FLAGS for compile (advanced users only) + CMAKE_BUILD_TYPE Set buildtype - the supported modes are : + Release, MinSizeRel, RelWithDebInfo, Debug + +Of course, replace the paths in CMAKE_INSTALL_PREFIX with the +directory you wish to install TrinityCore to. The datadir is where maps, DBCs, and SQLs are stored. The sysconfdir is where configuration files are stored. Once TrinityCore is installed you will need to apply database updates diff --git a/sql/updates/world/2015_11_20_00_world.sql b/sql/updates/world/2015_11_20_00_world.sql new file mode 100644 index 00000000000..7c5fe7ea426 --- /dev/null +++ b/sql/updates/world/2015_11_20_00_world.sql @@ -0,0 +1,35 @@ +-- +UPDATE `creature_addon` SET `auras`="44792" WHERE `guid`=100024; +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (24883, 24876, 24877, 24875); +UPDATE `creature` SET `MovementType`=0, `spawndist`=0, `position_z`=329.648 WHERE `id`=24883; + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (24883); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (24883) 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 +(24883,0,0,0,1,0,70,0,0,5000,6000,10000,11,44788,0,0,0,0,0,19,24876,20,0,0,0,0,0,"Rodin Lightning Enabler - Ooc - Cast Rodin's Lightning Bolt"), +(24883,0,1,0,1,0,70,0,0,5000,6000,10000,11,44787,0,0,0,0,0,19,24876,20,0,0,0,0,0,"Rodin Lightning Enabler - Ooc - Cast Rodin's Lightning Bolt"), +(24883,0,2,0,1,0,70,0,0,5000,6000,10000,11,44789,0,0,0,0,0,19,24876,20,0,0,0,0,0,"Rodin Lightning Enabler - Ooc - Cast Rodin's Lightning Bolt"), +(24883,0,3,0,1,0,70,0,0,5000,6000,10000,11,44791,0,0,0,0,0,19,24876,20,0,0,0,0,0,"Rodin Lightning Enabler - Ooc - Cast Rodin's Lightning Bolt"), +(24883,0,4,0,1,0,70,0,0,5000,6000,10000,11,44790,0,0,0,0,0,19,24876,20,0,0,0,0,0,"Rodin Lightning Enabler - Ooc - Cast Rodin's Lightning Bolt"); + +DELETE FROM `creature_text` WHERE `entry` IN (24876, 24875, 24877, 24874) AND `groupid`=1; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextId`) VALUES +(24874, 1, 0, 'From sundered ground the sacrament was stolen. The Shield of Aesirites is lost. Unrest will be eternal.', 12, 0, 100, 0, 0, 0, 'Fengir the Disgraced', 23970), +(24876, 1, 0, 'The Staff of Storm''s Fury pilfered. A curse upon this land! The storms will never cease!', 12, 0, 100, 0, 0, 0, 'Rodin the Reckless', 23971), +(24877, 1, 0, 'The Frozen Heart of Isuldof will consume this land until it is returned. Woe unto those that hold the heart as the curse of frozen blood besets them...', 12, 0, 100, 0, 0, 0, 'Isuldof Iceheart', 23972), +(24875, 1, 0, 'The anguish of ten-thousand years awaits any foolish enough to don the Ancient Armor of the Kvaldir. Beware the mist and fog, mortals; for with them comes your end.', 12, 0, 100, 0, 0, 0, 'Windan of the Kvaldir', 23973); + +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` IN (187023, 187026, 187022, 187027); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (187023, 187026, 187022, 187027) AND `source_type`=1; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (24876, 24875, 24877, 24874) AND `source_type`=0 AND id=2; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(187023, 1, 0, 0, 70, 0, 100, 0, 1, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 24876, 30, 0, 0, 0, 0, 0, 'Relic - On State 1 - Set data'), +(187026, 1, 0, 0, 70, 0, 100, 0, 1, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 24877, 30, 0, 0, 0, 0, 0, 'Relic - On State 1 - Set data'), +(187022, 1, 0, 0, 70, 0, 100, 0, 1, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 24874, 30, 0, 0, 0, 0, 0, 'Relic - On State 1 - Set data'), +(187027, 1, 0, 0, 70, 0, 100, 0, 1, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 24875, 30, 0, 0, 0, 0, 0, 'Relic - On State 1 - Set data'), +(24876, 0, 2, 0, 38, 0, 100, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rodin the Reckless - On data set - Say line 2'), +(24877, 0, 2, 0, 38, 0, 100, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Isuldof Iceheart - On data set - Say line 2'), +(24874, 0, 2, 0, 38, 0, 100, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fengir the Disgraced - On data set - Say line 2'), +(24875, 0, 2, 0, 38, 0, 100, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windan of the Kvaldir - On data set - Say line 2'); + +UPDATE `creature_template` SET `MovementType`=0 WHERE `entry`=30331; -- fix a DB error not related to the quest diff --git a/sql/updates/world/2015_11_22_00_world.sql b/sql/updates/world/2015_11_22_00_world.sql new file mode 100644 index 00000000000..2b70a2c97b6 --- /dev/null +++ b/sql/updates/world/2015_11_22_00_world.sql @@ -0,0 +1,2 @@ +-- Remove wrong spawn of Cornish Rex Cat in Dun Morogh: +DELETE FROM `creature` WHERE `guid`= 1528 and `id`= 7384; diff --git a/sql/updates/world/2015_11_22_01_world.sql b/sql/updates/world/2015_11_22_01_world.sql new file mode 100644 index 00000000000..ba63c72ba16 --- /dev/null +++ b/sql/updates/world/2015_11_22_01_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `game_tele` SET `name` = 'OdesyusLanding' WHERE `id` = 693; diff --git a/sql/updates/world/2015_11_22_02_world.sql b/sql/updates/world/2015_11_22_02_world.sql new file mode 100644 index 00000000000..7fcbc7ec9aa --- /dev/null +++ b/sql/updates/world/2015_11_22_02_world.sql @@ -0,0 +1,22 @@ +DELETE FROM `spell_custom_attr` WHERE `entry` IN (1130,1725,3600,14323,14324,14325,32375,32592,35009,39897,42650,43263,43264,53338,58831,58832,58833,58834,58838); +INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES +(1130, 64), -- Hunter spell 1130, Hunter's Mark Rank 1 +(1725, 64), -- Rogue spell 1725, Distract +(3600, 64), -- Greater Earthbind Totem spell 3600, Earthbind +(14323, 64), -- Hunter spell 14323, Hunter's Mark Rank 2 +(14324, 64), -- Hunter spell 14324, Hunter's Mark Rank 3 +(14325, 64), -- Hunter spell 14325, Hunter's Mark Rank 4 +(32375, 64), -- Priest Discipline spell 32375, Mass Dispel +(32592, 64), -- Priest Discipline spell 32592, Mass Dispel +-- Spell ID 35009 - Server-side - Invisibility - Reducing threat +(35009, 64), -- Triggered by Mage Invisibility (Level 68), spells 66 & 67765 +(39897, 64), -- Priest Discipline spell 39897, Mass Dispel +(42650, 64), -- Death Knight Unholy spell 42650, Army of the Dead +(43263, 64), -- Ghoul level 66 spell 43263, Ghoul Taunt +(43264, 64), -- Periodic Taunt, Trigger for Ghoul Taunt +(53338, 64), -- Hunter spell 53338, Hunter's Mark Rank 5 +(58831, 64), -- Mirror Image, spawns left Mirror Image NPC +(58832, 64), -- Mirror Image, Triggers 58831,58833,58834 +(58833, 64), -- Mirror Image, spawns center Mirror Image NPC +(58834, 64), -- Mirror Image, spawns right Mirror Image NPC +(58838, 64); -- Inherit Master's Threat List diff --git a/sql/updates/world/2015_11_22_03_world_355.sql b/sql/updates/world/2015_11_22_03_world_355.sql new file mode 100644 index 00000000000..9bf71a146d0 --- /dev/null +++ b/sql/updates/world/2015_11_22_03_world_355.sql @@ -0,0 +1,17 @@ +-- Seal of Ascension 4743 + +-- Emberstrife Template +UPDATE creature_template SET spell8=16054, AIName="SmartAI" WHERE entry=10321; + +-- Emberstrife Text +DELETE FROM creature_text WHERE entry=10321; +INSERT INTO creature_text (entry, groupid, id, TEXT, TYPE, LANGUAGE, probability, emote, duration, textrange, COMMENT) VALUES +(10321, 0, 0, "Emberstrife will falters!", 41, 0, 100, 0, 2000, 50, "Emberstrife Emote when below 10%"); + +-- Emberstrife AI +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 10321); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(10321, 0, 0, 0, 2, 0, 100, 0, 0, 10, 60000, 60000, 1, 0, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Emberstrife - Emote Below 10%'), +(10321, 0, 1, 0, 0, 0, 100, 0, 2000, 5000, 5000, 12000, 11, 9573, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Emberstrife - Flame Breath'), +(10321, 0, 2, 0, 0, 0, 100, 0, 2000, 5000, 4000, 10000, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Emberstrife - Cleave'), +(10321, 0, 3, 0, 2, 0, 100, 0, 0, 10, 60000, 60000, 11, 8269, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Emberstrife - Frenzy below 10%'); diff --git a/sql/updates/world/2015_11_23_00_world_335.sql b/sql/updates/world/2015_11_23_00_world_335.sql new file mode 100644 index 00000000000..fffc4531e5e --- /dev/null +++ b/sql/updates/world/2015_11_23_00_world_335.sql @@ -0,0 +1,74 @@ +-- +-- Quest Tomb of the Lighbringer - 9446 +-- Old scripts cleanup +DELETE FROM `script_waypoint` WHERE `entry`=17238; +-- Creature text +DELETE FROM `creature_text` WHERE `entry`=17238; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `TEXT`, `TYPE`, `LANGUAGE`, `probability`, `emote`, `duration`, `sound`, `TextRange`, `COMMENT`, `BroadcastTextId`) VALUES +(17238, 0, 0, "Shall we begin, my friend?", 12, 7, 100, 6, 0, 0, 0, "Q Tomb of the Lighbringer", 13613), +(17238, 1, 0, "This area is known to be full of foul Scourge. You may want to take a moment to prepare any defenses at your disposal.", 12, 7, 100, 1, 0, 0, 0, "Q Tomb of the Lighbringer", 13614), +(17238, 2, 0, "Beware! We are attacked!", 12, 7, 100, 5, 0, 0, 0, "Q Tomb of the Lighbringer", 13616), +(17238, 3, 0, "It must be the purity of the Mark of the Lightbringer that is drawing forth the Scourge to us. We must proceed with caution lest we be overwhelmed!", 12, 7, 100, 1, 0, 0, 0, "Q Tomb of the Lighbringer", 13617), +(17238, 4, 0, "We are beset upon again! Defend yourself!", 12, 7, 100, 5, 0, 0, 0, "Q Tomb of the Lighbringer", 13618), +(17238, 5, 0, "This land truly needs to be cleansed by the Light! Let us continue on to the tomb. It isn't far now.", 12, 7, 100, 1, 0, 0, 0, "Q Tomb of the Lighbringer", 13619), +(17238, 6, 0, "Very well, let us continue.", 12, 7, 100, 1, 0, 0, 0, "Q Tomb of the Lighbringer", 13615), +(17238, 7, 0, "Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she'll be keenly interested to know of what has transpired here.", 12, 7, 100, 2, 0, 0, 0, "Q Tomb of the Lighbringer", 13624); + +-- Anchorite Truuen AI +UPDATE `creature_template` SET `scriptname`="", `AIName`="SmartAI" WHERE `entry` IN (17238, 17233); +DELETE FROM `smart_scripts` WHERE `source_type` = 0 AND `entryorguid` IN (17238, 17233); +DELETE FROM `smart_scripts` WHERE `source_type` = 9 AND `entryorguid` IN (1723800, 1723801, 1723300); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(17238, 0, 0, 1, 19, 0, 100, 0, 9446, 0, 0, 0, 1, 0, 2000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - Quest Taken - Say text'), +(17238, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 17238, 0, 9446, 45000, 1, 17, 0, 30, 0, 0, 0, 0, 0, 'Anchorite Truuen - Quest Taken - Start WP'), +(17238, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 54, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - Quest Taken - Pause before movements'), +(17238, 0, 3, 18, 61, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - Quest Taken - Remove npc flag'), +(17238, 0, 4, 5, 40, 0, 100, 0, 3, 0, 0, 0, 54, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On wp reached - Pause at WP 3'), +(17238, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 1, 6000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On wp reached - Speak'), +(17238, 0, 6, 7, 40, 0, 100, 0, 5, 0, 0, 0, 12, 4472, 3, 60000, 1, 0, 0, 8, 0, 0, 0, 1039.984, -1577.659, 61.437, 1.753951, 'Anchorite Truuen - On wp reached - Summon creature'), +(17238, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 12, 1802, 3, 60000, 1, 0, 0, 8, 0, 0, 0, 1031.033, -1576.279, 62.436, 0.265621, 'Anchorite Truuen - On wp reached - Summon creature'), +(17238, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 2, 2000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On wp reached - Say text'), +(17238, 0, 9, 0, 40, 0, 100, 0, 7, 0, 0, 0, 1, 3, 2000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On wp reached - Say text'), +(17238, 0, 10, 11, 40, 0, 100, 0, 11, 0, 0, 0, 1, 4, 2000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On wp reached - Say text'), +(17238, 0, 11, 12, 61, 0, 100, 0, 0, 0, 0, 0, 12, 4475, 3, 60000, 1, 0, 0, 8, 0, 0, 0, 1110.658, -1742.137, 61.019, 2.413687, 'Anchorite Truuen - On wp reached - Summon creature'), +(17238, 0, 12, 13, 61, 0, 100, 0, 0, 0, 0, 0, 12, 4475, 3, 60000, 1, 0, 0, 8, 0, 0, 0, 1106.837, -1750.592, 61.174, 2.409762, 'Anchorite Truuen - On wp reached - Summon creature'), +(17238, 0, 13, 14, 61, 0, 100, 0, 0, 0, 0, 0, 12, 4475, 3, 60000, 1, 0, 0, 8, 0, 0, 0, 1111.725, -1753.404, 61.459, 2.755339, 'Anchorite Truuen - On wp reached - Summon creature'), +(17238, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 12, 4475, 3, 60000, 1, 0, 0, 8, 0, 0, 0, 1117.459, -1743.327, 61.000, 2.853514, 'Anchorite Truuen - On wp reached - Summon creature'), +(17238, 0, 15, 0, 40, 0, 100, 0, 12, 0, 0, 0, 1, 5, 2000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On wp reached - say text'), +(17238, 0, 16, 17, 40, 0, 100, 0, 17, 0, 0, 0, 12, 17233, 3, 60000, 0, 0, 0, 8, 0, 0, 0, 971.86, -1825.42, 84, 0, 'Anchorite Truuen - On wp reached - Summon creature'), +(17238, 0, 17, 0, 61, 0, 100, 0, 0, 0, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On wp reached - Kneels'), +(17238, 0, 18, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 250, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On quest taken - Set Faction'), +(17238, 0, 19, 0, 40, 0, 100, 0, 3, 0, 0, 0, 80, 1723800, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On wp reached - Action list'), +(1723800, 9, 0, 0, 0, 0, 100, 0, 15000, 15000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - Action list - Say text'), +(17238, 0, 20, 0, 38, 0, 100, 0, 0, 1, 0, 0, 80, 1723801, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - On data set - Action list'), +(1723801, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 91, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - Action list - remove kneel'), +(1723801, 9, 1, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - Action list - Say text'), +(1723801, 9, 2, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Truuen - Action list - Despawns'), +(17233, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, 1723300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghost of Uther - Just summoned - Action list'), +(1723300, 9, 0, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghost of Uther - Action list - Say text'), +(1723300, 9, 1, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghost of Uther - Action list - Say text'), +(1723300, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 17238, 20, 0, 0, 0, 0, 0, 'Ghost of Uther - Action list - Set data'), +(1723300, 9, 3, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghost of Uther - Action list - Despawn'); + +-- Waypoints +DELETE FROM `waypoints` WHERE `entry`=17238; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(17238, 1, 946, -1430, 64, "anchorite_truuen_Q9446"), +(17238, 2, 974, -1439, 66, "anchorite_truuen_Q9446"), +(17238, 3, 1031, -1474, 64, "anchorite_truuen_Q9446"), +(17238, 4, 1039, -1503, 66, "anchorite_truuen_Q9446"), +(17238, 5, 1036, -1566, 62, "anchorite_truuen_Q9446"), +(17238, 6, 1036, -1568, 62, "anchorite_truuen_Q9446"), +(17238, 7, 1038, -1662, 61, "anchorite_truuen_Q9446"), +(17238, 8, 1047, -1683, 61, "anchorite_truuen_Q9446"), +(17238, 9, 1064, -1710, 61, "anchorite_truuen_Q9446"), +(17238, 10, 1099, -1738, 61, "anchorite_truuen_Q9446"), +(17238, 11, 1113, -1746, 61, "anchorite_truuen_Q9446"), +(17238, 12, 1118, -1750, 61, "anchorite_truuen_Q9446"), +(17238, 13, 1156, -1761, 61, "anchorite_truuen_Q9446"), +(17238, 14, 1152, -1773, 61, "anchorite_truuen_Q9446"), +(17238, 15, 1080, -1802, 65, "anchorite_truuen_Q9446"), +(17238, 16, 1019, -1810, 78, "anchorite_truuen_Q9446"), +(17238, 17, 976, -1823, 81, "anchorite_truuen_Q9446"); + +UPDATE `creature_text` SET `text`="%s's will falters.", `BroadcastTextId`=5594 WHERE `entry`=10321 AND `groupid`=0 AND `id`=0; -- Fix text for a previous commit diff --git a/sql/updates/world/2015_11_23_01_world_335.sql b/sql/updates/world/2015_11_23_01_world_335.sql new file mode 100644 index 00000000000..8432c2d14fd --- /dev/null +++ b/sql/updates/world/2015_11_23_01_world_335.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `skinloot` = 0 WHERE `entry` IN (721,883,890,1933,2098,2442,2620,4166,5951,10780,12296,12297,12298,12299,17467); +-- Remove unreferenced skinning_loot_template entries because of this update: +DELETE FROM `skinning_loot_template` WHERE `Entry` IN (1933,12299,100000); diff --git a/sql/updates/world/2015_11_23_02_world_335.sql b/sql/updates/world/2015_11_23_02_world_335.sql new file mode 100644 index 00000000000..ba569d1420f --- /dev/null +++ b/sql/updates/world/2015_11_23_02_world_335.sql @@ -0,0 +1,134 @@ +-- +-- Fill in the blanks in the `Comment` fields in `skinning_loot_template`: +UPDATE `skinning_loot_template` SET `Comment`= 'Light Hide' WHERE `Item`= 783 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Light Leather' WHERE `Item`= 2318 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Medium Leather' WHERE `Item`= 2319 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Wool Cloth' WHERE `Item`= 2592 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Ruined Leather Scraps' WHERE `Item`= 2934 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Medium Hide' WHERE `Item`= 4232 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Heavy Leather' WHERE `Item`= 4234 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Heavy Hide' WHERE `Item`= 4235 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Thick Leather' WHERE `Item`= 4304 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Deviate Scale' WHERE `Item`= 6470 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Perfect Deviate Scale' WHERE `Item`= 6471 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Black Whelp Scale' WHERE `Item`= 7286 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Red Whelp Scale' WHERE `Item`= 7287 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Green Whelp Scale' WHERE `Item`= 7392 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Shadowcat Hide' WHERE `Item`= 7428 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Zesty Clam Meat' WHERE `Item`= 7974 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Scorpid Scale' WHERE `Item`= 8154 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Worn Dragonscale' WHERE `Item`= 8165 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Turtle Scale' WHERE `Item`= 8167 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Thick Hide' WHERE `Item`= 8169 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Rugged Leather' WHERE `Item`= 8170 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Rugged Hide' WHERE `Item`= 8171 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Thick Wolfhide' WHERE `Item`= 8368 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Thick Yeti Hide' WHERE `Item`= 8973 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Patch of Tainted Skin' WHERE `Item`= 11512 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Thick Yeti Fur' WHERE `Item`= 12366 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Brilliant Chromatic Scale' WHERE `Item`= 12607 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Pristine Hide of the Beast' WHERE `Item`= 12731 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Heavy Scorpid Scale' WHERE `Item`= 15408 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Scale of Onyxia' WHERE `Item`= 15410 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Green Dragonscale' WHERE `Item`= 15412 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Red Dragonscale' WHERE `Item`= 15414 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Blue Dragonscale' WHERE `Item`= 15415 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Black Dragonscale' WHERE `Item`= 15416 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Devilsaur Leather' WHERE `Item`= 15417 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Warbear Leather' WHERE `Item`= 15419 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Frostsaber Leather' WHERE `Item`= 15422 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Chimera Leather' WHERE `Item`= 15423 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Core Leather' WHERE `Item`= 17012 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Shiny Fish Scales' WHERE `Item`= 17057 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Rage Scar Yeti Hide' WHERE `Item`= 18947 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Primal Bat Leather' WHERE `Item`= 19767 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Primal Tiger Leather' WHERE `Item`= 19768 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Silithid Chitin' WHERE `Item`= 20498 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Broken Silithid Chitin' WHERE `Item`= 20499 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Light Silithid Carapace' WHERE `Item`= 20500 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Heavy Silithid Carapace' WHERE `Item`= 20501 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Knothide Leather' WHERE `Item`= 21887 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Flame Spessarite' WHERE `Item`= 21929 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Mote of Air' WHERE `Item`= 22572 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Mote of Earth' WHERE `Item`= 22573 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Mote of Life' WHERE `Item`= 22575 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Mote of Mana' WHERE `Item`= 22576 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Mote of Shadow' WHERE `Item`= 22577 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Mote of Water' WHERE `Item`= 22578 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Felweed' WHERE `Item`= 22785 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Dreaming Glory' WHERE `Item`= 22786 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Ragveil' WHERE `Item`= 22787 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Terocone' WHERE `Item`= 22789 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Ancient Lichen' WHERE `Item`= 22790 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Mana Thistle' WHERE `Item`= 22793 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Fel Lotus' WHERE `Item`= 22794 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Blood Garnet' WHERE `Item`= 23077 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Deep Peridot' WHERE `Item`= 23079 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Shadow Draenite' WHERE `Item`= 23107 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Golden Draenite' WHERE `Item`= 23112 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Azure Moonstone' WHERE `Item`= 23117 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Adamantite Ore' WHERE `Item`= 23425 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Living Ruby' WHERE `Item`= 23436 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Talasite' WHERE `Item`= 23437 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Star of Elune' WHERE `Item`= 23438 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Noble Topaz' WHERE `Item`= 23439 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Dawnstone' WHERE `Item`= 23440 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Nightseye' WHERE `Item`= 23441 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Moongraze Buck Hide' WHERE `Item`= 23677 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Crystalline Fragments' WHERE `Item`= 24189 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Unidentified Plant Parts' WHERE `Item`= 24401 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Knothide Leather Scraps' WHERE `Item`= 25649 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Crystal Infused Leather' WHERE `Item`= 25699 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Fel Scales' WHERE `Item`= 25700 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Fel Hide' WHERE `Item`= 25707 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Thick Clefthoof Leather' WHERE `Item`= 25708 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Small Mushroom' WHERE `Item`= 25813 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Zangar Caps' WHERE `Item`= 27859 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Sporeggar Mushroom' WHERE `Item`= 29453 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Cobra Scales' WHERE `Item`= 29539 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Wind Scales' WHERE `Item`= 29547 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Nether Dragonscales' WHERE `Item`= 29548 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Lionseye' WHERE `Item`= 32229 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Nethermine Flayer Hide' WHERE `Item`= 32470 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Honey-Spiced Lichen' WHERE `Item`= 33452 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Borean Leather Scraps' WHERE `Item`= 33567 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Borean Leather' WHERE `Item`= 33568 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Nether Residue' WHERE `Item`= 35229 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Ice Shard Cluster' WHERE `Item`= 36728 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Sprung Sprocket' WHERE `Item`= 36813 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Goldclover' WHERE `Item`= 36901 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Constrictor Grass' WHERE `Item`= 36902 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Adder\'s Tongue' WHERE `Item`= 36903 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Tiger Lily' WHERE `Item`= 36904 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Lichbloom' WHERE `Item`= 36905 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Icethorn' WHERE `Item`= 36906 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Talandra\'s Rose' WHERE `Item`= 36907 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Crystallized Air' WHERE `Item`= 37700 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Crystallized Earth' WHERE `Item`= 37701 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Crystallized Fire' WHERE `Item`= 37702 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Crystallized Life' WHERE `Item`= 37704 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Crystallized Water' WHERE `Item`= 37705 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Icy Dragonscale' WHERE `Item`= 38557 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Nerubian Chitin' WHERE `Item`= 38558 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Jormungar Scale' WHERE `Item`= 38561 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Geodesic Fragments' WHERE `Item`= 39220 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Frosty Mushroom' WHERE `Item`= 39516 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Handful of Cobalt Bolts' WHERE `Item`= 39681 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Overcharged Capacitor' WHERE `Item`= 39682 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Hair Trigger' WHERE `Item`= 39684 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Indestructible Frame' WHERE `Item`= 39685 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Volatile Blasting Trigger' WHERE `Item`= 39690 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Arctic Fur' WHERE `Item`= 44128 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Whizzed-Out Gizmo' WHERE `Item`= 41337 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Sprung Whirlygig' WHERE `Item`= 41338 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Stoic Mammoth Hide' WHERE `Item`= 42542 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Loque\'Nahak\'s Pelt' WHERE `Item`= 44687 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Schematic: Jeeves' WHERE `Item`= 49050 AND `Comment` IS NULL; +-- Reference loot +UPDATE `skinning_loot_template` SET `Comment`= 'Pattern: Cobrascale Gloves' WHERE `Entry`= 29724 and `Reference`= 50017 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Pattern: Windscale Hood' WHERE `Entry`= 29725 and `Reference`= 50013 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Pattern: Hood of Primal Life' WHERE `Entry`= 29726 and `Reference`= 50014 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Pattern: Gloves of the Living Touch' WHERE `Entry`= 29727 and `Reference`= 50016 AND `Comment` IS NULL; +UPDATE `skinning_loot_template` SET `Comment`= 'Pattern: Windslayer Wraps' WHERE `Entry`= 29728 and `Reference`= 50015 AND `Comment` IS NULL;UPDATE `creature_template` SET `skinloot` = 0 WHERE `entry` IN (721,883,890,1933,2098,2442,2620,4166,5951,10780,12296,12297,12298,12299,17467); +-- Remove unreferenced skinning_loot_template entries because of this update: +DELETE FROM `skinning_loot_template` WHERE `Entry` IN (1933,12299,100000); diff --git a/sql/updates/world/2015_11_23_03_world_335.sql b/sql/updates/world/2015_11_23_03_world_335.sql new file mode 100644 index 00000000000..9ef011f551e --- /dev/null +++ b/sql/updates/world/2015_11_23_03_world_335.sql @@ -0,0 +1,13 @@ +-- Mottled Boar - Skinning Loot +UPDATE `creature_template` SET `skinloot`= 3098 WHERE `entry` = 3098; +DELETE FROM `skinning_loot_template` WHERE `Entry`=3098; +INSERT INTO `skinning_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(3098, 2318, 0, 10, 0, 1, 1, 1, 1, NULL), -- Light Leather, 10% chance +(3098, 2934, 0, 88, 0, 1, 1, 1, 1, NULL); -- Ruined Leather Scraps, 88% chance + +-- Scorpid Worker - Skinning Loot +UPDATE `creature_template` SET `skinloot`= 3124 WHERE `entry` = 3124; +DELETE FROM `skinning_loot_template` WHERE `Entry`= 3124; +INSERT INTO `skinning_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(3124, 2318, 0, 10, 0, 1, 1, 1, 1, NULL), -- Light Leather, 10% chance +(3124, 2934, 0, 88, 0, 1, 1, 1, 1, NULL); -- Ruined Leather Scraps, 88% chance diff --git a/sql/updates/world/2015_11_23_04_world_335.sql b/sql/updates/world/2015_11_23_04_world_335.sql new file mode 100644 index 00000000000..845eefeb7ca --- /dev/null +++ b/sql/updates/world/2015_11_23_04_world_335.sql @@ -0,0 +1,29 @@ +SET @NPCTEXT= 724006; + +DELETE FROM `gossip_menu` WHERE `entry`=6539 AND `text_id`=@NPCTEXT; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(6539, @NPCTEXT); + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=6539 AND `id`=0; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES +(6539,0,0,'I am ready, Anachronos. Please grant me the Scepter of the Shifting Sands.',11331,1,1,0,0,0,0,'',0); + +DELETE FROM `npc_text` WHERE `ID`=@NPCTEXT; +INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `BroadcastTextID0`, `lang0`, `Probability0`, `em0_0`, `em0_1`, `em0_2`, `em0_3`, `em0_4`, `em0_5`, `text1_0`, `text1_1`, `lang1`, `Probability1`, `em1_0`, `em1_1`, `em1_2`, `em1_3`, `em1_4`, `em1_5`, `text2_0`, `text2_1`, `lang2`, `Probability2`, `em2_0`, `em2_1`, `em2_2`, `em2_3`, `em2_4`, `em2_5`, `text3_0`, `text3_1`, `lang3`, `Probability3`, `em3_0`, `em3_1`, `em3_2`, `em3_3`, `em3_4`, `em3_5`, `text4_0`, `text4_1`, `lang4`, `Probability4`, `em4_0`, `em4_1`, `em4_2`, `em4_3`, `em4_4`, `em4_5`, `text5_0`, `text5_1`, `lang5`, `Probability5`, `em5_0`, `em5_1`, `em5_2`, `em5_3`, `em5_4`, `em5_5`, `text6_0`, `text6_1`, `lang6`, `Probability6`, `em6_0`, `em6_1`, `em6_2`, `em6_3`, `em6_4`, `em6_5`, `text7_0`, `text7_1`, `lang7`, `Probability7`, `em7_0`, `em7_1`, `em7_2`, `em7_3`, `em7_4`, `em7_5`, `VerifiedBuild`) VALUES +(@NPCTEXT, "The Scepter of the Shifting Sands is whole once more, $n.$B$BIt is you who must lead your armies into the cursed fortress city of Ahn'Qiraj and mete justice to its inhabitants.$B$BVenture to Silithus and present the Scepter of the Shifting Sands to Jonathan the Revelator.", '', 11333, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 0, -1); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=6539 AND `SourceEntry`=@NPCTEXT; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=6539 AND `SourceEntry`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14,6539,@NPCTEXT,0,0,8,0,8742,0,0,0,0,0,'','Show gossip text after quest The Might of Kalimdor rewarded'), +(14,6539,@NPCTEXT,0,0,2,0,21175,1,1,1,0,0,'','Show gossip text if doesnt have item The Scepter of the Shifting Sands'), +(14,6539,@NPCTEXT,0,0,8,0,8745,0,0,1,0,0,'','Show gossip text if Treasure of the Timeless One is not rewarded'), +(15,6539,0,0,0,8,0,8742,0,0,0,0,0,'','Show gossip menu option after quest The Might of Kalimdor rewarded'), +(15,6539,0,0,0,2,0,21175,1,1,1,0,0,'','Show gossip menu option if doesnt have item The Scepter of the Shifting Sands'), +(15,6539,0,0,0,8,0,8745,0,0,1,0,0,'','Show gossip menu option if Treasure of the Timeless One is not rewarded'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=15192; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=15192; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(15192,0,0,1,62,0,100,0,6539,0,0,0,11,25861,0,0,0,0,0,7,0,0,0,0,0,0,0,'Anachronos - On Gossip Option 0 Selected - Cast \'Call Scepter DND\''), +(15192,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Anachronos - On Gossip Option 0 Selected - Close Gossip'); diff --git a/sql/updates/world/2015_11_23_05_world.sql b/sql/updates/world/2015_11_23_05_world.sql new file mode 100644 index 00000000000..579af5a5ca1 --- /dev/null +++ b/sql/updates/world/2015_11_23_05_world.sql @@ -0,0 +1,6 @@ +-- +DELETE FROM `conditions` WHERE `SourceEntry` = 56099 AND `SourceTypeOrReferenceId` = 13; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,56099,0,0,31,0,3,30169,0,0,0,'','Essence of Ice target Smoldering Scrap Bunny'); + +DELETE FROM `creature` WHERE `guid` IN (116640, 116641, 116642); -- duplicated spawns diff --git a/sql/updates/world/2015_11_24_00_world_355.sql b/sql/updates/world/2015_11_24_00_world_355.sql new file mode 100644 index 00000000000..0983d03e649 --- /dev/null +++ b/sql/updates/world/2015_11_24_00_world_355.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_text` SET `TextRange`=0 WHERE `entry`=10321 AND `groupid`=0 AND `id`=0; diff --git a/sql/updates/world/2015_11_27_00_world.sql b/sql/updates/world/2015_11_27_00_world.sql new file mode 100644 index 00000000000..632dec537dd --- /dev/null +++ b/sql/updates/world/2015_11_27_00_world.sql @@ -0,0 +1,15 @@ +UPDATE `spell_dbc` SET `Effect1`=28,`EffectMiscValueB1`=64 WHERE `Id` IN(38922,38928); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=21251 AND `source_type`=0 AND `id`>6; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(2125100,2125101,2125102,2125103) AND `source_type`=9; + +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(21251, 0, 7, 0, 11, 0, 100, 0, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Spawn - Set Invincibility HP'), +(21251, 0, 8, 0, 2, 0, 100, 1, 0, 1, 0, 0, 87, 2125100, 2125101, 2125102, 2125103, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - On Less than 1% HP - Run Random Script'), +(2125100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38718, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Script 1 - Cast \'Toxic Pool\' '), +(2125100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Script 1 - Die'), +(2125101, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38922, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Script 2 - Cast \'Summon Colossus Lurkers\' '), +(2125101, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Script 2 - Die'), +(2125102, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38928, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Script 3 - Cast \'Summon Colossus Ragers\' '), +(2125102, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Script 3 - Die'), +(2125103, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Underbog Colossus - Script 4 - Die'); diff --git a/sql/updates/world/2015_11_28_00_world.sql b/sql/updates/world/2015_11_28_00_world.sql new file mode 100644 index 00000000000..0a1dd574fb4 --- /dev/null +++ b/sql/updates/world/2015_11_28_00_world.sql @@ -0,0 +1,16 @@ +-- +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (22268, 22460); +UPDATE `gameobject` SET `position_z`=-16.9 WHERE `guid`=99984 AND `id`= 185307; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `Entry` IN (22268, 22460); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (22268, 22460) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2226800, 2246000) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(22460, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, 2246000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Spirit - Just summoned - action list'), +(2246000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 3672.275635, 5286.437988, 20.585167, 5.40622, 'Spirit - action list - move to pos'), +(2246000, 9, 1, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 3672.275635, 5286.437988, 20.585167, 5.40622, 'Spirit - action list - Set Orientation'), +(2246000, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 9, 0, 0, 0, 0, 0, 0, 20, 185296, 20, 0, 0, 0, 0, 0, 'Spirit - action list - Activate object'), +(2246000, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 22268, 20, 0, 0, 0, 0, 0, 'Spirit - action list - Set data'), +(2246000, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Spirit - action list - Despawn'), +(22268, 0, 0, 0, 38, 0, 100, 0, 0, 1, 0, 0, 80, 2226800, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Leok - On data set - action list'), +(2226800, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 3638.89575, 5343.02978, 23.28319, 2.086646, 'Leok - action list - Move to pos'), +(2226800, 9, 1, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Leok - action list - Despawn'); diff --git a/sql/updates/world/2015_11_28_01_world_335.sql b/sql/updates/world/2015_11_28_01_world_335.sql new file mode 100644 index 00000000000..4bec178ecee --- /dev/null +++ b/sql/updates/world/2015_11_28_01_world_335.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE `entry` = 11010; +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES +(11010, 'You didn''t get kicked out of the instance even if Player::CheckInstanceLoginValid() returned false and without .gm on flag'); diff --git a/sql/updates/world/2015_11_29_00_world.sql b/sql/updates/world/2015_11_29_00_world.sql new file mode 100644 index 00000000000..fd64b65bd02 --- /dev/null +++ b/sql/updates/world/2015_11_29_00_world.sql @@ -0,0 +1,41 @@ +-- Talbuk Doe SAI +SET @ENTRY := 20610; -- Talbuk Doe +SET @SPELL_GORE := 32019; -- Gore +SET @SPELL_TAG := 35771; -- Tag Subbued Talbuk +SET @SPELL_TAG_CREDIT := 40347; -- Talbuk Tagging Credit +SET @SPELL_SLEEPING := 14915; -- Sleeping Sleep +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - On Aggro - Say text 0"), +(@ENTRY,0,1,0,0,0,100,0,1000,1000,8000,11000,11,@SPELL_GORE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Talbuk Doe - In Combat - Cast Gore"), +(@ENTRY,0,2,0,2,0,100,1,0,20,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - At 20% HP - Say Text 1"), +(@ENTRY,0,5,0,4,0,100,0,0,0,0,0,45,0,1,0,0,0,0,19,20777,30,0,0,0,0,0,"Talbuk Doe - On Aggro - Set data"), +(@ENTRY,0,3,0,8,0,100,0,@SPELL_TAG,0,0,0,80,@ENTRY*100,2,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - On Spellhit - Run Script"), +(@ENTRY,0,4,0,11,0,100,0,0,0,0,0,19,386,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - On Respawn - Remove Unit Flag"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,85,@SPELL_TAG_CREDIT ,0,0,0,0,0,7,0,0,0,0,0,0,0,"Talbuk Doe - Script - Give Quest Credit"), +(@ENTRY*100,9,1,0,0,0,100,1,0,0,0,0,27,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - Script - Stop combat"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,18,386,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - Script - Set Unit Flag"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,11,@SPELL_SLEEPING,1,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - Script - Cast Sleeping Sleep"), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,11,55795,1,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Doe - Script - Cast visual death state"), +(@ENTRY*100, 9, 5, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Talbuk Doe - On Script - Despawn'); + +-- Talbuk Sire SAI +SET @ENTRY := 20777; -- Talbuk Sire +SET @SPELL_STOMP := 32023; -- Hoof Stomp +SET @SPELL_TAG := 35771; -- Tag Subbued Talbuk +SET @SPELL_SLEEPING := 14915; -- Sleeping Sleep +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,4000,6000,8000,11000,11,@SPELL_STOMP,0,0,0,0,0,2,0,0,0,0,0,0,0,"Talbuk Sire - In Combat - Cast Hoof Stomp"), +(@ENTRY,0,1,0,2,0,100,1,0,20,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - At 20% HP - Say Text 0"), +(@ENTRY,0,4,0,38,0,100,0,0,1,0,0,49,0,0,0,0,0,0,21,40,0,0,0,0,0,0,"Talbuk Sire - On data set - Start attack"), +(@ENTRY,0,2,0,8,0,100,0,@SPELL_TAG,0,0,0,80,@ENTRY*100,2,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - On Spellhit - Run Script"), +(@ENTRY,0,3,0,11,0,100,0,0,0,0,0,19,386,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - On Respawn - Remove Unit Flag"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,85,@SPELL_TAG_CREDIT ,0,0,0,0,0,7,0,0,0,0,0,0,0,"Talbuk Sire - Script - Give Quest Credit"), +(@ENTRY*100,9,1,0,0,0,100,1,0,0,0,0,27,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - Script - Stop combat"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,18,386,0,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - Script - Set Unit Flag"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,11,@SPELL_SLEEPING,1,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - Script - Cast Sleeping Sleep"), +(@ENTRY*100,9,4,0,0,0,100,0,0,0,0,0,11,55795,1,0,0,0,0,1,0,0,0,0,0,0,0,"Talbuk Sire - Script - Cast visual death state"), +(@ENTRY*100, 9, 5, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Talbuk Sire - On Script - Despawn'); diff --git a/sql/updates/world/2015_11_29_01_world.sql b/sql/updates/world/2015_11_29_01_world.sql new file mode 100644 index 00000000000..cd46800c5dd --- /dev/null +++ b/sql/updates/world/2015_11_29_01_world.sql @@ -0,0 +1,15 @@ +-- +DELETE FROM `creature_text` WHERE `entry` = 22293; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `TextRange`, `comment`, `BroadcastTextId`) VALUES +(22293, 0, 0, "%s begins to sputter as its engine malfunctions.", 16, 0, 100, 0, 0, 0, 0, "Inactive Fel Reaver", 20103); + +-- Creature Script - Inactive Fel Reaver +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 22293); +DELETE FROM `smart_scripts` WHERE (source_type = 9 AND entryorguid = 2229300); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(22293, 0, 0, 0, 20, 0, 100, 0, 10850, 0, 0, 0, 80, 2229300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Inactive Fel Reaver - On Quest complete - Action list'), +(2229300, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Inactive Fel Reaver - Action list - Say text'), +(2229300, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Inactive Fel Reaver - Action list - Remove npc flag'), +(2229300, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 89, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Inactive Fel Reaver - Action list - Random Move'), +(2229300, 9, 3, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 33, 22293, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Inactive Fel Reaver - Action list - Give Credit'), +(2229300, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Inactive Fel Reaver - Action list - Kill Itself'); diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index 33c273fb05f..9f61dd12e4c 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -58,6 +58,13 @@ uint32 urand(uint32 min, uint32 max) return GetRng()->URandom(min, max); } +uint32 urandms(uint32 min, uint32 max) +{ + ASSERT(max >= min); + ASSERT(INT_MAX/IN_MILLISECONDS >= max); + return GetRng()->URandom(min * IN_MILLISECONDS, max * IN_MILLISECONDS); +} + float frand(float min, float max) { ASSERT(max >= min); diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index 6a872b44a60..b748e83408b 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -82,6 +82,9 @@ int32 irand(int32 min, int32 max); /* Return a random number in the range min..max (inclusive). */ uint32 urand(uint32 min, uint32 max); +/* Return a random millisecond value between min and max seconds. Functionally equivalent to urand(min*IN_MILLISECONDS, max*IN_MILLISECONDS). */ +uint32 urandms(uint32 min, uint32 max); + /* Return a random number in the range 0 .. UINT32_MAX. */ uint32 rand32(); diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index 6f9046520b0..1c4b9a51ece 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -248,7 +248,7 @@ class SmartScript void DecPhase(int32 p = 1) { - if(mEventPhase > (uint32)p) + if (mEventPhase > (uint32)p) mEventPhase -= (uint32)p; else mEventPhase = 0; diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 2bacaff496f..a6359a353eb 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1533,7 +1533,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) //! Since no common attributes were found, (not even in titleRewardFlags field) //! we explicitly check by ID. Maybe in the future we could move the achievement_reward //! condition fields to the condition system. - if (uint32 titleId = reward->titleId[achievement->ID == 1793 ? GetPlayer()->getGender() : (GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1)]) + if (uint32 titleId = reward->titleId[achievement->ID == 1793 ? GetPlayer()->GetByteValue(PLAYER_BYTES_3, 0) : (GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1)]) if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId)) GetPlayer()->SetTitle(titleEntry); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 9173d44ae86..ea10ce7988b 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -440,8 +440,8 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/) ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); } - LoadCreaturesAddon(); UpdateMovementFlags(); + LoadCreaturesAddon(); return true; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1a9c0fbce4b..58a9626776b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2561,6 +2561,11 @@ void Player::SetGameMaster(bool on) UpdateObjectVisibility(); } +bool Player::CanBeGameMaster() const +{ + return GetSession()->HasPermission(rbac::RBAC_PERM_COMMAND_GM); +} + void Player::SetGMVisible(bool on) { if (on) @@ -4759,7 +4764,7 @@ Corpse* Player::CreateCorpse() // prevent existence 2 corpse for player SpawnCorpseBones(); - uint32 _uf, _pb, _pb2, _cfb1, _cfb2; + uint32 _pb, _pb2, _cfb1, _cfb2; Corpse* corpse = new Corpse((m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH) ? CORPSE_RESURRECTABLE_PVP : CORPSE_RESURRECTABLE_PVE); SetPvPDeath(false); @@ -4772,18 +4777,16 @@ Corpse* Player::CreateCorpse() _corpseLocation.WorldRelocate(*this); - _uf = GetUInt32Value(UNIT_FIELD_BYTES_0); _pb = GetUInt32Value(PLAYER_BYTES); _pb2 = GetUInt32Value(PLAYER_BYTES_2); - uint8 race = (uint8)(_uf); uint8 skin = (uint8)(_pb); uint8 face = (uint8)(_pb >> 8); uint8 hairstyle = (uint8)(_pb >> 16); uint8 haircolor = (uint8)(_pb >> 24); uint8 facialhair = (uint8)(_pb2); - _cfb1 = ((0x00) | (race << 8) | (getGender() << 16) | (skin << 24)); + _cfb1 = ((0x00) | (getRace() << 8) | (GetByteValue(PLAYER_BYTES_3, 0) << 16) | (skin << 24)); _cfb2 = ((face) | (hairstyle << 8) | (haircolor << 16) | (facialhair << 24)); corpse->SetUInt32Value(CORPSE_FIELD_BYTES_1, _cfb1); @@ -18674,17 +18677,28 @@ bool Player::CheckInstanceLoginValid(Map* map) { // cannot be in raid instance without a group if (!GetGroup()) - return false; + return IsInstanceLoginGameMasterException(); } else { // cannot be in normal instance without a group and more players than 1 in instance if (!GetGroup() && map->GetPlayersCountExceptGMs() > 1) - return false; + return IsInstanceLoginGameMasterException(); } // do checks for satisfy accessreqs, instance full, encounter in progress (raid), perm bind group != perm bind player - return sMapMgr->CanPlayerEnter(map->GetId(), this, true); + return sMapMgr->CanPlayerEnter(map->GetId(), this, true) || IsInstanceLoginGameMasterException(); +} + +bool Player::IsInstanceLoginGameMasterException() const +{ + if (CanBeGameMaster()) + { + ChatHandler(GetSession()).SendSysMessage(LANG_INSTANCE_LOGIN_GAMEMASTER_EXCEPTION); + return true; + } + else + return false; } bool Player::CheckInstanceCount(uint32 instanceId) const @@ -21069,7 +21083,7 @@ void Player::InitDisplayIds() return; } - uint8 gender = getGender(); + uint8 gender = GetByteValue(PLAYER_BYTES_3, 0); switch (gender) { case GENDER_FEMALE: diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 2a9dfc49280..8057a4ee54d 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1072,6 +1072,7 @@ class Player : public Unit, public GridObject<Player> bool isAcceptWhispers() const { return (m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS) != 0; } void SetAcceptWhispers(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; } bool IsGameMaster() const { return (m_ExtraFlags & PLAYER_EXTRA_GM_ON) != 0; } + bool CanBeGameMaster() const; void SetGameMaster(bool on); bool isGMChat() const { return (m_ExtraFlags & PLAYER_EXTRA_GM_CHAT) != 0; } void SetGMChat(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_CHAT; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_CHAT; } @@ -2500,6 +2501,8 @@ class Player : public Unit, public GridObject<Player> bool IsHasDelayedTeleport() const { return m_bHasDelayedTeleport; } void SetDelayedTeleportFlag(bool setting) { m_bHasDelayedTeleport = setting; } void ScheduleDelayedOperation(uint32 operation) { if (operation < DELAYED_END) m_DelayedOperations |= operation; } + + bool IsInstanceLoginGameMasterException() const; MapReference m_mapRef; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6b234df5860..92fb04b4831 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12987,9 +12987,6 @@ void Unit::ModSpellCastTime(SpellInfo const* spellInfo, int32 & castTime, Spell* if (!spellInfo || castTime < 0) return; - if (spellInfo->IsChanneled() && !spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION)) - return; - // called from caster if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell); @@ -13003,6 +13000,25 @@ void Unit::ModSpellCastTime(SpellInfo const* spellInfo, int32 & castTime, Spell* castTime = 500; } +void Unit::ModSpellDurationTime(SpellInfo const* spellInfo, int32 & duration, Spell* spell) +{ + if (!spellInfo || duration < 0) + return; + + if (spellInfo->IsChanneled() && !spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION)) + return; + + // called from caster + if (Player* modOwner = GetSpellModOwner()) + modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, duration, spell); + + if (!(spellInfo->HasAttribute(SPELL_ATTR0_ABILITY) || spellInfo->HasAttribute(SPELL_ATTR0_TRADESPELL) || spellInfo->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS)) && + ((GetTypeId() == TYPEID_PLAYER && spellInfo->SpellFamilyName) || GetTypeId() == TYPEID_UNIT)) + duration = int32(float(duration) * GetFloatValue(UNIT_MOD_CAST_SPEED)); + else if (spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO) && !spellInfo->HasAttribute(SPELL_ATTR2_AUTOREPEAT_FLAG)) + duration = int32(float(duration) * m_modAttackSpeedPct[RANGED_ATTACK]); +} + DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) { for (Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i) @@ -13772,7 +13788,7 @@ void CharmInfo::InitPossessCreateSpells() break; } - for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i) + for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) { uint32 spellId = _unit->ToCreature()->m_spells[i]; SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); @@ -13781,7 +13797,7 @@ void CharmInfo::InitPossessCreateSpells() if (spellInfo->IsPassive()) _unit->CastSpell(_unit, spellInfo, true); else - AddSpellToActionBar(spellInfo, ACT_PASSIVE); + AddSpellToActionBar(spellInfo, ACT_PASSIVE, i % MAX_UNIT_ACTION_BAR_INDEX); } } } @@ -13839,11 +13855,12 @@ void CharmInfo::InitCharmCreateSpells() } } -bool CharmInfo::AddSpellToActionBar(SpellInfo const* spellInfo, ActiveStates newstate) +bool CharmInfo::AddSpellToActionBar(SpellInfo const* spellInfo, ActiveStates newstate, uint8 preferredSlot) { uint32 spell_id = spellInfo->Id; uint32 first_id = spellInfo->GetFirstRankSpell()->Id; + ASSERT(preferredSlot < MAX_UNIT_ACTION_BAR_INDEX); // new spell rank can be already listed for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i) { @@ -13860,9 +13877,10 @@ bool CharmInfo::AddSpellToActionBar(SpellInfo const* spellInfo, ActiveStates new // or use empty slot in other case for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i) { - if (!PetActionBar[i].GetAction() && PetActionBar[i].IsActionBarForSpell()) + uint8 j = (preferredSlot + i) % MAX_UNIT_ACTION_BAR_INDEX; + if (!PetActionBar[j].GetAction() && PetActionBar[j].IsActionBarForSpell()) { - SetActionBar(i, spell_id, newstate == ACT_DECIDE ? spellInfo->IsAutocastable() ? ACT_DISABLED : ACT_PASSIVE : newstate); + SetActionBar(j, spell_id, newstate == ACT_DECIDE ? spellInfo->IsAutocastable() ? ACT_DISABLED : ACT_PASSIVE : newstate); return true; } } @@ -15802,7 +15820,7 @@ void Unit::SetFeared(bool apply) } if (Player* player = ToPlayer()) - if(!player->HasUnitState(UNIT_STATE_POSSESSED)) + if (!player->HasUnitState(UNIT_STATE_POSSESSED)) player->SetClientControl(this, !apply); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 39b1c34be55..72f3a6682fa 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1119,7 +1119,7 @@ struct CharmInfo void InitEmptyActionBar(bool withAttack = true); //return true if successful - bool AddSpellToActionBar(SpellInfo const* spellInfo, ActiveStates newstate = ACT_DECIDE); + bool AddSpellToActionBar(SpellInfo const* spellInfo, ActiveStates newstate = ACT_DECIDE, uint8 preferredSlot = 0); bool RemoveSpellFromActionBar(uint32 spell_id); void LoadPetActionBar(const std::string& data); void BuildActionBar(WorldPacket* data); @@ -1982,6 +1982,7 @@ class Unit : public WorldObject int32 CalcSpellDuration(SpellInfo const* spellProto); int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask); void ModSpellCastTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = NULL); + void ModSpellDurationTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = NULL); float CalculateLevelPenalty(SpellInfo const* spellProto) const; void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 046ce422cd2..b2be5c49b91 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2347,6 +2347,12 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.ContainerSlots = uint32(fields[26].GetUInt8()); itemTemplate.StatsCount = uint32(fields[27].GetUInt8()); + if (itemTemplate.StatsCount > MAX_ITEM_PROTO_STATS) + { + TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).", entry, itemTemplate.StatsCount, MAX_ITEM_PROTO_STATS); + itemTemplate.StatsCount = MAX_ITEM_PROTO_STATS; + } + for (uint8 i = 0; i < itemTemplate.StatsCount; ++i) { itemTemplate.ItemStat[i].ItemStatType = uint32(fields[28 + i*2].GetUInt8()); @@ -2594,12 +2600,6 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.ContainerSlots = MAX_BAG_SIZE; } - if (itemTemplate.StatsCount > MAX_ITEM_PROTO_STATS) - { - TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).", entry, itemTemplate.StatsCount, MAX_ITEM_PROTO_STATS); - itemTemplate.StatsCount = MAX_ITEM_PROTO_STATS; - } - for (uint8 j = 0; j < itemTemplate.StatsCount; ++j) { // for ItemStatValue != 0 diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index e5b32f548f9..60ec60443d6 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -642,7 +642,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), createInfo->Name.c_str(), newChar.GetGUID().GetCounter()); sScriptMgr->OnPlayerCreate(&newChar); - sWorld->AddCharacterInfo(newChar.GetGUID(), GetAccountId(), newChar.GetName(), newChar.getGender(), newChar.getRace(), newChar.getClass(), newChar.getLevel()); + sWorld->AddCharacterInfo(newChar.GetGUID(), GetAccountId(), newChar.GetName(), newChar.GetByteValue(PLAYER_BYTES_3, 0), newChar.getRace(), newChar.getClass(), newChar.getLevel()); newChar.CleanupsBeforeDelete(); delete createInfo; @@ -1242,20 +1242,20 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair); - if (!bs_hair || bs_hair->type != 0 || bs_hair->race != _player->getRace() || bs_hair->gender != _player->getGender()) + if (!bs_hair || bs_hair->type != 0 || bs_hair->race != _player->getRace() || bs_hair->gender != _player->GetByteValue(PLAYER_BYTES_3, 0)) return; BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair); - if (!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->getGender()) + if (!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->GetByteValue(PLAYER_BYTES_3, 0)) return; BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(SkinColor); - if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender())) + if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->GetByteValue(PLAYER_BYTES_3, 0))) return; - if (!Player::ValidateAppearance(_player->getRace(), _player->getClass(), _player->getGender(), bs_hair->hair_id, Color, _player->GetByteValue(PLAYER_BYTES, 1), bs_facialHair->hair_id, bs_skinColor ? bs_skinColor->hair_id : _player->GetByteValue(PLAYER_BYTES, 0))) + if (!Player::ValidateAppearance(_player->getRace(), _player->getClass(), _player->GetByteValue(PLAYER_BYTES_3, 0), bs_hair->hair_id, Color, _player->GetByteValue(PLAYER_BYTES, 1), bs_facialHair->hair_id, bs_skinColor ? bs_skinColor->hair_id : _player->GetByteValue(PLAYER_BYTES, 0))) return; GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 2eebbfc1004..6dcd3242a6c 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -283,7 +283,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData) continue; uint32 pzoneid = target->GetZoneId(); - uint8 gender = target->getGender(); + uint8 gender = target->GetByteValue(PLAYER_BYTES_3, 0); bool z_show = true; for (uint32 i = 0; i < zones_count; ++i) diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index de117905b3d..85971396619 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1202,7 +1202,8 @@ enum TrinityStrings LANG_BAN_ACCOUNT_YOUPERMBANNEDMESSAGE_WORLD = 11007, LANG_NPCINFO_INHABIT_TYPE = 11008, - LANG_NPCINFO_FLAGS_EXTRA = 11009 + LANG_NPCINFO_FLAGS_EXTRA = 11009, + LANG_INSTANCE_LOGIN_GAMEMASTER_EXCEPTION = 11010 }; #endif diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index b1a043c4b5b..1ccd6a4151f 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -341,7 +341,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player has not logged in yet"); else if (_player->IsInWorld()) LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player is still in world"); - else if(AntiDOS.EvaluateOpcode(*packet, currentTime)) + else if (AntiDOS.EvaluateOpcode(*packet, currentTime)) { sScriptMgr->OnPacketReceive(this, *packet); (this->*opHandle.handler)(*packet); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 5e70d953be9..200e16a9666 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -541,10 +541,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load) { // Haste modifies periodic time of channeled spells if (m_spellInfo->IsChanneled()) - { - if (m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION)) - caster->ModSpellCastTime(m_spellInfo, m_amplitude); - } + caster->ModSpellDurationTime(m_spellInfo, m_amplitude); // and periodic time of auras affected by SPELL_AURA_PERIODIC_HASTE else if (caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION)) m_amplitude = int32(m_amplitude * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); @@ -1866,43 +1863,43 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, { // Blood Elf case RACE_BLOODELF: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 17829 : 17830); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 17830 : 17829); break; // Orc case RACE_ORC: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 10139 : 10140); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10140 : 10139); break; // Troll case RACE_TROLL: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 10135 : 10134); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10134 : 10135); break; // Tauren case RACE_TAUREN: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 10136 : 10147); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10147 : 10136); break; // Undead case RACE_UNDEAD_PLAYER: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 10146 : 10145); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10145 : 10146); break; // Draenei case RACE_DRAENEI: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 17827 : 17828); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 17828 : 17827); break; // Dwarf case RACE_DWARF: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 10141 : 10142); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10142 : 10141); break; // Gnome case RACE_GNOME: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 10148 : 10149); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10149 : 10148); break; // Human case RACE_HUMAN: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 10137 : 10138); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10138 : 10137); break; // Night Elf case RACE_NIGHTELF: - target->SetDisplayId(target->getGender() == GENDER_MALE ? 10143 : 10144); + target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10144 : 10143); break; default: break; @@ -4646,17 +4643,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool { if (caster) { - switch (caster->getGender()) - { - case GENDER_FEMALE: - caster->CastSpell(target, 37095, true, NULL, this); // Blood Elf Disguise - break; - case GENDER_MALE: - caster->CastSpell(target, 37093, true, NULL, this); - break; - default: - break; - } + if (caster->getGender() == GENDER_FEMALE) + caster->CastSpell(target, 37095, true, NULL, this); // Blood Elf Disguise + else + caster->CastSpell(target, 37093, true, NULL, this); } break; } @@ -4686,15 +4676,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool case 46354: // Blood Elf Illusion if (caster) { - switch (caster->getGender()) - { - case GENDER_FEMALE: - caster->CastSpell(target, 46356, true, NULL, this); - break; - case GENDER_MALE: - caster->CastSpell(target, 46355, true, NULL, this); - break; - } + if (caster->getGender() == GENDER_FEMALE) + caster->CastSpell(target, 46356, true, NULL, this); + else + caster->CastSpell(target, 46355, true, NULL, this); } break; case 46361: // Reinforced Net diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 7c9d956edd2..4f3b60d6f37 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2429,9 +2429,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) { m_caster->CombatStart(unit, !m_spellInfo->HasAttribute(SPELL_ATTR3_NO_INITIAL_AGGRO)); - if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_AURA_CC)) - if (!unit->IsStandState()) - unit->SetStandState(UNIT_STAND_STATE_STAND); + if (!unit->IsStandState()) + unit->SetStandState(UNIT_STAND_STATE_STAND); } if (spellHitTarget) @@ -2515,8 +2514,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA if (m_caster->_IsValidAttackTarget(unit, m_spellInfo)) { unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL); - /// @todo This is a hack. But we do not know what types of stealth should be interrupted by CC - if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_AURA_CC) && unit->IsControlledByPlayer()) + + if (!m_spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH)) unit->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); } else if (m_caster->IsFriendlyTo(unit)) @@ -2625,7 +2624,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA // Haste modifies duration of channeled spells if (m_spellInfo->IsChanneled()) - m_originalCaster->ModSpellCastTime(aurSpellInfo, duration, this); + m_originalCaster->ModSpellDurationTime(aurSpellInfo, duration, this); // and duration of auras affected by SPELL_AURA_PERIODIC_HASTE else if (m_originalCaster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, aurSpellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION)) duration = int32(duration * m_originalCaster->GetFloatValue(UNIT_MOD_CAST_SPEED)); @@ -3259,7 +3258,7 @@ void Spell::handle_immediate() modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); // Apply haste mods - m_caster->ModSpellCastTime(m_spellInfo, duration, this); + m_caster->ModSpellDurationTime(m_spellInfo, duration, this); m_spellState = SPELL_STATE_CASTING; m_caster->AddInterruptMask(m_spellInfo->ChannelInterruptFlags); diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index 0dd4ff8c100..ed5c31c25c6 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -471,7 +471,7 @@ bool SpellHistory::HasCooldown(SpellInfo const* spellInfo, uint32 itemId /*= 0*/ return true; uint32 category = 0; - GetCooldownDurations(spellInfo, itemId, nullptr, &itemId, nullptr); + GetCooldownDurations(spellInfo, itemId, nullptr, &category, nullptr); if (!category) return false; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 241e7df9544..d042f926d02 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -176,7 +176,7 @@ enum SpellCustomAttributes SPELL_ATTR0_CU_CONE_LINE = 0x00000004, SPELL_ATTR0_CU_SHARE_DAMAGE = 0x00000008, SPELL_ATTR0_CU_NO_INITIAL_THREAT = 0x00000010, - SPELL_ATTR0_CU_AURA_CC = 0x00000040, + SPELL_ATTR0_CU_DONT_BREAK_STEALTH = 0x00000040, SPELL_ATTR0_CU_DIRECT_DAMAGE = 0x00000100, SPELL_ATTR0_CU_CHARGE = 0x00000200, SPELL_ATTR0_CU_PICKPOCKET = 0x00000400, diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 6305d0a456f..ec616c1d4c6 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2801,14 +2801,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes() { switch (spellInfo->Effects[j].ApplyAuraName) { - case SPELL_AURA_MOD_POSSESS: - case SPELL_AURA_MOD_CONFUSE: - case SPELL_AURA_MOD_CHARM: - case SPELL_AURA_AOE_CHARM: - case SPELL_AURA_MOD_FEAR: - case SPELL_AURA_MOD_STUN: - spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC; - break; case SPELL_AURA_PERIODIC_HEAL: case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_DAMAGE_PERCENT: @@ -2901,22 +2893,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes() if (spellInfo->SpellVisual[0] == 3879) spellInfo->AttributesCu |= SPELL_ATTR0_CU_CONE_BACK; - switch (spellInfo->SpellFamilyName) - { - case SPELLFAMILY_WARRIOR: - // Shout - if (spellInfo->SpellFamilyFlags[0] & 0x20000 || spellInfo->SpellFamilyFlags[1] & 0x20) - spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC; - break; - case SPELLFAMILY_DRUID: - // Roar - if (spellInfo->SpellFamilyFlags[0] & 0x8) - spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC; - break; - default: - break; - } - spellInfo->_InitializeExplicitTargetMask(); } @@ -2947,6 +2923,11 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Speed = SPEED_CHARGE; break; } + + // Passive talent auras cannot target pets + if (spellInfo->IsPassive() && GetTalentSpellCost(i)) + if (spellInfo->Effects[j].TargetA.GetTarget() == TARGET_UNIT_PET) + spellInfo->Effects[j].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); } if (spellInfo->ActiveIconID == 2158) // flight diff --git a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp index 9cecbc31665..9af23f17dca 100644 --- a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp @@ -277,145 +277,6 @@ public: }; /*###### -## npc_anchorite_truuen -######*/ - -enum Truuen -{ - NPC_GHOST_UTHER = 17233, - NPC_THEL_DANIS = 1854, - NPC_GHOUL = 1791, //ambush - - QUEST_TOMB_LIGHTBRINGER = 9446, - - SAY_WP_0 = 0, //Beware! We are attacked! - SAY_WP_1 = 1, //It must be the purity of the Mark of the Lightbringer that is drawing forth the Scourge to attack us. We must proceed with caution lest we be overwhelmed! - SAY_WP_2 = 2, //This land truly needs to be cleansed by the Light! Let us continue on to the tomb. It isn't far now... - SAY_WP_3 = 0, //Be welcome, friends! - SAY_WP_4 = 0, //Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man's heart. - SAY_WP_5 = 1, //Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire. - SAY_WP_6 = 2 //Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she'll be keenly interested to know of what has transpired here. -}; - -class npc_anchorite_truuen : public CreatureScript -{ -public: - npc_anchorite_truuen() : CreatureScript("npc_anchorite_truuen") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override - { - if (quest->GetQuestId() == QUEST_TOMB_LIGHTBRINGER) - { - npc_escortAI* pEscortAI = ENSURE_AI(npc_anchorite_truuen::npc_anchorite_truuenAI, creature->AI()); - pEscortAI->Start(true, true, player->GetGUID()); - } - return false; - } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_anchorite_truuenAI(creature); - } - - struct npc_anchorite_truuenAI : public npc_escortAI - { - npc_anchorite_truuenAI(Creature* creature) : npc_escortAI(creature) - { - Initialize(); - } - - void Initialize() - { - m_uiChatTimer = 7000; - } - - uint32 m_uiChatTimer; - - ObjectGuid UghostGUID; - - void Reset() override - { - Initialize(); - } - - void JustSummoned(Creature* summoned) override - { - if (summoned->GetEntry() == NPC_GHOUL) - summoned->AI()->AttackStart(me); - } - - void WaypointReached(uint32 waypointId) override - { - Player* player = GetPlayerForEscort(); - - switch (waypointId) - { - case 8: - Talk(SAY_WP_0); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - break; - case 9: - Talk(SAY_WP_1); - break; - case 14: - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+10.0f, me->GetPositionY()+10.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+8.0f, me->GetPositionY()+8.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - break; - case 15: - Talk(SAY_WP_2); - break; - case 21: - if (Creature* Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150)) - Theldanis->AI()->Talk(SAY_WP_3); - break; - case 23: - if (Creature* Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) - { - UghostGUID = Ughost->GetGUID(); - Ughost->SetDisableGravity(true); - Ughost->AI()->Talk(SAY_WP_4, me); - } - m_uiChatTimer = 4000; - break; - case 24: - if (Creature* Ughost = ObjectAccessor::GetCreature(*me, UghostGUID)) - Ughost->AI()->Talk(SAY_WP_5, me); - m_uiChatTimer = 4000; - break; - case 25: - if (Creature* Ughost = ObjectAccessor::GetCreature(*me, UghostGUID)) - Ughost->AI()->Talk(SAY_WP_6, me); - m_uiChatTimer = 4000; - break; - case 26: - if (player) - player->GroupEventHappens(QUEST_TOMB_LIGHTBRINGER, me); - break; - } - } - - void EnterCombat(Unit* /*who*/) override { } - - void JustDied(Unit* /*killer*/) override - { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_TOMB_LIGHTBRINGER); - } - - void UpdateAI(uint32 uiDiff) override - { - npc_escortAI::UpdateAI(uiDiff); - DoMeleeAttackIfReady(); - if (HasEscortState(STATE_ESCORT_ESCORTING)) - m_uiChatTimer = 6000; - } - }; -}; - -/*###### ## ######*/ @@ -425,5 +286,4 @@ void AddSC_western_plaguelands() new npc_myranda_the_hag(); new npc_the_scourge_cauldron(); new npc_andorhal_tower(); - new npc_anchorite_truuen(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 47569a6b85f..11fe5f41455 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -197,7 +197,7 @@ public: if (!guardCorpses.empty()) { if (ObjectGuid target = Trinity::Containers::SelectRandomContainerElement(guardCorpses)) - if(Creature* creatureTarget = ObjectAccessor::GetCreature(*me, target)) + if (Creature* creatureTarget = ObjectAccessor::GetCreature(*me, target)) { creatureTarget->CastSpell(creatureTarget, SPELL_SUMMON_CORPSE_SCARABS_MOB, true, nullptr, nullptr, me->GetGUID()); creatureTarget->AI()->Talk(EMOTE_SCARAB); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index 106661b70bf..7b3a9f8ac74 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -155,7 +155,7 @@ public: void KilledUnit(Unit* victim) override { - if(victim->GetTypeId() == TYPEID_PLAYER) + if (victim->GetTypeId() == TYPEID_PLAYER) Talk(SAY_SLAY); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index 50077fe9dc1..5d9ef449168 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -173,7 +173,8 @@ public: events.SetPhase(PHASE_NOT_ENGAGED); SetCombatMovement(false); - BeginResetEncounter(); // initialize everything properly, and ensure that the coils are loaded by the time we initialize + // initialize everything properly, and ensure that the coils are loaded by the time we initialize + BeginResetEncounter(true); } } @@ -185,7 +186,7 @@ public: void Reset() override { - if(events.IsInPhase(PHASE_TRANSITION) || events.IsInPhase(PHASE_THADDIUS)) + if (events.IsInPhase(PHASE_TRANSITION) || (events.IsInPhase(PHASE_THADDIUS) && me->IsAlive())) BeginResetEncounter(); } @@ -278,15 +279,16 @@ public: events.ScheduleEvent(EVENT_TRANSITION_3, 14 * IN_MILLISECONDS, 0, PHASE_TRANSITION); } - void BeginResetEncounter() + void BeginResetEncounter(bool initial = false) { - if (!me->IsAlive()) + if (instance->GetBossState(BOSS_THADDIUS) == DONE) return; if (events.IsInPhase(PHASE_RESETTING)) return; - - instance->ProcessEvent(me, EVENT_THADDIUS_BEGIN_RESET); + if (initial) // signal shorter spawn timer to instance script + instance->SetBossState(BOSS_THADDIUS, SPECIAL); + instance->ProcessEvent(me, EVENT_THADDIUS_BEGIN_RESET); instance->SetBossState(BOSS_THADDIUS, NOT_STARTED); // remove polarity shift debuffs on reset @@ -307,17 +309,19 @@ public: void ResetEncounter() { - events.SetPhase(PHASE_NOT_ENGAGED); feugenAlive = true; stalaggAlive = true; + me->Respawn(true); - me->CastSpell(me, SPELL_THADDIUS_INACTIVE_VISUAL); + _Reset(); + events.SetPhase(PHASE_NOT_ENGAGED); + + me->CastSpell(me, SPELL_THADDIUS_INACTIVE_VISUAL, true); if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN))) feugen->AI()->DoAction(ACTION_RESET_ENCOUNTER); if (Creature* stalagg = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_STALAGG))) stalagg->AI()->DoAction(ACTION_RESET_ENCOUNTER); - _Reset(); } void UpdateAI(uint32 diff) override @@ -636,7 +640,7 @@ public: void UpdateAI(uint32 uiDiff) override { - if(!isFeignDeath) + if (!isFeignDeath) if (!UpdateVictim()) return; @@ -653,7 +657,7 @@ public: else powerSurgeTimer -= uiDiff; - if(!isFeignDeath) + if (!isFeignDeath) DoMeleeAttackIfReady(); } @@ -821,7 +825,7 @@ public: void KilledUnit(Unit* victim) override { - if(victim->GetTypeId() == TYPEID_PLAYER) + if (victim->GetTypeId() == TYPEID_PLAYER) Talk(SAY_FEUGEN_SLAY); } diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index 60999d1d883..53ce68d3efc 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -188,14 +188,15 @@ class instance_naxxramas : public InstanceMapScript AddMinion(creature, false); } - void ProcessEvent(WorldObject* source, uint32 eventId) override + void ProcessEvent(WorldObject* /*source*/, uint32 eventId) override { switch (eventId) { case EVENT_THADDIUS_BEGIN_RESET: - if (!source->ToCreature() || source->ToCreature()->GetEntry() != NPC_THADDIUS) - return; - events.ScheduleEvent(EVENT_THADDIUS_RESET, 30 * IN_MILLISECONDS); + if (GetBossState(BOSS_THADDIUS) == SPECIAL) // this is the initial spawn, we want a shorter spawn time + events.ScheduleEvent(EVENT_THADDIUS_RESET, 5 * IN_MILLISECONDS); + else + events.ScheduleEvent(EVENT_THADDIUS_RESET, 30 * IN_MILLISECONDS); break; } } diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h index 9c5a4afba91..d2b99784953 100644 --- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h +++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h @@ -175,7 +175,7 @@ enum InstanceEvents EVENT_DIALOGUE_GOTHIK_KORTHAZZ2, EVENT_DIALOGUE_GOTHIK_RIVENDARE2, - // Thaddius AI requesting timed encounter respawn + // Thaddius AI requesting timed encounter (re-)spawn EVENT_THADDIUS_BEGIN_RESET, EVENT_THADDIUS_RESET, diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index cc9af9413e5..33ffea4993b 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -1244,8 +1244,9 @@ public: ++_wpCount; } else if (Vehicle* hoverDisk = me->GetVehicleKit()) - if (Unit* lordPassenger = hoverDisk->GetPassenger(0)) - lordPassenger->ToCreature()->AI()->DoAction(ACTION_SET_DISK_VICTIM_CHASE); + if (Unit* passenger = hoverDisk->GetPassenger(0)) + if (Creature* lordPassenger = passenger->ToCreature()) + lordPassenger->AI()->DoAction(ACTION_SET_DISK_VICTIM_CHASE); } private: diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index 87d68cc7a2f..b10956b3264 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -9,13 +9,16 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -file(GLOB_RECURSE sources *.cpp *.h) +file(GLOB_RECURSE mapextractor_SRCS *.cpp *.h) set(include_Dirs - ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/dep/libmpq - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/loadlib + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dep/cppformat + ${CMAKE_SOURCE_DIR}/dep/libmpq + ${CMAKE_SOURCE_DIR}/src/common + ${CMAKE_SOURCE_DIR}/src/common/Utilities + ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_CURRENT_SOURCE_DIR}/loadlib ) if( WIN32 ) @@ -28,13 +31,16 @@ endif() include_directories(${include_Dirs}) add_executable(mapextractor - ${sources} + ${mapextractor_SRCS} ) target_link_libraries(mapextractor + common + format mpq ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} + ${Boost_LIBRARIES} ) if( UNIX ) diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index dcaa3ba0a76..c0497a1cefb 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -22,36 +22,17 @@ #include <deque> #include <set> #include <cstdlib> - -#ifdef _WIN32 -#include "direct.h" -#else -#include <sys/stat.h> -#include <unistd.h> -#endif +#include <fstream> #include "dbcfile.h" #include "mpq_libmpq04.h" +#include "StringFormat.h" #include "adt.h" #include "wdt.h" -#include <fcntl.h> - -#if defined( __GNUC__ ) - #define _open open - #define _close close - #ifndef O_BINARY - #define O_BINARY 0 - #endif -#else - #include <io.h> -#endif - -#ifdef O_LARGEFILE - #define OPEN_FLAGS (O_RDONLY | O_BINARY | O_LARGEFILE) -#else - #define OPEN_FLAGS (O_RDONLY | O_BINARY) -#endif + +#include <boost/filesystem.hpp> + extern ArchiveSet gOpenArchives; typedef struct @@ -106,37 +87,14 @@ const char *CONF_mpq_list[]={ static const char* const langs[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU" }; #define LANG_COUNT 12 -void CreateDir( const std::string& Path ) -{ - if(chdir(Path.c_str()) == 0) - { - chdir("../"); - return; - } - - int ret; - #ifdef _WIN32 - ret = _mkdir( Path.c_str()); - #else - ret = mkdir( Path.c_str(), 0777 ); - #endif - if (ret != 0) - { - printf("Fatal Error: Could not create directory %s check your permissions", Path.c_str()); - exit(1); - } -} - -bool FileExists( const char* FileName ) +void CreateDir(boost::filesystem::path const& path) { - int fp = _open(FileName, OPEN_FLAGS); - if(fp != -1) - { - _close(fp); - return true; - } + namespace fs = boost::filesystem; + if (fs::exists(path)) + return; - return false; + if (!fs::create_directory(path)) + throw new std::runtime_error("Unable to create directory" + path.string()); } void Usage(char* prg) @@ -207,7 +165,7 @@ void HandleArgs(int argc, char * arg[]) uint32 ReadBuild(int locale) { // include build info file also - std::string filename = std::string("component.wow-")+langs[locale]+".txt"; + std::string filename = Trinity::StringFormat("component.wow-%s.txt", langs[locale]); //printf("Read %s file... ", filename.c_str()); MPQFile m(filename.c_str()); @@ -269,7 +227,7 @@ uint32 ReadMapDBC() strncpy(map_ids[x].name, map_name, max_map_name_length); map_ids[x].name[max_map_name_length - 1] = '\0'; } - printf("Done! (%u maps loaded)\n", (uint32)map_count); + printf("Done! (" SZFMTD "maps loaded)\n", map_count); return map_count; } @@ -294,7 +252,7 @@ void ReadAreaTableDBC() maxAreaId = dbc.getMaxId(); - printf("Done! (%u areas loaded)\n", (uint32)area_count); + printf("Done! (" SZFMTD " areas loaded)\n", area_count); } void ReadLiquidTypeTableDBC() @@ -315,7 +273,7 @@ void ReadLiquidTypeTableDBC() for(uint32 x = 0; x < liqTypeCount; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); - printf("Done! (%u LiqTypes loaded)\n", (uint32)liqTypeCount); + printf("Done! (" SZFMTD " LiqTypes loaded)\n", liqTypeCount); } // @@ -414,17 +372,17 @@ uint8 liquid_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE]; float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; -bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, uint32 build) +bool ConvertADT(std::string const& inputPath, std::string const& outputPath, int /*cell_y*/, int /*cell_x*/, uint32 build) { ADT_file adt; - if (!adt.loadFile(filename)) + if (!adt.loadFile(inputPath)) return false; adt_MCIN *cells = adt.a_grid->getMCIN(); if (!cells) { - printf("Can't find cells in '%s'\n", filename); + printf("Can't find cells in '%s'\n", inputPath.c_str()); return false; } @@ -434,8 +392,8 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, // Prepare map header map_fileheader map; - map.mapMagic = *(uint32 const*)MAP_MAGIC; - map.versionMagic = *(uint32 const*)MAP_VERSION_MAGIC; + map.mapMagic = *reinterpret_cast<uint32 const*>(MAP_MAGIC); + map.versionMagic = *reinterpret_cast<uint32 const*>(MAP_VERSION_MAGIC); map.buildMagic = build; // Get area flags data @@ -452,7 +410,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, area_flags[i][j] = areas[areaid]; continue; } - printf("File: %s\nCan't find area flag for areaid %u [%d, %d].\n", filename, areaid, cell->ix, cell->iy); + printf("File: %s\nCan't find area flag for areaid %u [%d, %d].\n", inputPath.c_str(), areaid, cell->ix, cell->iy); } area_flags[i][j] = 0xffff; } @@ -478,7 +436,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, map.areaMapSize = sizeof(map_areaHeader); map_areaHeader areaHeader; - areaHeader.fourcc = *(uint32 const*)MAP_AREA_MAGIC; + areaHeader.fourcc = *reinterpret_cast<uint32 const*>(MAP_AREA_MAGIC); areaHeader.flags = 0; if (fullAreaData) { @@ -488,7 +446,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, else { areaHeader.flags |= MAP_AREA_NO_AREA; - areaHeader.gridArea = (uint16)areaflag; + areaHeader.gridArea = static_cast<uint16>(areaflag); } // @@ -607,7 +565,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, map.heightMapSize = sizeof(map_heightHeader); map_heightHeader heightHeader; - heightHeader.fourcc = *(uint32 const*)MAP_HEIGHT_MAGIC; + heightHeader.fourcc = *reinterpret_cast<uint32 const*>(MAP_HEIGHT_MAGIC); heightHeader.flags = 0; heightHeader.gridHeight = minHeight; heightHeader.gridMaxHeight = maxHeight; @@ -763,7 +721,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, case LIQUID_TYPE_MAGMA: liquid_flags[i][j] |= MAP_LIQUID_TYPE_MAGMA; break; case LIQUID_TYPE_SLIME: liquid_flags[i][j] |= MAP_LIQUID_TYPE_SLIME; break; default: - printf("\nCan't find Liquid type %u for map %s\nchunk %d,%d\n", h->liquidType, filename, i, j); + printf("\nCan't find Liquid type %u for map %s\nchunk %d,%d\n", h->liquidType, inputPath.c_str(), i, j); break; } // Dark water detect @@ -848,7 +806,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, } map.liquidMapOffset = map.heightMapOffset + map.heightMapSize; map.liquidMapSize = sizeof(map_liquidHeader); - liquidHeader.fourcc = *(uint32 const*)MAP_LIQUID_MAGIC; + liquidHeader.fourcc = *reinterpret_cast<uint32 const*>(MAP_LIQUID_MAGIC); liquidHeader.flags = 0; liquidHeader.liquidType = 0; liquidHeader.offsetX = minX; @@ -906,69 +864,72 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, map.holesSize = 0; // Ok all data prepared - store it - FILE* output = fopen(filename2, "wb"); - if (!output) + + std::ofstream outFile(outputPath, std::ofstream::out | std::ofstream::binary); + if (!outFile) { - printf("Can't create the output file '%s'\n", filename2); + printf("Can't create the output file '%s'\n", outputPath.c_str()); return false; } - fwrite(&map, sizeof(map), 1, output); + + outFile.write(reinterpret_cast<const char*>(&map), sizeof(map)); // Store area data - fwrite(&areaHeader, sizeof(areaHeader), 1, output); + outFile.write(reinterpret_cast<const char*>(&areaHeader), sizeof(areaHeader)); if (!(areaHeader.flags&MAP_AREA_NO_AREA)) - fwrite(area_flags, sizeof(area_flags), 1, output); + outFile.write(reinterpret_cast<const char*>(area_flags), sizeof(area_flags)); // Store height data - fwrite(&heightHeader, sizeof(heightHeader), 1, output); + outFile.write(reinterpret_cast<const char*>(&heightHeader), sizeof(heightHeader)); if (!(heightHeader.flags & MAP_HEIGHT_NO_HEIGHT)) { if (heightHeader.flags & MAP_HEIGHT_AS_INT16) { - fwrite(uint16_V9, sizeof(uint16_V9), 1, output); - fwrite(uint16_V8, sizeof(uint16_V8), 1, output); + outFile.write(reinterpret_cast<const char*>(uint16_V9), sizeof(uint16_V9)); + outFile.write(reinterpret_cast<const char*>(uint16_V8), sizeof(uint16_V8)); } else if (heightHeader.flags & MAP_HEIGHT_AS_INT8) { - fwrite(uint8_V9, sizeof(uint8_V9), 1, output); - fwrite(uint8_V8, sizeof(uint8_V8), 1, output); + outFile.write(reinterpret_cast<const char*>(uint8_V9), sizeof(uint8_V9)); + outFile.write(reinterpret_cast<const char*>(uint8_V8), sizeof(uint8_V8)); } else { - fwrite(V9, sizeof(V9), 1, output); - fwrite(V8, sizeof(V8), 1, output); + outFile.write(reinterpret_cast<const char*>(V9), sizeof(V9)); + outFile.write(reinterpret_cast<const char*>(V8), sizeof(V8)); } } // Store liquid data if need if (map.liquidMapOffset) { - fwrite(&liquidHeader, sizeof(liquidHeader), 1, output); + outFile.write(reinterpret_cast<const char*>(&liquidHeader), sizeof(liquidHeader)); + if (!(liquidHeader.flags&MAP_LIQUID_NO_TYPE)) { - fwrite(liquid_entry, sizeof(liquid_entry), 1, output); - fwrite(liquid_flags, sizeof(liquid_flags), 1, output); + outFile.write(reinterpret_cast<const char*>(liquid_entry), sizeof(liquid_entry)); + outFile.write(reinterpret_cast<const char*>(liquid_flags), sizeof(liquid_flags)); } + if (!(liquidHeader.flags&MAP_LIQUID_NO_HEIGHT)) { - for (int y=0; y<liquidHeader.height;y++) - fwrite(&liquid_height[y+liquidHeader.offsetY][liquidHeader.offsetX], sizeof(float), liquidHeader.width, output); + for (int y = 0; y < liquidHeader.height; y++) + outFile.write(reinterpret_cast<const char*>(&liquid_height[y + liquidHeader.offsetY][liquidHeader.offsetX]), sizeof(float) * liquidHeader.width); } } // store hole data if (hasHoles) - fwrite(holes, map.holesSize, 1, output); - - fclose(output); + outFile.write(reinterpret_cast<const char*>(holes), map.holesSize); + outFile.close(); return true; } void ExtractMapsFromMpq(uint32 build) { - char mpq_filename[1024]; - char output_filename[1024]; - char mpq_map_name[1024]; + std::string mpqFileName; + std::string outputFileName; + std::string mpqMapName; printf("Extracting maps...\n"); @@ -986,9 +947,10 @@ void ExtractMapsFromMpq(uint32 build) { printf("Extract %s (%d/%u) \n", map_ids[z].name, z+1, map_count); // Loadup map grid data - sprintf(mpq_map_name, "World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name); + + mpqMapName = Trinity::StringFormat("World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name); WDT_file wdt; - if (!wdt.loadFile(mpq_map_name, false)) + if (!wdt.loadFile(mpqMapName, false)) { // printf("Error loading %s map wdt data\n", map_ids[z].name); continue; @@ -1000,9 +962,10 @@ void ExtractMapsFromMpq(uint32 build) { if (!wdt.main->adt_list[y][x].exist) continue; - sprintf(mpq_filename, "World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y); - sprintf(output_filename, "%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x); - ConvertADT(mpq_filename, output_filename, y, x, build); + + mpqFileName = Trinity::StringFormat("World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y); + outputFileName = Trinity::StringFormat("%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x); + ConvertADT(mpqFileName, outputFileName, y, x, build); } // draw progress bar printf("Processing........................%d%%\r", (100 * (y+1)) / WDT_MAP_SIZE); @@ -1038,9 +1001,9 @@ void ExtractDBCFiles(int locale, bool basicLocale) // get DBC file list for(ArchiveSet::iterator i = gOpenArchives.begin(); i != gOpenArchives.end();++i) { - vector<string> files; + std::vector<std::string> files; (*i)->GetFileListTo(files); - for (vector<string>::iterator iter = files.begin(); iter != files.end(); ++iter) + for (std::vector<std::string>::iterator iter = files.begin(); iter != files.end(); ++iter) if (iter->rfind(".dbc") == iter->length() - strlen(".dbc")) dbcfiles.insert(*iter); } @@ -1057,20 +1020,20 @@ void ExtractDBCFiles(int locale, bool basicLocale) // extract Build info file { - string mpq_name = std::string("component.wow-") + langs[locale] + ".txt"; - string filename = path + mpq_name; + std::string mpq_name = std::string("component.wow-") + langs[locale] + ".txt"; + std::string filename = path + mpq_name; ExtractFile(mpq_name.c_str(), filename); } // extract DBCs uint32 count = 0; - for (set<string>::iterator iter = dbcfiles.begin(); iter != dbcfiles.end(); ++iter) + for (std::set<std::string>::iterator iter = dbcfiles.begin(); iter != dbcfiles.end(); ++iter) { - string filename = path; + std::string filename = path; filename += (iter->c_str() + strlen("DBFilesClient\\")); - if(FileExists(filename.c_str())) + if (boost::filesystem::exists(filename)) continue; if (ExtractFile(iter->c_str(), filename)) @@ -1081,32 +1044,31 @@ void ExtractDBCFiles(int locale, bool basicLocale) void LoadLocaleMPQFiles(int const locale) { - char filename[512]; + std::string fileName = Trinity::StringFormat("%s/Data/%s/locale-%s.MPQ", input_path, langs[locale], langs[locale]); - sprintf(filename,"%s/Data/%s/locale-%s.MPQ", input_path, langs[locale], langs[locale]); - new MPQArchive(filename); + new MPQArchive(fileName.c_str()); for(int i = 1; i < 5; ++i) { - char ext[3] = ""; - if(i > 1) - sprintf(ext, "-%i", i); + std::string ext; + if (i > 1) + ext = Trinity::StringFormat("-%i", i); - sprintf(filename,"%s/Data/%s/patch-%s%s.MPQ", input_path, langs[locale], langs[locale], ext); - if(FileExists(filename)) - new MPQArchive(filename); + fileName = Trinity::StringFormat("%s/Data/%s/patch-%s%s.MPQ", input_path, langs[locale], langs[locale], ext.c_str()); + if (boost::filesystem::exists(fileName)) + new MPQArchive(fileName.c_str()); } } void LoadCommonMPQFiles() { - char filename[512]; + std::string fileName; int count = sizeof(CONF_mpq_list)/sizeof(char*); for(int i = 0; i < count; ++i) { - sprintf(filename, "%s/Data/%s", input_path, CONF_mpq_list[i]); - if(FileExists(filename)) - new MPQArchive(filename); + fileName = Trinity::StringFormat("%s/Data/%s", input_path, CONF_mpq_list[i]); + if (boost::filesystem::exists(fileName)) + new MPQArchive(fileName.c_str()); } } @@ -1128,9 +1090,8 @@ int main(int argc, char * arg[]) for (int i = 0; i < LANG_COUNT; i++) { - char tmp1[512]; - sprintf(tmp1, "%s/Data/%s/locale-%s.MPQ", input_path, langs[i], langs[i]); - if (FileExists(tmp1)) + std::string filename = Trinity::StringFormat("%s/Data/%s/locale-%s.MPQ", input_path, langs[i], langs[i]); + if (boost::filesystem::exists(filename)) { printf("Detected locale: %s\n", langs[i]); diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp index 936cdb72cfd..2f31b472b56 100644 --- a/src/tools/map_extractor/loadlib.cpp +++ b/src/tools/map_extractor/loadlib.cpp @@ -38,14 +38,14 @@ FileLoader::~FileLoader() free(); } -bool FileLoader::loadFile(char *filename, bool log) +bool FileLoader::loadFile(std::string const& fileName, bool log) { free(); - MPQFile mf(filename); + MPQFile mf(fileName.c_str()); if(mf.isEof()) { if (log) - printf("No such file %s\n", filename); + printf("No such file %s\n", fileName.c_str()); return false; } @@ -57,7 +57,7 @@ bool FileLoader::loadFile(char *filename, bool log) if (prepareLoadedData()) return true; - printf("Error loading %s", filename); + printf("Error loading %s", fileName.c_str()); mf.close(); free(); return false; diff --git a/src/tools/map_extractor/loadlib/loadlib.h b/src/tools/map_extractor/loadlib/loadlib.h index a0b62a85983..6547704d885 100644 --- a/src/tools/map_extractor/loadlib/loadlib.h +++ b/src/tools/map_extractor/loadlib/loadlib.h @@ -19,31 +19,9 @@ #ifndef LOAD_LIB_H #define LOAD_LIB_H -#ifdef _WIN32 -typedef __int64 int64; -typedef __int32 int32; -typedef __int16 int16; -typedef __int8 int8; -typedef unsigned __int64 uint64; -typedef unsigned __int32 uint32; -typedef unsigned __int16 uint16; -typedef unsigned __int8 uint8; -#else -#include <stdint.h> -#ifndef uint64_t -#ifdef __linux__ -#include <linux/types.h> -#endif -#endif -typedef int64_t int64; -typedef int32_t int32; -typedef int16_t int16; -typedef int8_t int8; -typedef uint64_t uint64; -typedef uint32_t uint32; -typedef uint16_t uint16; -typedef uint8_t uint8; -#endif +#include "Define.h" + +#include <string> #define FILE_FORMAT_VERSION 18 @@ -79,7 +57,7 @@ public: file_MVER *version; FileLoader(); ~FileLoader(); - bool loadFile(char *filename, bool log = true); + bool loadFile(std::string const& fileName, bool log = true); virtual void free(); }; diff --git a/src/tools/map_extractor/mpq_libmpq04.h b/src/tools/map_extractor/mpq_libmpq04.h index c6fe36a8221..b9b332f95b0 100644 --- a/src/tools/map_extractor/mpq_libmpq04.h +++ b/src/tools/map_extractor/mpq_libmpq04.h @@ -27,8 +27,6 @@ #include <iostream> #include <deque> -using namespace std; - class MPQArchive { @@ -39,7 +37,7 @@ public: ~MPQArchive() { close(); } void close(); - void GetFileListTo(vector<string>& filelist) { + void GetFileListTo(std::vector<std::string>& filelist) { uint32_t filenum; if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; libmpq__off_t size, transferred; @@ -58,7 +56,7 @@ public: while ((token != NULL) && (counter < size)) { //cout << token << endl; token[strlen(token) - 1] = 0; - string s = token; + std::string s = token; filelist.push_back(s); counter += strlen(token) + 2; token = strtok(NULL, seps); diff --git a/src/tools/mmaps_generator/IntermediateValues.h b/src/tools/mmaps_generator/IntermediateValues.h index 95a651a2df8..580e9e43139 100644 --- a/src/tools/mmaps_generator/IntermediateValues.h +++ b/src/tools/mmaps_generator/IntermediateValues.h @@ -22,7 +22,6 @@ #include "PathCommon.h" #include "TerrainBuilder.h" #include "Recast.h" -#include "DetourNavMesh.h" namespace MMAP { diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp index 69ca5297024..0c41be65cf7 100644 --- a/src/tools/mmaps_generator/MapBuilder.cpp +++ b/src/tools/mmaps_generator/MapBuilder.cpp @@ -15,17 +15,15 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <limits.h> #include "PathCommon.h" #include "MapBuilder.h" - #include "MapTree.h" -#include "ModelInstance.h" - #include "DetourNavMeshBuilder.h" #include "DetourNavMesh.h" -#include "DetourCommon.h" +#include "IntermediateValues.h" + +#include <limits.h> #define MMAP_MAGIC 0x4d4d4150 // 'MMAP' #define MMAP_VERSION 5 @@ -164,7 +162,7 @@ namespace MMAP { while (1) { - uint32 mapId; + uint32 mapId = 0; _queue.WaitAndPop(mapId); @@ -215,12 +213,14 @@ namespace MMAP } /**************************************************************************/ - void MapBuilder::getGridBounds(uint32 mapID, uint32 &minX, uint32 &minY, uint32 &maxX, uint32 &maxY) + void MapBuilder::getGridBounds(uint32 mapID, uint32 &minX, uint32 &minY, uint32 &maxX, uint32 &maxY) const { - maxX = INT_MAX; - maxY = INT_MAX; - minX = INT_MIN; - minY = INT_MIN; + // min and max are initialized to invalid values so the caller iterating the [min, max] range + // will never enter the loop unless valid min/max values are found + maxX = 0; + maxY = 0; + minX = std::numeric_limits<uint32>::max(); + minY = std::numeric_limits<uint32>::max(); float bmin[3] = { 0, 0, 0 }; float bmax[3] = { 0, 0, 0 }; diff --git a/src/tools/mmaps_generator/MapBuilder.h b/src/tools/mmaps_generator/MapBuilder.h index ced03d1dde8..432a0ee7489 100644 --- a/src/tools/mmaps_generator/MapBuilder.h +++ b/src/tools/mmaps_generator/MapBuilder.h @@ -19,20 +19,18 @@ #ifndef _MAP_BUILDER_H #define _MAP_BUILDER_H -#include <vector> -#include <set> -#include <map> -#include <list> -#include <atomic> -#include <thread> - #include "TerrainBuilder.h" -#include "IntermediateValues.h" #include "Recast.h" #include "DetourNavMesh.h" #include "ProducerConsumerQueue.h" +#include <vector> +#include <set> +#include <list> +#include <atomic> +#include <thread> + using namespace VMAP; namespace MMAP @@ -120,7 +118,7 @@ namespace MMAP void getTileBounds(uint32 tileX, uint32 tileY, float* verts, int vertCount, float* bmin, float* bmax); - void getGridBounds(uint32 mapID, uint32 &minX, uint32 &minY, uint32 &maxX, uint32 &maxY); + void getGridBounds(uint32 mapID, uint32 &minX, uint32 &minY, uint32 &maxX, uint32 &maxY) const; bool shouldSkipMap(uint32 mapID); bool isTransportMap(uint32 mapID); diff --git a/src/tools/mmaps_generator/PathCommon.h b/src/tools/mmaps_generator/PathCommon.h index 9451e9d03ba..aa9591fba22 100644 --- a/src/tools/mmaps_generator/PathCommon.h +++ b/src/tools/mmaps_generator/PathCommon.h @@ -19,11 +19,10 @@ #ifndef _MMAP_COMMON_H #define _MMAP_COMMON_H -#include <string> -#include <vector> - #include "Common.h" +#include <vector> + #ifndef _WIN32 #include <stddef.h> #include <dirent.h> diff --git a/src/tools/mmaps_generator/TerrainBuilder.cpp b/src/tools/mmaps_generator/TerrainBuilder.cpp index 9043627994b..e525f24fced 100644 --- a/src/tools/mmaps_generator/TerrainBuilder.cpp +++ b/src/tools/mmaps_generator/TerrainBuilder.cpp @@ -764,12 +764,12 @@ namespace MMAP } uint32 liqOffset = meshData.liquidVerts.size() / 3; - for (uint32 i = 0; i < liqVerts.size(); ++i) - meshData.liquidVerts.append(liqVerts[i].y, liqVerts[i].z, liqVerts[i].x); + for (uint32 j = 0; j < liqVerts.size(); ++j) + meshData.liquidVerts.append(liqVerts[j].y, liqVerts[j].z, liqVerts[j].x); - for (uint32 i = 0; i < liqTris.size() / 3; ++i) + for (uint32 j = 0; j < liqTris.size() / 3; ++j) { - meshData.liquidTris.append(liqTris[i*3+1] + liqOffset, liqTris[i*3+2] + liqOffset, liqTris[i*3] + liqOffset); + meshData.liquidTris.append(liqTris[j*3+1] + liqOffset, liqTris[j*3+2] + liqOffset, liqTris[j*3] + liqOffset); meshData.liquidType.append(type); } } diff --git a/src/tools/mmaps_generator/TerrainBuilder.h b/src/tools/mmaps_generator/TerrainBuilder.h index 6c66ae45f46..f305bf0bd48 100644 --- a/src/tools/mmaps_generator/TerrainBuilder.h +++ b/src/tools/mmaps_generator/TerrainBuilder.h @@ -81,11 +81,13 @@ namespace MMAP TerrainBuilder(bool skipLiquid); ~TerrainBuilder(); + TerrainBuilder(const TerrainBuilder &tb) = delete; + void loadMap(uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData); bool loadVMap(uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData); void loadOffMeshConnections(uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, const char* offMeshFilePath); - bool usesLiquids() { return !m_skipLiquid; } + bool usesLiquids() const { return !m_skipLiquid; } // vert and triangle methods static void transform(std::vector<G3D::Vector3> &original, std::vector<G3D::Vector3> &transformed, @@ -104,9 +106,6 @@ namespace MMAP /// Controls whether liquids are loaded bool m_skipLiquid; - /// Load the map terrain from file - bool loadHeightMap(uint32 mapID, uint32 tileX, uint32 tileY, G3D::Array<float> &vertices, G3D::Array<int> &triangles, Spot portion); - /// Get the vector coordinate for a specific position void getHeightCoord(int index, Grid grid, float xOffset, float yOffset, float* coord, float* v); @@ -121,10 +120,6 @@ namespace MMAP /// Get the liquid type for a specific position uint8 getLiquidType(int square, const uint8 liquid_type[16][16]); - - // hide parameterless and copy constructor - TerrainBuilder(); - TerrainBuilder(const TerrainBuilder &tb); }; } diff --git a/src/tools/vmap4_extractor/adtfile.cpp b/src/tools/vmap4_extractor/adtfile.cpp index 557511f6d1e..3a8b3495655 100644 --- a/src/tools/vmap4_extractor/adtfile.cpp +++ b/src/tools/vmap4_extractor/adtfile.cpp @@ -86,11 +86,11 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY) uint32 size; - string xMap; - string yMap; + std::string xMap; + std::string yMap; Adtfilename.erase(Adtfilename.find(".adt"),4); - string TempMapNumber; + std::string TempMapNumber; TempMapNumber = Adtfilename.substr(Adtfilename.length()-6,6); xMap = TempMapNumber.substr(TempMapNumber.find("_")+1,(TempMapNumber.find_last_of("_")-1) - (TempMapNumber.find("_"))); yMap = TempMapNumber.substr(TempMapNumber.find_last_of("_")+1,(TempMapNumber.length()) - (TempMapNumber.find_last_of("_"))); @@ -134,7 +134,7 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY) ADT.read(buf, size); char *p=buf; int t=0; - ModelInstansName = new string[size]; + ModelInstansName = new std::string[size]; while (p<buf+size) { fixnamen(p,strlen(p)); @@ -143,7 +143,7 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY) ModelInstansName[t++] = s; - string path(p); + std::string path(p); ExtractSingleModel(path); p = p+strlen(p)+1; diff --git a/src/tools/vmap4_extractor/mpq_libmpq04.h b/src/tools/vmap4_extractor/mpq_libmpq04.h index 6196285627d..4c8b4d376ca 100644 --- a/src/tools/vmap4_extractor/mpq_libmpq04.h +++ b/src/tools/vmap4_extractor/mpq_libmpq04.h @@ -21,14 +21,12 @@ #include "loadlib/loadlib.h" #include "libmpq/mpq.h" + #include <string.h> -#include <ctype.h> +#include <string> #include <vector> -#include <iostream> #include <deque> -using namespace std; - class MPQArchive { @@ -38,7 +36,7 @@ public: MPQArchive(const char* filename); ~MPQArchive() { close(); } - void GetFileListTo(vector<string>& filelist) { + void GetFileListTo(std::vector<std::string>& filelist) { uint32_t filenum; if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; libmpq__off_t size, transferred; @@ -57,7 +55,7 @@ public: while ((token != NULL) && (counter < size)) { //cout << token << endl; token[strlen(token) - 1] = 0; - string s = token; + std::string s = token; filelist.push_back(s); counter += strlen(token) + 2; token = strtok(NULL, seps); @@ -78,9 +76,8 @@ class MPQFile char *buffer; libmpq__off_t pointer,size; - // disable copying - MPQFile(const MPQFile& /*f*/) {} - void operator=(const MPQFile& /*f*/) {} + MPQFile(const MPQFile& /*f*/) = delete; + void operator=(const MPQFile& /*f*/) = delete; public: MPQFile(const char* filename); // filenames are not case sensitive diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index 7a12897563e..78d6e86358f 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -17,14 +17,15 @@ */ #define _CRT_SECURE_NO_DEPRECATE -#include <cstdio> -#include <iostream> -#include <vector> -#include <list> -#include <errno.h> + +#include "adtfile.h" +#include "wdtfile.h" +#include "dbcfile.h" +#include "wmo.h" +#include "mpq_libmpq04.h" +#include "vmapexport.h" #ifdef WIN32 - #include <Windows.h> #include <sys/stat.h> #include <direct.h> #define mkdir _mkdir @@ -32,23 +33,14 @@ #include <sys/stat.h> #endif +#include <cstdio> +#include <iostream> +#include <vector> +#include <errno.h> + #undef min #undef max -//#pragma warning(disable : 4505) -//#pragma comment(lib, "Winmm.lib") - -#include <map> - -//From Extractor -#include "adtfile.h" -#include "wdtfile.h" -#include "dbcfile.h" -#include "wmo.h" -#include "mpq_libmpq04.h" - -#include "vmapexport.h" - //------------------------------------------------------------------------------ // Defines @@ -129,12 +121,12 @@ bool ExtractWmo() for (ArchiveSet::const_iterator ar_itr = gOpenArchives.begin(); ar_itr != gOpenArchives.end() && success; ++ar_itr) { - vector<string> filelist; + std::vector<std::string> filelist; (*ar_itr)->GetFileListTo(filelist); - for (vector<string>::iterator fname = filelist.begin(); fname != filelist.end() && success; ++fname) + for (std::vector<std::string>::iterator fname = filelist.begin(); fname != filelist.end() && success; ++fname) { - if (fname->find(".wmo") != string::npos) + if (fname->find(".wmo") != std::string::npos) success = ExtractSingleWmo(*fname); } } @@ -203,7 +195,7 @@ bool ExtractSingleWmo(std::string& fname) sprintf(groupFileName, "%s_%03u.wmo", temp, i); //printf("Trying to open groupfile %s\n",groupFileName); - string s = groupFileName; + std::string s = groupFileName; WMOGroup fgroup(s); if(!fgroup.open()) { @@ -305,7 +297,7 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames) printf("\nGame path: %s\n", input_path); char path[512]; - string in_path(input_path); + std::string in_path(input_path); std::vector<std::string> locales, searchLocales; searchLocales.push_back("enGB"); @@ -345,10 +337,10 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames) } // open expansion and common files - pArchiveNames.push_back(input_path + string("common.MPQ")); - pArchiveNames.push_back(input_path + string("common-2.MPQ")); - pArchiveNames.push_back(input_path + string("expansion.MPQ")); - pArchiveNames.push_back(input_path + string("lichking.MPQ")); + pArchiveNames.push_back(input_path + std::string("common.MPQ")); + pArchiveNames.push_back(input_path + std::string("common-2.MPQ")); + pArchiveNames.push_back(input_path + std::string("expansion.MPQ")); + pArchiveNames.push_back(input_path + std::string("lichking.MPQ")); // now, scan for the patch levels in the core dir printf("Scanning patch levels from data directory.\n"); diff --git a/src/tools/vmap4_extractor/wdtfile.cpp b/src/tools/vmap4_extractor/wdtfile.cpp index 877f49ce371..4e0b7b97705 100644 --- a/src/tools/vmap4_extractor/wdtfile.cpp +++ b/src/tools/vmap4_extractor/wdtfile.cpp @@ -19,6 +19,7 @@ #include "vmapexport.h" #include "wdtfile.h" #include "adtfile.h" + #include <cstdio> char * wdtGetPlainName(char * FileName) @@ -30,7 +31,7 @@ char * wdtGetPlainName(char * FileName) return FileName; } -WDTFile::WDTFile(char* file_name, char* file_name1) : WDT(file_name), gWmoInstansName(NULL), gnWMO(0) +WDTFile::WDTFile(char* file_name, char* file_name1) : gWmoInstansName(NULL), gnWMO(0), WDT(file_name) { filename.append(file_name1,strlen(file_name1)); } @@ -77,7 +78,7 @@ bool WDTFile::init(char* /*map_id*/, unsigned int mapID) WDT.read(buf, size); char *p=buf; int q = 0; - gWmoInstansName = new string[size]; + gWmoInstansName = new std::string[size]; while (p < buf + size) { char* s=wdtGetPlainName(p); diff --git a/src/tools/vmap4_extractor/wdtfile.h b/src/tools/vmap4_extractor/wdtfile.h index 22702133b95..81e84b36d1e 100644 --- a/src/tools/vmap4_extractor/wdtfile.h +++ b/src/tools/vmap4_extractor/wdtfile.h @@ -20,26 +20,25 @@ #define WDTFILE_H #include "mpq_libmpq04.h" -#include "wmo.h" #include <string> -#include "stdlib.h" class ADTFile; class WDTFile { -private: - MPQFile WDT; - string filename; public: WDTFile(char* file_name, char* file_name1); ~WDTFile(void); + bool init(char* map_id, unsigned int mapID); + ADTFile* GetMap(int x, int z); - string* gWmoInstansName; + std::string* gWmoInstansName; int gnWMO; - ADTFile* GetMap(int x, int z); +private: + MPQFile WDT; + std::string filename; }; #endif diff --git a/src/tools/vmap4_extractor/wmo.cpp b/src/tools/vmap4_extractor/wmo.cpp index f6f59bbc475..80dfbb97c5a 100644 --- a/src/tools/vmap4_extractor/wmo.cpp +++ b/src/tools/vmap4_extractor/wmo.cpp @@ -19,16 +19,14 @@ #include "vmapexport.h" #include "wmo.h" #include "vec3d.h" +#include "mpq_libmpq04.h" + #include <cstdio> #include <cstdlib> #include <cassert> -#include <map> -#include <fstream> #undef min #undef max -#include "mpq_libmpq04.h" -using namespace std; extern uint16 *LiqType; WMORoot::WMORoot(std::string &filename) |
