aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--cmake/options.cmake1
-rw-r--r--sql/updates/world/2015_01_27_00_world.sql56
-rw-r--r--sql/updates/world/2015_01_30_00_world.sql32
-rw-r--r--sql/updates/world/2015_01_31_00_335.sql3
-rw-r--r--sql/updates/world/2015_02_02_00_world.sql16
-rw-r--r--sql/updates/world/2015_02_05_00_world.sql4
-rw-r--r--sql/updates/world/2015_02_06_00_world.sql27
-rw-r--r--sql/updates/world/2015_02_06_01_world.sql40
-rw-r--r--sql/updates/world/2015_02_06_02_world.sql33
-rw-r--r--sql/updates/world/2015_02_06_03_world.sql62
-rw-r--r--sql/updates/world/2015_02_06_04_world.sql32
-rw-r--r--sql/updates/world/2015_02_06_05_world.sql45
-rw-r--r--sql/updates/world/2015_02_06_06_world.sql2
-rw-r--r--sql/updates/world/2015_02_06_07_world.sql6
-rw-r--r--sql/updates/world/2015_02_06_08_world.sql4
-rw-r--r--sql/updates/world/2015_02_06_09_world.sql11
-rw-r--r--sql/updates/world/2015_02_06_10_world.sql2
-rw-r--r--sql/updates/world/2015_02_06_11_world.sql7
-rw-r--r--sql/updates/world/2015_02_06_12_world.sql2
-rw-r--r--sql/updates/world/2015_02_06_13_world_335.sql372
-rw-r--r--sql/updates/world/2015_02_07_00_world.sql14
-rw-r--r--sql/updates/world/2015_02_07_01_world.sql2
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp12
-rw-r--r--src/server/collision/Models/GameObjectModel.cpp6
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBot.cpp2
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp2
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp4
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp20
-rw-r--r--src/server/game/Entities/Creature/Creature.h1
-rw-r--r--src/server/game/Entities/Player/Player.cpp10
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp34
-rw-r--r--src/server/game/Groups/Group.cpp2
-rw-r--r--src/server/game/Handlers/QuestHandler.cpp6
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h2
-rw-r--r--src/server/game/Reputation/ReputationMgr.cpp2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp43
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h6
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp20
-rw-r--r--src/server/game/Spells/Spell.cpp4
-rw-r--r--src/server/game/Spells/SpellMgr.cpp4
-rw-r--r--src/server/game/World/World.cpp19
-rw-r--r--src/server/game/World/World.h2
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp9
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp414
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h23
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp52
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_zuldrak.cpp2
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp4
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp7
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp4
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp4
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp2
-rw-r--r--src/server/shared/DataStores/DBCStore.h7
-rw-r--r--src/server/shared/Database/DatabaseWorkerPool.h9
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp12
-rw-r--r--src/server/shared/Database/MySQLConnection.h2
-rw-r--r--src/server/shared/Database/Transaction.cpp8
-rw-r--r--src/server/shared/Debugging/Errors.h6
-rw-r--r--src/server/worldserver/worldserver.conf.dist15
-rw-r--r--src/tools/CMakeLists.txt3
-rw-r--r--src/tools/mesh_extractor/ADT.cpp70
-rw-r--r--src/tools/mesh_extractor/ADT.h49
-rw-r--r--src/tools/mesh_extractor/CMakeLists.txt50
-rw-r--r--src/tools/mesh_extractor/Cache.h80
-rw-r--r--src/tools/mesh_extractor/Chunk.cpp48
-rw-r--r--src/tools/mesh_extractor/Chunk.h37
-rw-r--r--src/tools/mesh_extractor/ChunkedData.cpp91
-rw-r--r--src/tools/mesh_extractor/ChunkedData.h38
-rw-r--r--src/tools/mesh_extractor/Constants.h75
-rw-r--r--src/tools/mesh_extractor/ContinentBuilder.cpp213
-rw-r--r--src/tools/mesh_extractor/ContinentBuilder.h47
-rw-r--r--src/tools/mesh_extractor/DBC.cpp87
-rw-r--r--src/tools/mesh_extractor/DBC.h70
-rw-r--r--src/tools/mesh_extractor/DoodadHandler.cpp126
-rw-r--r--src/tools/mesh_extractor/DoodadHandler.h79
-rw-r--r--src/tools/mesh_extractor/Geometry.cpp146
-rw-r--r--src/tools/mesh_extractor/Geometry.h40
-rw-r--r--src/tools/mesh_extractor/LiquidHandler.cpp119
-rw-r--r--src/tools/mesh_extractor/LiquidHandler.h38
-rw-r--r--src/tools/mesh_extractor/MPQ.cpp139
-rw-r--r--src/tools/mesh_extractor/MPQ.h106
-rw-r--r--src/tools/mesh_extractor/MPQManager.cpp132
-rw-r--r--src/tools/mesh_extractor/MPQManager.h53
-rw-r--r--src/tools/mesh_extractor/MapChunk.cpp93
-rw-r--r--src/tools/mesh_extractor/MapChunk.h41
-rw-r--r--src/tools/mesh_extractor/MeshExtractor.cpp486
-rw-r--r--src/tools/mesh_extractor/Model.cpp84
-rw-r--r--src/tools/mesh_extractor/Model.h40
-rw-r--r--src/tools/mesh_extractor/ObjectDataHandler.cpp26
-rw-r--r--src/tools/mesh_extractor/ObjectDataHandler.h32
-rw-r--r--src/tools/mesh_extractor/TileBuilder.cpp414
-rw-r--r--src/tools/mesh_extractor/TileBuilder.h51
-rw-r--r--src/tools/mesh_extractor/Utils.cpp564
-rw-r--r--src/tools/mesh_extractor/Utils.h407
-rw-r--r--src/tools/mesh_extractor/WDT.cpp78
-rw-r--r--src/tools/mesh_extractor/WDT.h46
-rw-r--r--src/tools/mesh_extractor/WorldModelGroup.cpp160
-rw-r--r--src/tools/mesh_extractor/WorldModelGroup.h55
-rw-r--r--src/tools/mesh_extractor/WorldModelHandler.cpp237
-rw-r--r--src/tools/mesh_extractor/WorldModelHandler.h64
-rw-r--r--src/tools/mesh_extractor/WorldModelRoot.cpp96
-rw-r--r--src/tools/mesh_extractor/WorldModelRoot.h44
-rw-r--r--src/tools/mesh_extractor/readme6
106 files changed, 1450 insertions, 5070 deletions
diff --git a/README.md b/README.md
index 263339fc9dd..d92b3848c94 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
[![Coverity Scan Build Status](https://scan.coverity.com/projects/435/badge.svg)](https://scan.coverity.com/projects/435)
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=1310)](https://www.bountysource.com/trackers/1310-trinity-core?utm_source=1310&utm_medium=shield&utm_campaign=TRACKER_BADGE)
+[![Issue Stats](http://www.issuestats.com/github/TrinityCore/TrinityCore/badge/pr)](http://www.issuestats.com/github/TrinityCore/TrinityCore)
+[![Issue Stats](http://www.issuestats.com/github/TrinityCore/TrinityCore/badge/issue)](http://www.issuestats.com/github/TrinityCore/TrinityCore)
`6.x`: [![6.x Build Status](https://travis-ci.org/TrinityCore/TrinityCore.svg?branch=6.x)](https://travis-ci.org/TrinityCore/TrinityCore)
`4.3.4`: [![4.3.4 Build Status](https://travis-ci.org/TrinityCore/TrinityCore.svg?branch=4.3.4)](https://travis-ci.org/TrinityCore/TrinityCore)
`3.3.5`: [![3.3.5 Build Status](https://travis-ci.org/TrinityCore/TrinityCore.svg?branch=3.3.5)](https://travis-ci.org/TrinityCore/TrinityCore)
diff --git a/cmake/options.cmake b/cmake/options.cmake
index 49a9e5551dd..83783fdc1b6 100644
--- a/cmake/options.cmake
+++ b/cmake/options.cmake
@@ -15,5 +15,4 @@ option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts"
option(USE_COREPCH "Use precompiled headers when compiling servers" 1)
option(WITH_WARNINGS "Show all warnings during compile" 0)
option(WITH_COREDEBUG "Include additional debug-code in core" 0)
-option(WITH_MESHEXTRACTOR "Build meshextractor (alpha)" 0)
option(WITHOUT_GIT "Disable the GIT testing routines" 0)
diff --git a/sql/updates/world/2015_01_27_00_world.sql b/sql/updates/world/2015_01_27_00_world.sql
new file mode 100644
index 00000000000..5b964110846
--- /dev/null
+++ b/sql/updates/world/2015_01_27_00_world.sql
@@ -0,0 +1,56 @@
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(18230,18237);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(18230,18237) 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
+(18230, 0, 0, 0, 1, 0, 100, 0, 0, 0, 500, 500, 29, 0, 0, 0, 0, 0, 0, 19, 18237, 0, 0, 0, 0, 0, 0, 'Trayanise - OOC - Follow Tiny Arcane Construct'),
+(18230, 0, 1, 0, 1, 0, 100, 0, 0, 60000, 180000, 300000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Trayanise - OOC - Say Line 0'),
+(18237, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 53, 1, 18237, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tiny Arcane Construct - On Spawn - Start WP');
+
+UPDATE `creature_template` SET `speed_run`=1.142857 WHERE `entry`=18230;
+UPDATE `creature_template` SET `speed_run`=2.142857 WHERE `entry`=18237;
+
+DELETE FROM `creature_addon` WHERE `guid` IN(65501,65505);
+INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(65501, 0, 0, 0x0, 0x1, 0, NULL),
+(65505, 0, 0, 0x0, 0x1, 0, NULL);
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN(18230,18237);
+
+DELETE FROM `creature` WHERE `guid` IN(65501,65505);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(65501, 18230, 530, 1, 1, 9891.047, -7180.686, 31.02935, 2.363085, 120, 0, 0), -- 18230 (Area: 3487)
+(65505, 18237, 530, 1, 1, 9886.445, -7179.344, 31.03508, 2.353462, 120, 0, 0); -- 18237 (Area: 3487)
+
+
+DELETE FROM `waypoint_data` WHERE `id` IN(655010,655050);
+
+DELETE FROM `waypoints` WHERE `entry` IN(18230,18237);
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(18237, 1, 9854.372, -7131.53, 30.8774, 'Tiny Arcane Construct'),
+(18237, 2, 9848.939, -7149.687, 30.88104, 'Tiny Arcane Construct'),
+(18237, 3, 9853.528, -7164.35, 30.94116, 'Tiny Arcane Construct'),
+(18237, 4, 9873.93, -7174.143, 31.04511, 'Tiny Arcane Construct'),
+(18237, 5, 9890.317, -7171.364, 32.04652, 'Tiny Arcane Construct'),
+(18237, 6, 9893.691, -7182.642, 31.02659, 'Tiny Arcane Construct'),
+(18237, 7, 9906.294, -7211.048, 30.9103, 'Tiny Arcane Construct'),
+(18237, 8, 9914.21, -7215.013, 30.81886, 'Tiny Arcane Construct'),
+(18237, 9, 9930.763, -7214.394, 30.86104, 'Tiny Arcane Construct'),
+(18237, 10, 9954.362, -7211.773, 30.87779, 'Tiny Arcane Construct'),
+(18237, 11, 9953.68, -7204.061, 30.87768, 'Tiny Arcane Construct'),
+(18237, 12, 9941.922, -7198.434, 30.87755, 'Tiny Arcane Construct'),
+(18237, 13, 9915.126, -7188.168, 30.9569, 'Tiny Arcane Construct'),
+(18237, 14, 9897.4, -7190.357, 31.03786, 'Tiny Arcane Construct'),
+(18237, 15, 9885.156, -7178.048, 31.03413, 'Tiny Arcane Construct'),
+(18237, 16, 9874.851, -7163.025, 30.99726, 'Tiny Arcane Construct'),
+(18237, 17, 9867.523, -7139.578, 30.87733, 'Tiny Arcane Construct');
+
+DELETE FROM `creature_text` WHERE `entry`=18230;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES
+(18230, 0, 0, 'The magister''s going to kill me...', 12, 1, 100, 0, 0, 0, 15011, 'Trayanise'),
+(18230, 0, 1, 'No, no, no! Come back here!', 12, 1, 100, 0, 0, 0, 15010, 'Trayanise'),
+(18230, 0, 2, 'Argh. They told me those crystals would work properly!', 12, 1, 100, 0, 0, 0, 15013, 'Trayanise'),
+(18230, 0, 3, 'When I catch you, I''m going to disenchant your components, so help me...', 12, 1, 100, 0, 0, 0, 15015, 'Trayanise'),
+(18230, 0, 4, 'Get back here, you little...', 12, 1, 100, 0, 0, 0, 15012, 'Trayanise'),
+(18230, 0, 5, 'You stay out of the regent lord''s way! I mean it!', 12, 1, 100, 0, 0, 0, 15014, 'Trayanise');
+
diff --git a/sql/updates/world/2015_01_30_00_world.sql b/sql/updates/world/2015_01_30_00_world.sql
new file mode 100644
index 00000000000..4393b38ddd2
--- /dev/null
+++ b/sql/updates/world/2015_01_30_00_world.sql
@@ -0,0 +1,32 @@
+DELETE FROM `creature_text` WHERE `entry` IN(37158,37704);
+DELETE FROM `creature_text` WHERE `entry`=37225 AND `groupid` > 15;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
+(37158, 0, 0, '%s prepares to attack!', 41, 0, 100, 0, 0, 0, 'Quel''Delar', 37211),
+(37704, 0, 0, 'Quel''Delar leaps to life in the presence of Frostmourne!', 41, 0, 100, 0, 0, 0, 'Frostmourne Altar Bunny (Quel''Delar)', 37645),
+-- Uther
+(37225, 16, 0, 'Halt! Do not carry that blade any further!', 14, 0, 100, 25, 0, 16675, 'Uther the Lightbringer', 37201),
+(37225, 17, 0, 'Do you realize what you''ve done?', 14, 0, 100, 5, 0, 16676, 'Uther the Lightbringer', 37202),
+(37225, 18, 0, 'You have forged this blade from saronite, the very blood of an old god. The power of the Lich King calls to this weapon.', 12, 0, 100, 1, 0, 16677, 'Uther the Lightbringer', 37204),
+(37225, 19, 0, 'Each moment you tarry here, Quel''Delar drinks in the evil of this place.', 12, 0, 100, 1, 0, 16678, 'Uther the Lightbringer', 38442),
+(37225, 20, 0, 'There is only one way to cleanse this sword. Make haste for the Sunwell and immerse the blade in its waters.', 12, 0, 100, 25, 0, 16679, 'Uther the Lightbringer', 37205),
+(37225, 21, 0, 'I can resist Frostmourne''s call no more...', 12, 0, 100, 1, 0, 16680, 'Uther the Lightbringer', 37206);
+
+UPDATE `creature_template` SET `unit_flags`=768, `flags_extra`=0, `ScriptName`='npc_quel_delar_sword', `InhabitType`=7 WHERE `entry`=37158;
+UPDATE `creature_template` SET `ScriptName`='npc_uther_quel_delar' WHERE `entry`=37225;
+
+DELETE FROM `areatrigger_scripts` WHERE `entry`=5660;
+INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES
+(5660, 'at_hor_uther_quel_delar_start');
+
+DELETE FROM `spell_target_position` WHERE `id` IN(70719,70700);
+INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES
+(70719, 668, 5302, 1989, 708, 0),
+(70700, 668, 5298, 1995, 708, 0);
+
+DELETE FROM `creature_loot_template` WHERE `entry` = 37158 AND `item` = 50254;
+INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Chance`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES
+(37158, 50254, 100, 1, 0, 1, 1);
+
+DELETE FROM `conditions` WHERE `SourceEntry` = 73035 AND `SourceTypeOrReferenceId` = 13;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `Comment`) VALUES
+(13,1,73035,0,0,31,0,3,37704,0,0,0,0,'Essence of the Captured (73035) only hits Frostmourne Altar Bunny (Quel''Delar)');
diff --git a/sql/updates/world/2015_01_31_00_335.sql b/sql/updates/world/2015_01_31_00_335.sql
new file mode 100644
index 00000000000..8aaa026154a
--- /dev/null
+++ b/sql/updates/world/2015_01_31_00_335.sql
@@ -0,0 +1,3 @@
+DELETE FROM `gameobject_template` WHERE `entry` = 180856;
+INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `data0`, `data1`, `data2`, `data3`, `size`, `VerifiedBuild`) VALUES
+(180856, 10, 6522, 'Firework Rocket, Type 1 Purple', 0, 0, 0, 3000, 1, -18019);
diff --git a/sql/updates/world/2015_02_02_00_world.sql b/sql/updates/world/2015_02_02_00_world.sql
new file mode 100644
index 00000000000..84d31ef7be1
--- /dev/null
+++ b/sql/updates/world/2015_02_02_00_world.sql
@@ -0,0 +1,16 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN(29491,28994,28721,28725,33027,28727,28715,28714,28726,29523,28989,28997,28723,28718);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22, 1, 29491, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Karandonna - Only run SAI if invoker is player'),
+(22, 1, 28994, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Abra Cadabra - Only run SAI if invoker is player'),
+(22, 1, 28721, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Tiffany Cartier - Only run SAI if invoker is player'),
+(22, 1, 28725, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Patricia Egan - Only run SAI if invoker is player'),
+(22, 1, 33027, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Jessica Sellers - Only run SAI if invoker is player'),
+(22, 1, 28727, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Edward Egan - Only run SAI if invoker is player'),
+(22, 1, 28714, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Ildine Sorrowspear - Only run SAI if invoker is player'),
+(22, 1, 28715, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Endora Moorehead - Only run SAI if invoker is player'),
+(22, 1, 28726, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Dominique Stefano - Only run SAI if invoker is player'),
+(22, 1, 29523, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Bragund Brightlink - Only run SAI if invoker is player'),
+(22, 1, 28997, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Griselda Hunderland - Only run SAI if invoker is player'),
+(22, 1, 28989, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Aemara - Only run SAI if invoker is player'),
+(22, 1, 28723, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Larana Drome - Only run SAI if invoker is player'),
+(22, 1, 28718, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Ranid Glowergold - Only run SAI if invoker is player');
diff --git a/sql/updates/world/2015_02_05_00_world.sql b/sql/updates/world/2015_02_05_00_world.sql
new file mode 100644
index 00000000000..77bc4fd8b53
--- /dev/null
+++ b/sql/updates/world/2015_02_05_00_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `skill_fishing_base_level` WHERE `entry`=4710;
+INSERT INTO `skill_fishing_base_level` (`entry`, `skill`) VALUES
+(4710, 480);
diff --git a/sql/updates/world/2015_02_06_00_world.sql b/sql/updates/world/2015_02_06_00_world.sql
new file mode 100644
index 00000000000..96eb6a65f28
--- /dev/null
+++ b/sql/updates/world/2015_02_06_00_world.sql
@@ -0,0 +1,27 @@
+-- The Brewmaiden SAI
+SET @ENTRY := 36021;
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 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
+(@ENTRY,0,0,0,22,0,100,0,101,0,0,0,11,48249,1,0,0,0,0,7,0,0,0,0,0,0,0,'The Brewmaiden - Received Emote 101 - Cast ''Brewfest Brew Toss''');
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES
+(@ENTRY,0x1,'68269');
+
+
+-- The Brewmaiden SAI
+SET @ENTRY := 27166;
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,22,0,100,0,101,0,0,0,11,48249,1,0,0,0,0,7,0,0,0,0,0,0,0,'The Brewmaiden - Received Emote 101 - Cast ''Brewfest Brew Toss''');
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES
+(@ENTRY,0x1,'51847');
diff --git a/sql/updates/world/2015_02_06_01_world.sql b/sql/updates/world/2015_02_06_01_world.sql
new file mode 100644
index 00000000000..3b16d7a367c
--- /dev/null
+++ b/sql/updates/world/2015_02_06_01_world.sql
@@ -0,0 +1,40 @@
+-- Fel Portal Alarm SAI
+SET @ENTRY := 23310;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,11,0,100,1,0,0,0,0,11,46907,0,0,0,0,0,1,0,0,0,0,0,0,0,"Fel Portal Alarm - On Respawn - Cast 'Boss Fel Portal State' (No Repeat)"),
+(@ENTRY,0,1,0,38,0,100,0,1,1,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Fel Portal Alarm - On Data Set 1 1 - Increment Phase"),
+(@ENTRY,0,2,3,1,32,100,0,1000,1000,0,0,12,25003,5,120000,0,0,0,1,0,0,0,0,0,0,0,"Fel Portal Alarm - Out of Combat - Summon Creature 'Emissary of Hate' (Phase 32)"),
+(@ENTRY,0,3,0,61,32,100,0,1000,1000,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Fel Portal Alarm - Out of Combat - Set Event Phase 0 (Phase 32)");
+
+DELETE FROM `creature` WHERE `id`=25003;
+
+-- Irespeaker SAI
+SET @ENTRY := 24999;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,0,0,100,0,1500,3000,10000,15000,11,35913,0,0,0,0,0,2,0,0,0,0,0,0,0,"Irespeaker - In Combat - Cast 'Fel Fireball'"),
+(@ENTRY,0,1,0,0,0,100,0,13000,16000,20000,35000,11,18267,0,0,0,0,0,2,0,0,0,0,0,0,0,"Irespeaker - In Combat - Cast 'Curse of Weakness'"),
+(@ENTRY,0,2,0,6,0,100,1,0,0,0,0,33,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Irespeaker - On Just Died - Quest Credit 'Kanrethad's Quest' (No Repeat)"),
+(@ENTRY,0,3,0,6,0,100,0,5000,5000,10000,10000,45,1,1,0,0,0,0,10,79450,23310,0,0,0,0,0,"Irespeaker - On Just Died - Set Data 1 1");
+
+-- Unleashed Hellion SAI
+SET @ENTRY := 25002;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,6,0,100,1,0,0,0,0,33,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Unleashed Hellion - On Just Died - Quest Credit 'Kanrethad's Quest' (No Repeat)"),
+(@ENTRY,0,1,0,0,0,100,0,4000,5000,18000,35000,11,11876,0,0,0,0,0,2,0,0,0,0,0,0,0,"Unleashed Hellion - In Combat - Cast 'War Stomp'"),
+(@ENTRY,0,2,0,0,0,100,0,6000,9000,12600,16000,11,20754,0,0,0,0,0,2,0,0,0,0,0,0,0,"Unleashed Hellion - In Combat - Cast 'Rain of Fire'"),
+(@ENTRY,0,3,0,6,0,100,0,0,0,0,0,45,1,1,0,0,0,0,10,79450,23310,0,0,0,0,0,"Unleashed Hellion - On Just Died - Set Data 1 1");
+
+-- Emissary of Hate SAI
+SET @ENTRY := 25003;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,0,0,100,0,2000,5000,15000,20000,11,25003,0,0,0,0,0,2,0,0,0,0,0,0,0,"Emissary of Hate - In Combat - Cast 'Mortar'"),
+(@ENTRY,0,1,0,0,0,100,0,8000,10000,15000,20000,11,38611,0,0,0,0,0,2,0,0,0,0,0,0,0,"Emissary of Hate - In Combat - Cast 'Flame Wave'"),
+(@ENTRY,0,2,0,54,0,100,0,0,0,0,0,89,10,0,0,0,0,0,1,0,0,0,0,0,0,0,"Emissary of Hate - On Just Summoned - Start Random Movement");
diff --git a/sql/updates/world/2015_02_06_02_world.sql b/sql/updates/world/2015_02_06_02_world.sql
new file mode 100644
index 00000000000..4c514ea95d4
--- /dev/null
+++ b/sql/updates/world/2015_02_06_02_world.sql
@@ -0,0 +1,33 @@
+-- Master Gadrin SAI
+SET @ENTRY := 3188;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,20,0,100,0,808,0,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Master Gadrin - On Quest 'Minshina's Skull' Finished - Run Script");
+
+-- Actionlist SAI
+SET @ENTRY := 318800;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,9,0,0,0,0,100,0,2000,2000,0,0,12,3289,5,14000,0,0,0,8,0,0,0,-822.91,-4923.33,19.6365,3.41642,"Master Gadrin - On Script - Summon Creature 'Spirit of Minshina'"),
+(@ENTRY,9,1,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,21,20,0,0,0,0,0,0,"Master Gadrin - On Script - Set Orientation Closest Player"),
+(@ENTRY,9,2,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,21,20,0,0,0,0,0,0,"Master Gadrin - On Script - Say Line 0");
+
+-- Spirit of Minshina SAI
+SET @ENTRY := 3289;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,54,0,100,0,0,0,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Spirit of Minshina - On Just Summoned - Run Script");
+
+-- Actionlist SAI
+SET @ENTRY := 328900;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,9,0,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,21,20,0,0,0,0,0,0,"Spirit of Minshina - On Script - Set Orientation Closest Player"),
+(@ENTRY,9,1,0,0,0,100,0,2000,2000,0,0,5,2,0,0,0,0,0,1,2000,2000,0,0,0,0,0,"Spirit of Minshina - On Script - Play Emote 2"),
+(@ENTRY,9,2,0,0,0,100,0,11000,11000,0,0,41,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Spirit of Minshina - On Script - Despawn Instant");
+
+DELETE FROM `creature_text` WHERE `entry`=3188;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
+(3188, 0, 0, 'I thank you, $n. And my brother thanks you.', 12, 0, 100, 0, 0, 0, 'Master Gadrin', 983);
diff --git a/sql/updates/world/2015_02_06_03_world.sql b/sql/updates/world/2015_02_06_03_world.sql
new file mode 100644
index 00000000000..83aedd75069
--- /dev/null
+++ b/sql/updates/world/2015_02_06_03_world.sql
@@ -0,0 +1,62 @@
+--
+DELETE FROM `waypoints` WHERE `entry`=16856;
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(16856, 1,-807.327,2739.82,115.447, 'Caretaker Dilandrus'),
+(16856, 2,-798.86,2719.21,111.628, 'Caretaker Dilandrus'),
+(16856, 3,-785.502,2706.21,107.293, 'Caretaker Dilandrus'),
+(16856, 4,-785.546,2702.16,106.208, 'Caretaker Dilandrus'),
+(16856, 5,-787.652,2700.58,105.792, 'Caretaker Dilandrus'),
+(16856, 6,-791.771,2694.26,104.589, 'Caretaker Dilandrus'),
+(16856, 7,-793.482,2693.76,104.592, 'Caretaker Dilandrus'),
+(16856, 8,-794.696,2691.44,104.35, 'Caretaker Dilandrus'),
+(16856, 9,-797.951,2691.02,104.535, 'Caretaker Dilandrus'),
+(16856, 10,-798.984,2693.63,104.891, 'Caretaker Dilandrus'),
+(16856, 11,-797.778,2697.53,105.43, 'Caretaker Dilandrus'),
+(16856, 12,-792.678,2705.64,106.948, 'Caretaker Dilandrus'),
+(16856, 13,-792.409,2708.46,107.754, 'Caretaker Dilandrus'),
+(16856, 14,-794.25,2710.38,108.384, 'Caretaker Dilandrus'),
+(16856, 15,-799.924,2706.66,107.387, 'Caretaker Dilandrus'),
+(16856, 16,-807.92,2692.9,104.856, 'Caretaker Dilandrus'),
+(16856, 17,-811.612,2690.9,104.36, 'Caretaker Dilandrus'),
+(16856, 18,-814.837,2692.26,104.736, 'Caretaker Dilandrus'),
+(16856, 19,-814.33,2696.03,105.773, 'Caretaker Dilandrus'),
+(16856, 20,-809.779,2704.45,107.63, 'Caretaker Dilandrus'),
+(16856, 21,-801.425,2715.06,109.679, 'Caretaker Dilandrus'),
+(16856, 22,-801.359,2718.11,110.676, 'Caretaker Dilandrus'),
+(16856, 23,-804.433,2720.69,111.13, 'Caretaker Dilandrus'),
+(16856, 24,-810.324,2717.67,110.329, 'Caretaker Dilandrus'),
+(16856, 25,-814.433,2712.14,109.487, 'Caretaker Dilandrus'),
+(16856, 26,-820.17,2701.35,107.506, 'Caretaker Dilandrus'),
+(16856, 27,-823.067,2699.77,107.458, 'Caretaker Dilandrus'),
+(16856, 28,-824.921,2701.38,107.939, 'Caretaker Dilandrus'),
+(16856, 29,-824.739,2706.05,108.591, 'Caretaker Dilandrus'),
+(16856, 30,-820.185,2714.8,110.056, 'Caretaker Dilandrus'),
+(16856, 31,-814.476,2725.61,111.567, 'Caretaker Dilandrus'),
+(16856, 32,-807.327,2739.82,115.447, 'Caretaker Dilandrus'),
+(16856, 33,-807.327,2739.82,115.447, 'Caretaker Dilandrus');
+
+UPDATE `creature` SET `position_x`=-807.327, `position_y`=2739.82, `position_z`=115.447, `orientation`=2.611, `MovementType`=2 WHERE `guid`=58021;
+
+-- Caretaker Dilandrus SAI
+SET @ENTRY := 16856;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,25,0,100,0,0,0,0,0,53,0,16856,1,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Reset - Start Waypoint"),
+(@ENTRY,0,1,0,40,0,100,0,5,16856,0,0,80,@ENTRY*100+01,2,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Waypoint 5 Reached - Run Script"),
+(@ENTRY,0,2,0,40,0,100,0,7,16856,0,0,80,@ENTRY*100+01,2,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Waypoint 7 Reached - Run Script"),
+(@ENTRY,0,3,0,40,0,100,0,11,16856,0,0,80,@ENTRY*100+01,2,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Waypoint 11 Reached - Run Script"),
+(@ENTRY,0,4,0,40,0,100,0,15,16856,0,0,80,@ENTRY*100+01,2,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Waypoint 15 Reached - Run Script"),
+(@ENTRY,0,5,0,40,0,100,0,20,16856,0,0,80,@ENTRY*100+01,2,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Waypoint 20 Reached - Run Script"),
+(@ENTRY,0,6,0,40,0,100,0,24,16856,0,0,80,@ENTRY*100+01,2,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Waypoint 24 Reached - Run Script"),
+(@ENTRY,0,7,0,40,0,100,0,30,16856,0,0,80,@ENTRY*100+01,2,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Waypoint 30 Reached - Run Script"),
+(@ENTRY,0,8,0,40,0,100,0,33,16856,0,0,54,300000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Waypoint 33 Reached - Pause Waypoint");
+
+-- Actionlist SAI
+SET @ENTRY := 1685601;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Script - Pause Waypoint"),
+(@ENTRY,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,2.75976,"Caretaker Dilandrus - On Script - Set Orientation Home Position"),
+(@ENTRY,9,2,0,0,0,100,0,3000,3000,0,0,5,66,0,0,0,0,0,1,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Script - Play Emote 66"),
+(@ENTRY,9,3,0,0,0,100,0,3000,3000,0,0,5,68,0,0,0,0,0,0,0,0,0,0,0,0,0,"Caretaker Dilandrus - On Script - Play Emote 68");
diff --git a/sql/updates/world/2015_02_06_04_world.sql b/sql/updates/world/2015_02_06_04_world.sql
new file mode 100644
index 00000000000..1a4484df5a3
--- /dev/null
+++ b/sql/updates/world/2015_02_06_04_world.sql
@@ -0,0 +1,32 @@
+-- Areatrigger SAI
+SET @ENTRY := 1447;
+DELETE FROM `areatrigger_scripts` WHERE `entry`=@ENTRY;
+INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES (@ENTRY,"SmartTrigger");
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=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
+(@ENTRY,2,0,0,46,0,100,0,0,0,0,0,45,1,1,0,0,0,0,10,81519,8127,0,0,0,0,0,"Areatrigger - On Trigger - Set Data 1 1");
+
+-- Antu'sul SAI
+SET @ENTRY := 8127;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,1,0,0,50,2,11600,11600,13300,21700,11,8376,0,0,0,0,0,1,0,0,0,0,0,0,0,"Antu'sul - In Combat - Cast 'Earthgrab Totem' (Normal Dungeon)"),
+(@ENTRY,0,1,0,61,0,50,3,11600,11600,13300,21700,11,11899,0,0,0,0,0,1,0,0,0,0,0,0,0,"Antu'sul - In Combat - Cast 'Healing Ward' (Normal Dungeon)"),
+(@ENTRY,0,2,6,4,0,100,3,0,0,0,0,11,11894,0,0,0,0,0,1,0,0,0,0,0,0,0,"Antu'sul - On Aggro - Cast 'Antu'sul's Minion' (No Repeat) (Normal Dungeon)"),
+(@ENTRY,0,3,0,2,0,100,3,0,20,0,0,11,11895,0,0,0,0,0,1,0,0,0,0,0,0,0,"Antu'sul - Between 0-20% Health - Cast 'Healing Wave of Antu'sul' (No Repeat) (Normal Dungeon)"),
+(@ENTRY,0,4,5,2,0,100,3,0,25,0,0,11,11894,0,0,0,0,0,1,0,0,0,0,0,0,0,"Antu'sul - Between 0-25% Health - Cast 'Antu'sul's Minion' (No Repeat) (Normal Dungeon)"),
+(@ENTRY,0,5,0,61,0,100,3,0,25,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Antu'sul - Between 0-25% Health - Say Line 0 (No Repeat) (Normal Dungeon)"),
+(@ENTRY,0,6,0,61,0,100,3,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Antu'sul - On Aggro - Say Line 1 (No Repeat) (Normal Dungeon)"),
+(@ENTRY,0,7,8,2,0,100,3,0,75,0,0,11,11894,0,0,0,0,0,1,0,0,0,0,0,0,0,"Antu'sul - Between 0-75% Health - Cast 'Antu'sul's Minion' (No Repeat) (Normal Dungeon)"),
+(@ENTRY,0,8,0,61,0,100,3,0,75,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Antu'sul - Between 0-75% Health - Say Line 2 (No Repeat) (Normal Dungeon)"),
+(@ENTRY,0,9,0,0,0,100,2,5000,5000,12000,14000,11,16006,0,0,0,0,0,5,0,0,0,0,0,0,0,"Antu'sul - In Combat - Cast 'Chain Lightning' (Normal Dungeon)"),
+(@ENTRY,0,10,0,0,0,100,2,3000,3000,9000,11000,11,15501,0,0,0,0,0,2,0,0,0,0,0,0,0,"Antu'sul - In Combat - Cast 'Earth Shock' (Normal Dungeon)"),
+(@ENTRY,0,11,0,38,0,100,0,1,1,0,0,49,0,0,0,0,0,0,21,100,0,0,0,0,0,0,"Antu'sul - On Data Set 1 1 - Start Attacking");
+
+SET @ENTRY := 8127;
+DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(@ENTRY,0,0, 'The children of Sul will protect their master. Rise once more Sul\'lithuz!',14,0,100,0,0,0, 4178, 0, 'Antu\'sul'),
+(@ENTRY,1,0, 'Lunch has arrived, my beautiful children. Tear them to pieces!',14,0,100,0,0,0, 4166, 0, 'Antu\'sul'),
+(@ENTRY,2,0, 'Rise and defend your master!',14,0,100,0,0,0, 4177, 0, 'Antu\'sul');
diff --git a/sql/updates/world/2015_02_06_05_world.sql b/sql/updates/world/2015_02_06_05_world.sql
new file mode 100644
index 00000000000..bd04efd9c66
--- /dev/null
+++ b/sql/updates/world/2015_02_06_05_world.sql
@@ -0,0 +1,45 @@
+-- Commander Hogarth SAI
+SET @ENTRY := 19937;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,11,0,100,1,0,0,0,0,11,33900,0,0,0,0,0,1,0,0,0,0,0,0,0,"Commander Hogarth - On Respawn - Cast 'Shroud of Death' (No Repeat)"),
+(@ENTRY,0,1,2,20,0,100,0,10258,0,0,0,12,20117,6,0,0,0,0,8,0,0,0,-1186.95,2608.81,27.702,5.38523,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding Knight'"),
+(@ENTRY,0,2,3,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1192.14,2602.7,29.2625,0.0820243,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,3,4,61,0,100,0,10258,0,0,0,12,20117,6,0,0,0,0,8,0,0,0,-1181.95,2611.13,27.3004,4.61566,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding Knight'"),
+(@ENTRY,0,4,5,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1183.65,2603.66,29.4927,6.09219,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,5,6,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1184.48,2609.26,27.7192,5.01103,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,6,7,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1175.39,2607.4,28.853,3.63473,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,7,8,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1178.36,2609.96,27.8814,4.12375,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,8,9,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1182.51,2608.35,28.1201,4.67383,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,9,10,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1189.12,2601.88,29.6988,0.242659,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,10,11,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1179.46,2606.03,29.0216,3.81031,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,11,12,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1180.6,2598.15,35.2317,1.94692,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,12,13,61,0,100,0,10258,0,0,0,12,20117,6,0,0,0,0,8,0,0,0,-1190.87,2607.06,27.9991,5.86898,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding Knight'"),
+(@ENTRY,0,13,14,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1179.81,2603.43,29.8027,3.12637,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,14,15,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1184.47,2606.9,28.4442,5.18881,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,15,16,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1186.63,2605.58,28.7169,5.79079,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,16,17,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1189.03,2604.6,28.8694,6.10697,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,17,18,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1185.68,2603.39,29.4476,5.18881,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'"),
+(@ENTRY,0,18,0,61,0,100,0,10258,0,0,0,12,19863,6,0,0,0,0,8,0,0,0,-1181.97,2605.76,28.9476,4.40683,"Commander Hogarth - On Quest 'Honor the Fallen' Finished - Summon Creature 'Vengeful Unyielding'");
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN (20117, 19863);
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(20117, 0, 0, 0, 0, 0, '33900'),
+(19863, 0, 0, 0, 0, 0, '33900');
+
+-- Vengeful Unyielding Knight SAI
+SET @ENTRY := 20117;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,54,0,100,0,0,0,0,0,41,15000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vengeful Unyielding Knight - On Just Summoned - Despawn In 15000 ms"),
+(@ENTRY,0,1,0,54,0,100,0,0,0,0,0,5,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vengeful Unyielding Knight - On Just Summoned - Play Emote 2");
+
+-- Vengeful Unyielding SAI
+SET @ENTRY := 19863;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,54,0,100,0,0,0,0,0,41,15000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vengeful Unyielding - On Just Summoned - Despawn In 15000 ms"),
+(@ENTRY,0,1,0,54,0,100,0,0,0,0,0,5,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Vengeful Unyielding - On Just Summoned - Play Emote 2");
diff --git a/sql/updates/world/2015_02_06_06_world.sql b/sql/updates/world/2015_02_06_06_world.sql
new file mode 100644
index 00000000000..0d7b75a72cc
--- /dev/null
+++ b/sql/updates/world/2015_02_06_06_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_questender` SET `id` =38017 WHERE `quest` =24880;
diff --git a/sql/updates/world/2015_02_06_07_world.sql b/sql/updates/world/2015_02_06_07_world.sql
new file mode 100644
index 00000000000..ab3eb6ae454
--- /dev/null
+++ b/sql/updates/world/2015_02_06_07_world.sql
@@ -0,0 +1,6 @@
+-- Tiny Snowman SAI
+SET @ENTRY := 15710;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,22,0,100,0,34,0,0,0,5,94,0,0,0,0,0,1,0,0,0,0,0,0,0,"Tiny Snowman - Received Emote 34 - Play Emote 94");
diff --git a/sql/updates/world/2015_02_06_08_world.sql b/sql/updates/world/2015_02_06_08_world.sql
new file mode 100644
index 00000000000..e05c5e15c8e
--- /dev/null
+++ b/sql/updates/world/2015_02_06_08_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid`=20206 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
+(20206, 0, 0, 0, 20, 0, 100, 0, 10919, 0, 0, 0, 53, 0, 20206, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On Quest \'Fei Fei\'s Treat\' Finished - Start Waypoint (Phase 1) (No Repeat)');
diff --git a/sql/updates/world/2015_02_06_09_world.sql b/sql/updates/world/2015_02_06_09_world.sql
new file mode 100644
index 00000000000..94696444dd4
--- /dev/null
+++ b/sql/updates/world/2015_02_06_09_world.sql
@@ -0,0 +1,11 @@
+--
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (4131, 4133);
+DELETE FROM `smart_scripts` WHERE `entryorguid`=4131 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
+(4131, 0, 0, 0, 0, 0, 100, 1, 4000, 7000, 22000, 25000, 11, 6016, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Silithid Invader - IC - Cast Pierce Armor'),
+(4131, 0, 1, 0, 0, 0, 100, 1, 10000, 16000, 0, 0, 11, 8137, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Silithid Invader - IC - Cast Pierce Armor'),
+(4131, 0, 2, 0, 2, 0, 100, 1, 0, 15, 0, 0, 39, 20, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Silithid Invader - on hp below 15 % - call for help');
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=4133 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
+(4133, 0, 2, 0, 2, 0, 100, 1, 0, 15, 0, 0, 39, 20, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Silithid Hive Drone - on hp below 15 % - call for help');
diff --git a/sql/updates/world/2015_02_06_10_world.sql b/sql/updates/world/2015_02_06_10_world.sql
new file mode 100644
index 00000000000..428a0c7e8ca
--- /dev/null
+++ b/sql/updates/world/2015_02_06_10_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE creature_template SET mechanic_immune_mask = mechanic_immune_mask | 0x20 WHERE entry = 31464;
diff --git a/sql/updates/world/2015_02_06_11_world.sql b/sql/updates/world/2015_02_06_11_world.sql
new file mode 100644
index 00000000000..5a385218931
--- /dev/null
+++ b/sql/updates/world/2015_02_06_11_world.sql
@@ -0,0 +1,7 @@
+--
+DELETE FROM `disables` WHERE `entry` IN (649,650) AND `sourceType` = 7;
+DELETE FROM `disables` WHERE `entry` = 650 AND `sourceType` = 2;
+INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES
+(7, 649, 0, '', '', 'Disable mmaps - Trial of the Crusader'),
+(7, 650, 0, '', '', 'Disable mmaps - Trial of the Champion'),
+(2, 650, 3, '', '', 'Disable Trial of the Champion, broken instance');
diff --git a/sql/updates/world/2015_02_06_12_world.sql b/sql/updates/world/2015_02_06_12_world.sql
new file mode 100644
index 00000000000..f6a95a7c010
--- /dev/null
+++ b/sql/updates/world/2015_02_06_12_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `gameobject_template` SET `flags`=32 WHERE `entry` IN (175611,175612,175613,175614);
diff --git a/sql/updates/world/2015_02_06_13_world_335.sql b/sql/updates/world/2015_02_06_13_world_335.sql
new file mode 100644
index 00000000000..8cd8df2147e
--- /dev/null
+++ b/sql/updates/world/2015_02_06_13_world_335.sql
@@ -0,0 +1,372 @@
+UPDATE `locales_item` SET `description_loc6` = '', `description_loc7` = '' WHERE `entry` IN (42469, 42734, 42739, 42740, 42747, 42750, 43357, 43420, 43426, 43429);
+UPDATE `locales_item` SET `description_loc7` = `description_loc6` WHERE `entry` IN (40142, 40143, 40144, 40145, 40146, 40147, 40149, 40150, 40152, 40154, 40155, 40156, 40158, 40159, 40160, 40161, 40163);
+
+CREATE TEMPORARY TABLE `locales_update` (
+ `entry` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `name_loc6` varchar(100) NOT NULL DEFAULT '',
+ `name_loc7` varchar(100) NOT NULL DEFAULT '',
+ `description_loc6` varchar(255) DEFAULT NULL,
+ `description_loc7` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO `locales_update` (`entry`, `name_loc6`, `name_loc7`, `description_loc6`, `description_loc7`) VALUES
+ (40143, 'Ametrino con grabados', 'Ametrino con grabados', 'Encaja en una ranura de color rojo o amarillo.', 'Encaja en una ranura de color rojo o amarillo.'),
+ (40148, 'Ametrino destellante', 'Ametrino destellante', 'Encaja en una ranura de color rojo o amarillo.', 'Encaja en una ranura de color rojo o amarillo.'),
+ (40151, 'Ametrino luminoso', 'Ametrino luminoso', 'Encaja en una ranura de color rojo o amarillo.', 'Encaja en una ranura de color rojo o amarillo.'),
+ (40153, 'Ametrino velado', 'Ametrino velado', 'Encaja en una ranura de color rojo o amarillo.', 'Encaja en una ranura de color rojo o amarillo.'),
+ (40157, 'Ametrino prístino', 'Ametrino prístino', 'Encaja en una ranura de color rojo o amarillo.', 'Encaja en una ranura de color rojo o amarillo.'),
+ (40162, 'Ametrino de precisión', 'Ametrino de precisión', 'Encaja en una ranura de color rojo o amarillo.', 'Encaja en una ranura de color rojo o amarillo.'),
+ (46947, 'Boceto: ametrino luminoso', 'Boceto: ametrino luminoso', 'Te enseña a tallar un ametrino luminoso.', 'Te enseña a tallar un ametrino luminoso.'),
+ (46951, 'Boceto: ametrino velado', 'Boceto: ametrino velado', 'Te enseña a tallar un ametrino velado.', 'Te enseña a tallar un ametrino velado.'),
+ (46953, 'Boceto: ametrino con grabados', 'Boceto: ametrino con grabados', 'Te enseña a tallar un ametrino con grabados.', ' Te enseña a tallar un ametrino con grabados.'),
+ (46956, 'Boceto: ametrino prístino', 'Boceto: ametrino prístino', 'Te enseña a tallar un ametrino prístino.', ' Te enseña a tallar un ametrino prístino.'),
+ (47008, 'Boceto: ametrino destellante', 'Boceto: ametrino destellante', 'Te enseña a tallar un ametrino destellante.', ' Te enseña a tallar un ametrino destellante.'),
+ (47010, 'Boceto: ametrino de precisión', 'Boceto: ametrino de precisión', 'Te enseña a tallar un ametrino de precisión.', ' Te enseña a tallar un ametrino de precisión.'),
+ (46900, 'Boceto: ojo de Zul deslumbrante', 'Boceto: ojo de Zul deslumbrante', 'Te enseña a tallar un ojo de Zul deslumbrante.', 'Te enseña a tallar un ojo de Zul deslumbrante.'),
+ (46902, 'Boceto: ojo de Zul intemporal', 'Boceto: ojo de Zul intemporal', 'Te enseña a tallar un ojo de Zul intemporal.', 'Te enseña a tallar un ojo de Zul intemporal.'),
+ (46903, 'Boceto: ojo de Zul vidente', 'Boceto: ojo de Zul vidente', 'Te enseña a tallar un ojo de Zul vidente.', 'Te enseña a tallar un ojo de Zul vidente.'),
+ (41101,'Glifo de Escudo de vengador','Glifo de Escudo de vengador','',''),
+ (41107,'Glifo de Cólera vengativa','Glifo de Cólera vengativa','',''),
+ (45743,'Glifo de Tormenta divina','Glifo de Tormenta divina','',''),
+ (41105,'Glifo de Destello de Luz','Glifo de Destello de Luz','',''),
+ (41106,'Glifo de Luz Sagrada','Glifo de Luz Sagrada','',''),
+ (41100,'Glifo de Defensa recta','Glifo de Defensa recta','',''),
+ (41094,'Glifo de Sello de orden','Glifo de Sello de orden','',''),
+ (41110,'Glifo de Sello de Luz','Glifo de Sello de Luz','',''),
+ (43868,'Glifo de Sello de rectitud','Glifo de Sello de rectitud','',''),
+ (43869,'Glifo de Sello de venganza','Glifo de Sello de venganza','',''),
+ (41109,'Glifo de Sello de sabiduría','Glifo de Sello de sabiduría','',''),
+ (45744,'Glifo de Escudo de rectitud','Glifo de Escudo de rectitud','',''),
+ (45760,'Glifo de Supresión de dolor','Glifo de Supresión de dolor','',''),
+ (42407,'Glifo de sombra','Glifo de sombra','',''),
+ (42417,'Glifo de Espíritu redentor','Glifo de Espíritu redentor','',''),
+ (42965,'Glifo de Golpe fantasmal','Glifo de Golpe fantasmal','',''),
+ (45761,'Glifo de Hambre de sangre','Glifo de Hambre de sangre','',''),
+ (42971,'Glifo de vigor','Glifo de vigor','',''),
+ (43380,'Glifo de Esfumarse','Glifo de Esfumarse','',''),
+ (48720,'Glifo de Zarpa','Glifo de Zarpa','',''),
+ (40899,'Glifo de Bramido','Glifo de Bramido','',''),
+ (46372,'Glifo de Instintos de supervivencia','Glifo de Instintos de supervivencia','',''),
+ (50125,'Glifo de Rejuvenecimiento rápido','Glifo de Rejuvenecimiento rápido','',''),
+ (40903,'Glifo de Arañazo','Glifo de Arañazo','',''),
+ (45603,'Glifo de Nutrir','Glifo de Nutrir','',''),
+ (43335,'Glifo de lo Salvaje','Glifo de lo Salvaje','',''),
+ (42899,'Glifo de la bestia','Glifo de la bestia','',''),
+ (42901,'Glifo de Aspecto de la víbora','Glifo de Aspecto de la víbora','',''),
+ (45733,'Glifo de Trampa explosiva','Glifo de Trampa explosiva','',''),
+ (42906,'Glifo de Trampa de Escarcha','Glifo de Trampa de Escarcha','',''),
+ (42907,'Glifo de Marca del cazador','Glifo de Marca del cazador','',''),
+ (42909,'Glifo de halcón','Glifo de halcón','',''),
+ (42910,'Glifo de Multidisparo','Glifo de Multidisparo','',''),
+ (42915,'Glifo de Aura de disparo certero','Glifo de Aura de disparo certero','',''),
+ (42916,'Glifo de Salva','Glifo de Salva','',''),
+ (43350,'Glifo de Aliviar mascota','Glifo de Aliviar mascota','',''),
+ (43354,'Glifo de fuerza poseída','Glifo de fuerza poseída','',''),
+ (43355,'Glifo de la manada','Glifo de la manada','',''),
+ (42734,'Glifo de Deflagración Arcana','Glifo de Deflagración Arcana','',''),
+ (50045,'Glifo de Agua eterna','Glifo de Agua eterna','',''),
+ (42740,'Glifo de Explosión de Fuego','Glifo de Explosión de Fuego','',''),
+ (42743,'Glifo de Armadura de hielo','Glifo de Armadura de hielo','',''),
+ (42747,'Glifo de Agostar','Glifo de Agostar','',''),
+ (45737,'Glifo de Bomba viva','Glifo de Bomba viva','',''),
+ (42750,'Glifo de Gema de maná','Glifo de Gema de maná','',''),
+ (42753,'Glifo de Eliminar maldición','Glifo de Eliminar maldición','',''),
+ (42754,'Glifo de Elemental de agua','Glifo de Elemental de agua','',''),
+ (43339,'Glifo de Intelecto Arcano','Glifo de Intelecto Arcano','',''),
+ (43357,'Glifo de Resguardo contra el Fuego','Glifo de Resguardo contra el Fuego','',''),
+ (43359,'Glifo de Armadura de Escarcha','Glifo de Armadura de Escarcha','',''),
+ (43360,'Glifo de Resguardo contra la Escarcha','Glifo de Resguardo contra la Escarcha','',''),
+ (41096,'Glifo de Protección divina','Glifo de Protección divina','',''),
+ (43366,'Glifo de Bendición de sabiduría','Glifo de Bendición de sabiduría','',''),
+ (43368,'Glifo de Captar no-muertos','Glifo de Captar no-muertos','',''),
+ (43369,'Glifo del Sabio','Glifo del Sabio','',''),
+ (45758,'Glifo de Himno de esperanza','Glifo de Himno de esperanza','',''),
+ (42405,'Glifo de Control mental','Glifo de Control mental','',''),
+ (45757,'Glifo de Abrasamiento mental','Glifo de Abrasamiento mental','',''),
+ (41541,'Glifo de Maestría en Agua','Glifo de Maestría en Agua','',''),
+ (45776,'Glifo de Tótem de cólera','Glifo de Tótem de cólera','',''),
+ (41538,'Glifo de Tótem Marea de maná','Glifo de Tótem Marea de maná','',''),
+ (41535,'Glifo de Ola de sanación inferior','Glifo de Ola de sanación inferior','',''),
+ (41524,'Glifo de Lava','Glifo de Lava','',''),
+ (43386,'Glifo de Escudo de agua','Glifo de Escudo de agua','',''),
+ (42456,'Glifo de Maldición de agonía','Glifo de Maldición de agonía','',''),
+ (50077,'Glifo de descomposición presurosa','Glifo de descomposición presurosa','',''),
+ (42466,'Glifo de Dolor abrasador','Glifo de Dolor abrasador','',''),
+ (42469,'Glifo de Succionar vida','Glifo de Succionar vida','',''),
+ (43394,'Glifo de almas','Glifo de almas','',''),
+ (43391,'Glifo de Kilrogg','Glifo de Kilrogg','',''),
+ (43420,'Glifo de insultos barbáricos','Glifo de insultos barbáricos','',''),
+ (43425,'Glifo de Bloqueo','Glifo de Bloqueo','',''),
+ (43412,'Glifo de Sed de sangre','Glifo de Sed de sangre','',''),
+ (45794,'Glifo de Regeneración iracunda','Glifo de Regeneración iracunda','',''),
+ (43416,'Glifo de Ejecutar','Glifo de Ejecutar','',''),
+ (43417,'Glifo de Seccionar','Glifo de Seccionar','',''),
+ (43418,'Glifo de Golpe heroico','Glifo de Golpe heroico','',''),
+ (43426,'Glifo de Última carga','Glifo de Última carga','',''),
+ (43423,'Glifo de Desgarrar','Glifo de Desgarrar','',''),
+ (43429,'Glifo de Provocar','Glifo de Provocar','',''),
+ (45793,'Glifo de Vigilancia','Glifo de Vigilancia','',''),
+ (43432,'Glifo de Torbellino','Glifo de Torbellino','',''),
+ (43398,'Glifo de Falsa arremetida','Glifo de Falsa arremetida','',''),
+ (49084,'Glifo de orden','Glifo de orden','',''),
+ (43397,'Glifo de Cargar','Glifo de Cargar','',''),
+ (43396,'Glifo de Ira rabiosa','Glifo de Ira rabiosa','',''),
+ (40114,'Rubí cárdeno brillante','Rubí cárdeno brillante','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (40117,'Rubí cárdeno fracturado','Rubí cárdeno fracturado','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (40113,'Rubí cárdeno rúnico','Rubí cárdeno rúnico','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (40115,'Rubí cárdeno sutil','Rubí cárdeno sutil','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (32197,'Espinela carmesí brillante','Espinela carmesí brillante','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (32196,'Espinela carmesí rúnica','Espinela carmesí rúnica','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (32198,'Espinela carmesí sutil','Espinela carmesí sutil','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (32195,'Lágrima de espinela carmesí','Lágrima de espinela carmesí','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (39999,'Rubí escarlata brillante','Rubí escarlata brillante','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (40002,'Rubí escarlata fracturado','Rubí escarlata fracturado','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (39998,'Rubí escarlata rúnico','Rubí escarlata rúnico','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (24031,'Rubí vivo brillante','Rubí vivo brillante','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (24030,'Rubí vivo rúnico','Rubí vivo rúnico','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (24032,'Rubí vivo sutil','Rubí vivo sutil','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (24029,'Lágrima de rubí vivo','Lágrima de rubí vivo','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (39907,'Sangrita sutil','Sangrita sutil','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (39906,'Sangrita brillante','Sangrita brillante','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (39909,'Sangrita fracturada','Sangrita fracturada','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (39911,'Sangrita rúnica','Sangrita rúnica','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (23096,'Granate de sangre rúnico','Granate de sangre rúnico','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (28595,'Granate de sangre brillante','Granate de sangre brillante','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (23094,'Lágrima de granate de sangre','Lágrima de granate de sangre','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (40175,'Ojo de Zul deslumbrante','Ojo de Zul deslumbrante','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40167,'Ojo de Zul duradero','Ojo de Zul duradero','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40174,'Ojo de Zul intrincado','Ojo de Zul intrincado','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40165,'Ojo de Zul irregular','Ojo de Zul irregular','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40177,'Ojo de Zul luminiscente','Ojo de Zul luminiscente','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40178,'Ojo de Zul opaco','Ojo de Zul opaco','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40170,'Ojo de Zul vidente','Ojo de Zul vidente','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40172,'Ojo de Zul brillante','Ojo de Zul brillante','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40176,'Ojo de Zul hendido','Ojo de Zul hendido','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40181,'Ojo de Zul tenso','Ojo de Zul tenso','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40164,'Ojo de Zul intemporal','Ojo de Zul intemporal','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40166,'Ojo de Zul vívido','Ojo de Zul vívido','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (32225,'Esmeralda de espuma marina deslumbrante','Esmeralda de espuma marina deslumbrante.','Encaja en una ranura de color amarillo o azul','Encaja en una ranura de color amarillo o azul.'),
+ (32223,'Esmeralda de espuma marina duradera','Esmeralda de espuma marina duradera.','Encaja en una ranura de color amarillo o azul','Encaja en una ranura de color amarillo o azul.'),
+ (32226,'Esmeralda de espuma marina irregular','Esmeralda de espuma marina irregular.','Encaja en una ranura de color amarillo o azul','Encaja en una ranura de color amarillo o azul.'),
+ (40094,'Esmeralda del bosque deslumbrante','Esmeralda del bosque deslumbrante','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40089,'Esmeralda del bosque duradera','Esmeralda del bosque duradera','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40104,'Esmeralda del bosque intrincada','Esmeralda del bosque intrincada','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40100,'Esmeralda del bosque luminiscente','Esmeralda del bosque luminiscente','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40103,'Esmeralda del bosque opaca','Esmeralda del bosque opaca','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40092,'Esmeralda del bosque de vidente','Esmeralda del bosque de vidente','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40099,'Esmeralda del bosque brillante','Esmeralda del bosque brillante','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40096,'Esmeralda del bosque hendida','Esmeralda del bosque hendida','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40101,'Esmeralda del bosque tensa','Esmeralda del bosque tensa','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40085,'Esmeralda del bosque intemporal','Esmeralda del bosque intemporal','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40088,'Esmeralda del bosque vívida','Esmeralda del bosque vívida','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (24065,'Talasita deslumbrante','Talasita deslumbrante','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (24062,'Talasita duradera','Talasita duradera','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (24067,'Talasita irregular','Talasita irregular','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39984,'Jade oscuro deslumbrante','Jade oscuro deslumbrante','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39976,'Jade oscuro duradero','Jade oscuro duradero','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39983,'Jade oscuro intrincado','Jade oscuro intrincado','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39986,'Jade oscuro luminiscente','Jade oscuro luminiscente','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39988,'Jade oscuro opaco','Jade oscuro opaco','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39979,'Jade oscuro vidente','Jade oscuro vidente','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39981,'Jade oscuro brillante','Jade oscuro brillante','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39985,'Jade oscuro hendido','Jade oscuro hendido','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39991,'Jade oscuro tenso','Jade oscuro tenso','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39968,'Jade oscuro intemporal','Jade oscuro intemporal','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (39975,'Jade oscuro vívido','Jade oscuro vívido','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (23106,'Peridoto intenso deslumbrante','Peridoto intenso deslumbrante','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (23105,'Peridoto intenso duradero','Peridoto intenso duradero','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (23104,'Peridoto intenso irregular','Peridoto intenso irregular','Encaja en una ranura de color amarillo o azul.','Encaja en una ranura de color amarillo o azul.'),
+ (40154,'Ametrino durable','Ametrino durable','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40158,'Ametrino potenciado','Ametrino potenciado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40161,'Ametrino de luz trémula','Ametrino de luz trémula','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40149,'Ametrino iluminado','Ametrino iluminado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40145,'Ametrino resplandeciente','Ametrino resplandeciente','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40159,'Ametrino diestro','Ametrino diestro','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40156,'Ametrino maligno','Ametrino maligno','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (32220,'Piropiedra destelleante','Piropiedra destelleante','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (32219,'Piropiedra luminosa','Piropiedra luminosa','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo'),
+ (32221,'Piropiedra velada','Piropiedra velada','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (32222,'Piropiedra maligna','Piropiedra maligna','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40058,'Topacio monarca de precisión','Topacio monarca de precisión','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40046,'Topacio monarca diestro','Topacio monarca diestro','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40050,'Topacio monarca durable','Topacio monarca durable','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40054,'Topacio monarca potenciado','Topacio monarca potenciado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40038,'Topacio monarca grabado','Topacio monarca grabado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40057,'Topacio monarca de luz trémula','Topacio monarca de luz trémula','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40044,'Topacio monarca destellante','Topacio monarca destellante','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40045,'Topacio monarca iluminado','Topacio monarca iluminado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40047,'Topacio monarca luminoso','Topacio monarca luminoso','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40053,'Topacio monarca prístino','Topacio monarca prístino','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40055,'Topacio monarca completo','Topacio monarca completo','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40049,'Topacio monarca velado','Topacio monarca velado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40052,'Topacio monarca maligno','Topacio monarca maligno','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (24061,'Topacio noble destellante','Topacio noble destellante','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (24060,'Topacio noble temerario','Topacio noble temerario','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (31867,'Topacio noble velado','Topacio noble velado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (31868,'Topacio noble maligno','Topacio noble maligno','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39965,'Citrino enorme de luz trémula','Citrino enorme de luz trémula','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39966,'Citrino enorme de precisión','Citrino enorme de precisión','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39958,'Citrino enorme durable','Citrino enorme durable','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39962,'Citrino enorme potenciado','Citrino enorme potenciado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39948,'Citrino enorme grabado','Citrino enorme grabado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39953,'Citrino enorme destellante','Citrino enorme destellante','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39954,'Citrino enorme iluminado','Citrino enorme iluminado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39946,'Citrino enorme luminoso','Citrino enorme luminoso','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39961,'Citrino enorme prístino','Citrino enorme prístino','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39963,'Citrino enorme completo','Citrino enorme completo','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39957,'Citrino enorme velado','Citrino enorme velado','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (39960,'Citrino enorme maligno','Citrino enorme maligno','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (31866,'Espesartita de llamas velada','Espesartita de llamas velada','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (31869,'Espesartita de llamas maligna','Espesartita de llamas maligna','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (23100,'Espesartita de llamas destellante','Espesartita de llamas destellante','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (23099,'Espesartita de llamas luminosa','Espesartita de llamas luminosa','Encaja en una ranura de color rojo o amarillo.','Encaja en una ranura de color rojo o amarillo.'),
+ (40136,'Piedra de terror equilibrada','Piedra de terror equilibrada','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40132,'Piedra de terror resplandeciente','Piedra de terror resplandeciente','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40137,'Piedra de terror imbuida','Piedra de terror imbuida','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40138,'Piedra de terror regia','Piedra de terror regia','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40134,'Piedra de terror real','Piedra de terror real','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40131,'Piedra de terror de tenuidad','Piedra de terror de tenuidad','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (32213,'Amatista Cantosombrío equilibrada','Amatista Cantosombrío equilibrada','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (32215,'Amatista Cantosombrío resplandeciente','Amatista Cantosombrío resplandeciente','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (32214,'Amatista Cantosombrío imbuida','Amatista Cantosombrío imbuida','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (32216,'Amatista Cantosombrío real','Amatista Cantosombrío real','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40029,'Ópalo crepuscular equilibrado','Ópalo crepuscular equilibrado','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40025,'Ópalo crepuscular resplandeciente','Ópalo crepuscular resplandeciente','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40030,'Ópalo crepuscular imbuido','Ópalo crepuscular imbuido','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40033,'Ópalo crepuscular enjundioso','Ópalo crepuscular enjundioso','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40031,'Ópalo crepuscular regio','Ópalo crepuscular regio','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40027,'Ópalo crepuscular real','Ópalo crepuscular real','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (40024,'Ópalo crepuscular de tenuidad','Ópalo crepuscular de tenuidad','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (31863,'Ojo de noche equilibrado','Ojo de noche equilibrado','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (24056,'Ojo de noche resplandeciente','Ojo de noche resplandeciente','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (31865,'Ojo de noche imbuido','Ojo de noche imbuido','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (35707,'Ojo de noche regio','Ojo de noche regio','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (24057,'Ojo de noche real','Ojo de noche real','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (39938,'Cristal de Sombras regio','Cristal de Sombras regio','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (39937,'Cristal de Sombras equilibrado','Cristal de Sombras equilibrado','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (39936,'Cristal de Sombras resplandeciente','Cristal de Sombras resplandeciente','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (39944,'Cristal de Sombras imbuido','Cristal de Sombras imbuido','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (39933,'Cristal de Sombras enjudioso','Cristal de Sombras enjudioso','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (39943,'Cristal de Sombras real','Cristal de Sombras real','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (39942,'Cristal de Sombras de tenuidad','Cristal de Sombras de tenuidad','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (31862,'Draenita de Sombras equilibrada','Draenita de Sombras equilibrada','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (31864,'Draenita de Sombras imbuida','Draenita de Sombras imbuida','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (23109,'Draenita de Sombras real','Draenita de Sombras real','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (23108,'Draenita de Sombras resplandeciente','Draenita de Sombras resplandeciente','Encaja en una ranura de color rojo o azul.','Encaja en una ranura de color rojo o azul.'),
+ (42701,'Perla encantada','Perla encantada','Encaja en una ranura de color rojo, amarillo o azul. Solo puedes encajar una en tu equipo.','Encaja en una ranura de color rojo, amarillo o azul. Solo puedes encajar una en tu equipo.'),
+ (36766,'Ojo de dragón brillante','Ojo de dragón brillante','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (42153,'Ojo de dragón fracturado','Ojo de dragón fracturado','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (42146,'Ojo de dragón lustroso','Ojo de dragón lustroso','Encaja en una ranura de color azul.','Encaja en una ranura de color azul.'),
+ (42144,'Ojo de dragón rúnico','Ojo de dragón rúnico','Encaja en una ranura de color rojo.','Encaja en una ranura de color rojo.'),
+ (42157,'Ojo de dragón grueso','Ojo de dragón grueso','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (41377,'Diamante de llama celeste refulgente','Diamante de llama celeste refulgente','Solo encaja en una ranura de gema meta.','Solo encaja en una ranura de gema meta.'),
+ (32202,'Zafiro empíreo luciente','Zafiro empíreo luciente','Encaja en una ranura de color azul.','Encaja en una ranura de color azul.'),
+ (32200,'Zafiro empíreo sólido','Zafiro empíreo sólido','Encaja en una ranura de color azul.','Encaja en una ranura de color azul.'),
+ (40123,'Ámbar del rey luminoso','Ámbar del rey luminoso','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (39349,'Vitela de arma','Vitela de arma','Se puede marcar como el objetivo de varios encantamientos de armas para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos sin restricciones de nivel.','Se puede marcar como el objetivo de varios encantamientos de armas para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos sin restricciones de nivel.'),
+ (39350,'Vitela de arma II','Vitela de arma II','Se puede marcar como el objetivo de varios encantamientos de armas para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos con restricciones de nivel 35 o inferior.','Se puede marcar como el objetivo de varios encantamientos de armas para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos con restricciones de nivel 35 o inferior.'),
+ (43146,'Vitela de arma III','Vitela de arma III','Se puede marcar como el objetivo de varios encantamientos de armas para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos con restricciones de nivel 60 o inferior.','Se puede marcar como el objetivo de varios encantamientos de armas para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos con restricciones de nivel 60 o inferior.'),
+ (38682,'Vitela de armadura','Vitela de armadura','Se puede marcar como el objetivo de varios encantamientos de armadura para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos sin restricciones de nivel.','Se puede marcar como el objetivo de varios encantamientos de armadura para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos sin restricciones de nivel.'),
+ (37602,'Vitela de armadura II','Vitela de armadura II','Se puede marcar como el objetivo de varios encantamientos de armadura para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos con restricciones de nivel 35 o inferior.','Se puede marcar como el objetivo de varios encantamientos de armadura para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos con restricciones de nivel 35 o inferior.'),
+ (43145,'Vitela de armadura III','Vitela de armadura III','Se puede marcar como el objetivo de varios encantamientos de armadura para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos con restricciones de nivel 60 o inferior.','Se puede marcar como el objetivo de varios encantamientos de armadura para almacenar el encantamiento y usarlo más tarde. Solo puede absorber encantamientos con restricciones de nivel 60 o inferior.'),
+ (40121,'Circón majestuoso luciente','Circón majestuoso luciente','Encaja en una ranura de color azul.','Encaja en una ranura de color azul.'),
+ (40010,'Zafiro celestial luciente','Zafiro celestial luciente','Encaja en una ranura de color azul.','Encaja en una ranura de color azul.'),
+ (24037,'Estrella de Eluna luciente','Estrella de Eluna luciente','Encaja en una ranura de color azul.','Encaja en una ranura de color azul.'),
+ (39927,'Calcedonia lustrosa','Calcedonia lustrosa','Encaja en una ranura de color azul.','Encaja en una ranura de color azul.'),
+ (39920,'Calcedonia brillante','Calcedonia brillante','Encaja en una ranura de color azul.','Encaja en una ranura de color azul.'),
+ (23121,'Piedra lunar azur luciente','Piedra lunar azur luciente','Encaja en una ranura de color azul.','Encaja en una ranura de color azul.'),
+ (40125,'Ámbar del rey rígido','Ámbar del rey rígido','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (40126,'Ámbar del rey grueso','Ámbar del rey grueso','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (32204,'Ojo de león luminoso','Ojo de león luminoso','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (32207,'Ojo de león reluciente','Ojo de león reluciente','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (32210,'Gran ojo de león','Gran ojo de león','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (32206,'Ojo de león rígido','Ojo de león rígido','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (32208,'Ojo de león grueso','Ojo de león grueso','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (40012,'Brillo de otoño luminoso','Brillo de otoño luminoso','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (40014,'Brillo de otoño rígido','Brillo de otoño rígido','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (40015,'Brillo de otoño grueso','Brillo de otoño grueso','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (24047,'Piedra del alba luminosa','Piedra del alba luminosa','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (24050,'Piedra del alba reluciente','Piedra del alba reluciente','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (31861,'Gran piedra del alba ','Gran piedra del alba ','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (24051,'Piedra del alba rígida','Piedra del alba rígida','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (24052,'Piedra del alba gruesa','Piedra del alba gruesa','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (39912,'Cristal de sol luminoso','Cristal de sol luminoso','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (39915,'Cristal de sol rígido','Cristal de sol rígido','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (39916,'Cristal de sol grueso','Cristal de sol grueso','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (31860,'Gran draenita dorada','Gran draenita dorada','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (23116,'Draenita dorada rígida','Draenita dorada rígida','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (23115,'Draenita dorada gruesa','Draenita dorada gruesa','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (23114,'Draenita dorada reluciente','Draenita dorada reluciente','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.'),
+ (23113,'Draenita dorada luminosa','Draenita dorada luminosa','Encaja en una ranura de color amarillo.','Encaja en una ranura de color amarillo.');
+
+INSERT INTO `locales_update` (`entry`, `name_loc6`, `name_loc7`, `description_loc6`) VALUES
+ (41580,'Boceto: brillo de otoño rígido','Boceto: brillo de otoño rígido','Te enseña a tallar un brillo de otoño rígido.'),
+ (41581,'Boceto: zafiro celestial luciente','Boceto: zafiro celestial luciente','Te enseña a tallar un zafiro celestial luciente.'),
+ (41582,'Boceto: topacio monarca destellante','Boceto: topacio monarca destellante','Te enseña a tallar un topacio monarca destellante.'),
+ (41687,'Boceto: topacio monarca completo','Boceto: topacio monarca completo','Te enseña a tallar un topacio monarca completo.'),
+ (41688,'Boceto: topacio monarca velado','Boceto: topacio monarca velado','Te enseña a tallar un topacio monarca velado.'),
+ (41689,'Boceto: topacio monarca luminoso','Boceto: topacio monarca luminoso','Te enseña a tallar un topacio monarca luminoso.'),
+ (41696,'Boceto: esmeralda del bosque luminiscente','Boceto: esmeralda del bosque luminiscente','Te enseña a tallar una esmeralda del bosque luminiscente.'),
+ (41694,'Boceto: esmeralda del bosque intrincada','Boceto: esmeralda del bosque intrincada','Te enseña a tallar una esmeralda del bosque intrincada.'),
+ (40140,'Piedra de terror enjundiosa','Piedra de terror enjundiosa','Encaja en una ranura de color rojo o azul.'),
+ (41697,'Boceto: esmeralda del bosque duradera','Boceto: esmeralda del bosque duradera','Te enseña a tallar una esmeralda del bosque duradera.'),
+ (41699,'Boceto: esmeralda del bosque de vidente','Boceto: esmeralda del bosque de vidente','Te enseña a tallar una esmeralda del bosque de vidente.'),
+ (41701,'Boceto: ópalo crepuscular real','Boceto: ópalo crepuscular real','Te enseña a tallar un ópalo crepuscular real.'),
+ (41702,'Boceto: ópalo crepuscular enjundioso','Boceto: ópalo crepuscular enjundioso','Te enseña a tallar un ópalo crepuscular enjundioso.'),
+ (41703,'Boceto: ópalo crepuscular regio','Boceto: ópalo crepuscular regio','Te enseña a tallar un ópalo crepuscular regio.'),
+ (41705,'Boceto: diamante de llama celeste refulgente','Boceto: diamante de llama celeste refulgente','Te enseña a tallar un diamante de llama celeste refulgente.'),
+ (42299,'Boceto: ojo de dragón brillante','Boceto: ojo de dragón brillante','Te enseña a tallar un ojo de dragón brillante.'),
+ (42303,'Boceto: ojo de dragón fracturado','Boceto: ojo de dragón fracturado','Te enseña a tallar un ojo de dragón fracturado.'),
+ (42304,'Boceto: ojo de dragón lustroso','Boceto: ojo de dragón lustroso','Te enseña a tallar un ojo de dragón lustroso.'),
+ (42309,'Boceto: ojo de dragón rúnico','Boceto: ojo de dragón rúnico','Te enseña a tallar un ojo de dragón rúnico.'),
+ (42315,'Boceto: ojo de dragón grueso','Boceto: ojo de dragón grueso','Te enseña a tallar un ojo de dragón grueso.'),
+ (46934,'Boceto: piedra de terror equilibrada','Boceto: piedra de terror equilibrada','Te enseña a tallar una piedra de terror equilibrada.'),
+ (46952,'Boceto: ametrino durable','Boceto: ametrino durable','Te enseña a tallar un ametrino durable.'),
+ (47016,'Boceto: ametrino potenciado','Boceto: ametrino potenciado','Te enseña a tallar un ametrino potenciado.'),
+ (46921,'Boceto: rubí cárdeno fracturado','Boceto: rubí cárdeno fracturado','Te enseña a tallar un rubí cárdeno fracturado.'),
+ (47012,'Boceto: ametrino de luz trémula','Boceto: ametrino de luz trémula','Te enseña a tallar un ametrino de luz trémula.'),
+ (46945,'Boceto: piedra de terror imbuida','Boceto: piedra de terror imbuida','Te enseña a tallar una piedra de terror imbuida.'),
+ (46901,'Boceto: ojo de Zul irregular','Boceto: ojo de Zul irregular','Te enseña a tallar un ojo de Zul irregular.'),
+ (46909,'Boceto: ojo de Zul luminiscente','Boceto: ojo de Zul luminiscente','Te enseña a tallar un ojo de Zul luminiscente.'),
+ (47021,'Boceto: ametrino iluminado','Boceto: ametrino iluminado','Te enseña a tallar un ametrino iluminado.'),
+ (46927,'Boceto: circón majestuoso luciente','Boceto: circón majestuoso luciente','Te enseña a tallar un circón majestuoso luciente.'),
+ (49112,'Boceto: Lágrima de pesadilla','Boceto: Lágrima de pesadilla','Te enseña a tallar una Lágrima de pesadilla.'),
+ (46914,'Boceto: ojo de Zul opaco','Boceto: ojo de Zul opaco','Te enseña a tallar un ojo de Zul opaco.'),
+ (46944,'Boceto: piedra de terror enjundiosa','Boceto: piedra de terror enjundiosa','Te enseña a tallar una piedra de terror enjundiosa.'),
+ (46940,'Boceto: piedra de terror regia','Boceto: piedra de terror regia','Te enseña a tallar una piedra de terror regia.'),
+ (47018,'Boceto: ametrino resplandeciente','Boceto: ametrino resplandeciente','Te enseña a tallar un ametrino resplandeciente.'),
+ (46928,'Boceto: ámbar del rey rígido','Boceto: ámbar del rey rígido','Te enseña a tallar un ámbar del rey rígido.'),
+ (46939,'Boceto: piedra de terror real','Boceto: piedra de terror real','Te enseña a tallar una piedra de terror real.'),
+ (46916,'Boceto: rubí cárdeno rúnico','Boceto: rubí cárdeno rúnico','Te enseña a tallar un rubí cárdeno rúnico.'),
+ (46907,'Boceto: ojo de Zul brillante','Boceto: ojo de Zul brillante','Te enseña a tallar un ojo de Zul brillante.'),
+ (46922,'Boceto: rubí cárdeno sutil','Boceto: rubí cárdeno sutil','Te enseña a tallar un rubí cárdeno sutil.'),
+ (46906,'Boceto: ojo de Zul hendido','Boceto: ojo de Zul hendido','Te enseña a tallar un ojo de Zul hendido.'),
+ (46908,'Boceto: ojo de Zul tenso','Boceto: ojo de Zul tenso','Te enseña a tallar un ojo de Zul tenso.'),
+ (46946,'Boceto: piedra de terror de tenuidad','Boceto: piedra de terror de tenuidad','Te enseña a tallar una piedra de terror de tenuidad.'),
+ (46931,'Boceto: ámbar del rey grueso','Boceto: ámbar del rey grueso','Te enseña a tallar un ámbar del rey grueso.'),
+ (46899,'Boceto: ojo de Zul vívido','Boceto: ojo de Zul vívido','Te enseña a tallar un ojo de Zul vívido.'),
+ (47011,'Boceto: ametrino maligno','Boceto: ametrino maligno','Te enseña a tallar un ametrino maligno.'),
+ (52023,'Diseño: Flecha de hoja de hielo','Diseño: Flecha de hoja de hielo','Te enseña a hacer flechas de hoja de hielo.'),
+ (52022,'Diseño: Balas destrozadoras','Diseño: Balas destrozadoras','Te enseña a hacer balas destrozadoras.'),
+ (50166,'Técnica: Glifo de Agua eterna','Técnica: Glifo de Agua eterna','Te enseña a inscribir un Glifo de Agua eterna.'),
+ (50168,'Técnica: Glifo de descomposición presurosa','Técnica: Glifo de descomposición presurosa','Te enseña a inscribir un Glifo de descomposición presurosa.'),
+ (50167,'Técnica: Glifo de Rejuvenecimiento rápido','Técnica: Glifo de Rejuvenecimiento rápido','Te enseña a inscribir un Glifo de Rejuvenecimiento rápido.'),
+ (43826,'Glifo de Golpe sangriento','Glifo de Golpe sangriento',''),
+ (43538,'Glifo de Orden oscura','Glifo de Orden oscura',''),
+ (45804,'Glifo de muerte oscura','Glifo de muerte oscura',''),
+ (45805,'Glifo de enfermedad','Glifo de enfermedad',''),
+ (43545,'Glifo de Entereza ligada al hielo','Glifo de Entereza ligada al hielo',''),
+ (43548,'Glifo de Golpe de peste','Glifo de Golpe de peste',''),
+ (43549,'Glifo del necrófago','Glifo del necrófago',''),
+ (43553,'Glifo de Armadura inquebrantable','Glifo de Armadura inquebrantable',''),
+ (45803,'Glifo de Añublo profano','Glifo de Añublo profano',''),
+ (43671,'Glifo de Deflagración de cadáver','Glifo de Deflagración de cadáver',''),
+ (43672,'Glifo de Pestilencia','Glifo de Pestilencia',''),
+ (43673,'Glifo de Levantar a muerto','Glifo de Levantar a muerto','');
+
+UPDATE `locales_item`, `locales_update` SET `locales_item`.`name_loc6` = `locales_update`.`name_loc6`, `locales_item`.`name_loc7` = `locales_update`.`name_loc7`, `locales_item`.`description_loc6` = `locales_update`.`description_loc6`, `locales_item`.`description_loc7` = `locales_update`.`description_loc7`
+ WHERE `locales_item`.`entry` = `locales_update`.`entry`;
+
+DROP TABLE `locales_update`;
+UPDATE `locales_item` SET `description_loc7` = `description_loc6` WHERE `entry` IN (41580,41581,41582,41687,41688,41689,41696,41694,41697,41699,41701,41702,41703,41705,42299,42303,42304,42309,42315,46934,46952,47016,46921,47012,46945,46901,46909,47021,46927,49112,46914,46944,46940,47018,46928,46939,46916,46907,46922,46906,46908,46946,46931,46899,47011,52023,52022,50166,50168,50167,43826,43538,45804,45805,43545,43548,43549,43553,45803,43671,43672,43673);
diff --git a/sql/updates/world/2015_02_07_00_world.sql b/sql/updates/world/2015_02_07_00_world.sql
new file mode 100644
index 00000000000..c0616f833ea
--- /dev/null
+++ b/sql/updates/world/2015_02_07_00_world.sql
@@ -0,0 +1,14 @@
+-- A Friendly Chat... (24576, 24657)
+-- Snivel Rustrocket set gossip flag
+UPDATE `creature_template` SET `npcflag` = 1, `AIName`='SmartAI' WHERE `entry` = 37715;
+
+-- Quest credit SAI
+DELETE FROM `smart_scripts` WHERE (`entryorguid`=37715 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
+(37715,0,0,0,62,0,100,0,10946,0,0,0,11,70646,2,0,0,0,0,7,0,0,0,0,0,0,0, "Snivel Rustrocket - on gosip 10947 - cast Love - Create Snivel's Ledger");
+
+-- Gossip option conditions
+DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=15 AND `SourceGroup`=10929);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,10929,0,0,9,24576,0,0,0,'','Show gossip only if plaer have A Friendly Chat... Horde quest'),
+(15,10929,0,1,9,24657,0,0,0,'','Show gossip only if plaer have A Friendly Chat... Alliance quest');
diff --git a/sql/updates/world/2015_02_07_01_world.sql b/sql/updates/world/2015_02_07_01_world.sql
new file mode 100644
index 00000000000..742d833352e
--- /dev/null
+++ b/sql/updates/world/2015_02_07_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `flags_extra`=0 WHERE `entry`=24938;
diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp
index 06540ecdc61..ee978211577 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -391,6 +391,18 @@ namespace VMAP
}
}
+ if (bounds.isEmpty())
+ {
+ std::cout << "\nModel " << std::string(buff, name_length) << " has empty bounding box" << std::endl;
+ continue;
+ }
+
+ if (!bounds.isFinite())
+ {
+ std::cout << "\nModel " << std::string(buff, name_length) << " has invalid bounding box" << std::endl;
+ continue;
+ }
+
fwrite(&displayId, sizeof(uint32), 1, model_list_copy);
fwrite(&name_length, sizeof(uint32), 1, model_list_copy);
fwrite(&buff, sizeof(char), name_length, model_list_copy);
diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp
index 993c298941c..05bd5d360c6 100644
--- a/src/server/collision/Models/GameObjectModel.cpp
+++ b/src/server/collision/Models/GameObjectModel.cpp
@@ -78,6 +78,12 @@ void LoadGameObjectModelList()
break;
}
+ if (v1.isNaN() || v2.isNaN())
+ {
+ VMAP_ERROR_LOG("misc", "File '%s' Model '%s' has invalid v1%s v2%s values!", VMAP::GAMEOBJECT_MODELS, std::string(buff, name_length).c_str(), v1.toString().c_str(), v2.toString().c_str());
+ continue;
+ }
+
model_list.insert
(
ModelList::value_type( displayId, GameobjectModelData(std::string(buff, name_length), AABox(v1, v2)) )
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
index 9c616e49457..a04e4091778 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
@@ -203,7 +203,7 @@ void AuctionBotConfig::GetConfigFromFile()
SetConfig(CONFIG_AHBOT_MINTIME, "AuctionHouseBot.MinTime", 1);
SetConfig(CONFIG_AHBOT_MAXTIME, "AuctionHouseBot.MaxTime", 72);
-
+
SetConfigMinMax(CONFIG_AHBOT_BUYER_RECHECK_INTERVAL, "AuctionHouseBot.Buyer.Recheck.Interval", 20, 1, DAY / MINUTE);
SetConfig(CONFIG_AHBOT_BUYER_BASEPRICE_GRAY, "AuctionHouseBot.Buyer.Baseprice.Gray", 3504);
SetConfig(CONFIG_AHBOT_BUYER_BASEPRICE_WHITE, "AuctionHouseBot.Buyer.Baseprice.White", 5429);
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
index 1c336640dcc..bd5defe2bc3 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
@@ -50,7 +50,7 @@ bool AuctionBotBuyer::Initialize()
// load Check interval
_checkInterval = sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BUYER_RECHECK_INTERVAL) * MINUTE;
- TC_LOG_DEBUG("ahbot", "AHBot buyer interval is %u minutes", _checkInterval);
+ TC_LOG_DEBUG("ahbot", "AHBot buyer interval is %u minutes", _checkInterval / MINUTE);
return true;
}
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
index dff4077d569..733bd5e9ec8 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
@@ -44,14 +44,14 @@ bool AuctionBotSeller::Initialize()
{
std::stringstream includeStream(sAuctionBotConfig->GetAHBotIncludes());
std::string temp;
- while (getline(includeStream, temp, ','))
+ while (std::getline(includeStream, temp, ','))
includeItems.push_back(atoi(temp.c_str()));
}
{
std::stringstream excludeStream(sAuctionBotConfig->GetAHBotExcludes());
std::string temp;
- while (getline(excludeStream, temp, ','))
+ while (std::getline(excludeStream, temp, ','))
excludeItems.push_back(atoi(temp.c_str()));
}
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 37d102cc77b..a44ca68f79b 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1407,9 +1407,29 @@ bool Creature::CanStartAttack(Unit const* who, bool force) const
if (!CanCreatureAttack(who, force))
return false;
+ // No aggro from gray creatures
+ if (CheckNoGrayAggroConfig(who->getLevelForTarget(this), getLevelForTarget(who)))
+ return false;
+
return IsWithinLOSInMap(who);
}
+
+bool Creature::CheckNoGrayAggroConfig(uint32 playerLevel, uint32 creatureLevel) const
+{
+ if (Trinity::XP::GetColorCode(playerLevel, creatureLevel) != XP_GRAY)
+ return false;
+
+ uint32 notAbove = sWorld->getIntConfig(CONFIG_NO_GRAY_AGGRO_ABOVE);
+ uint32 notBelow = sWorld->getIntConfig(CONFIG_NO_GRAY_AGGRO_BELOW);
+ if (notAbove == 0 && notBelow == 0)
+ return false;
+
+ if (playerLevel <= notBelow || (playerLevel >= notAbove && notAbove > 0))
+ return true;
+ return false;
+}
+
float Creature::GetAttackDistance(Unit const* player) const
{
float aggroRate = sWorld->getRate(RATE_CREATURE_AGGRO);
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 18f574d0304..ec06bf90595 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -731,6 +731,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
private:
void ForcedDespawn(uint32 timeMSToDespawn = 0);
+ bool CheckNoGrayAggroConfig(uint32 playerLevel, uint32 creatureLevel) const; // No aggro from gray creatures
//WaypointMovementGenerator vars
uint32 m_waypointID;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 161fca432b4..63580b355a4 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -19086,7 +19086,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
else if (mapDiff->hasErrorMessage) // if (missingAchievement) covered by this case
SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty);
else if (missingItem)
- GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, sObjectMgr->GetItemTemplate(missingItem)->Name1.c_str());
+ GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, ASSERT_NOTNULL(sObjectMgr->GetItemTemplate(missingItem))->Name1.c_str());
else if (LevelMin)
GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED), LevelMin);
}
@@ -25047,6 +25047,7 @@ void Player::_LoadSkills(PreparedQueryResult result)
// SetPQuery(PLAYER_LOGIN_QUERY_LOADSKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = '%u'", GUID_LOPART(m_guid));
uint32 count = 0;
+ std::unordered_map<uint32, uint32> loadedSkillValues;
if (result)
{
do
@@ -25114,8 +25115,7 @@ void Player::_LoadSkills(PreparedQueryResult result)
SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(count), 0);
mSkillStatus.insert(SkillStatusMap::value_type(skill, SkillStatusData(count, SKILL_UNCHANGED)));
-
- LearnSkillRewardedSpells(skill, value);
+ loadedSkillValues[skill] = value;
++count;
@@ -25128,6 +25128,10 @@ void Player::_LoadSkills(PreparedQueryResult result)
while (result->NextRow());
}
+ // Learn skill rewarded spells after all skills have been loaded to prevent learning a skill from them before its loaded with proper value from DB
+ for (auto& skill : loadedSkillValues)
+ LearnSkillRewardedSpells(skill.first, skill.second);
+
for (; count < PLAYER_MAX_SKILLS; ++count)
{
SetUInt32Value(PLAYER_SKILL_INDEX(count), 0);
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index d07ec212d0c..f0d7d039dd5 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -7078,6 +7078,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
continue;
}
+ bool invalidSpilloverFaction = false;
for (uint32 i = 0; i < MAX_SPILLOVER_FACTIONS; ++i)
{
if (repTemplate.faction[i])
@@ -7087,47 +7088,28 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
if (!factionSpillover)
{
TC_LOG_ERROR("sql.sql", "Spillover faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template` for faction %u, skipping", repTemplate.faction[i], factionId);
- continue;
+ invalidSpilloverFaction = true;
+ break;
}
if (factionSpillover->reputationListID < 0)
{
TC_LOG_ERROR("sql.sql", "Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId);
- continue;
+ invalidSpilloverFaction = true;
+ break;
}
if (repTemplate.faction_rank[i] >= MAX_REPUTATION_RANK)
{
TC_LOG_ERROR("sql.sql", "Rank %u used in `reputation_spillover_template` for spillover faction %u is not valid, skipping", repTemplate.faction_rank[i], repTemplate.faction[i]);
- continue;
+ invalidSpilloverFaction = true;
+ break;
}
}
}
- FactionEntry const* factionEntry0 = sFactionStore.LookupEntry(repTemplate.faction[0]);
- if (repTemplate.faction[0] && !factionEntry0)
- {
- TC_LOG_ERROR("sql.sql", "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[0]);
+ if (invalidSpilloverFaction)
continue;
- }
- FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(repTemplate.faction[1]);
- if (repTemplate.faction[1] && !factionEntry1)
- {
- TC_LOG_ERROR("sql.sql", "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[1]);
- continue;
- }
- FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(repTemplate.faction[2]);
- if (repTemplate.faction[2] && !factionEntry2)
- {
- TC_LOG_ERROR("sql.sql", "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[2]);
- continue;
- }
- FactionEntry const* factionEntry3 = sFactionStore.LookupEntry(repTemplate.faction[3]);
- if (repTemplate.faction[3] && !factionEntry3)
- {
- TC_LOG_ERROR("sql.sql", "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]);
- continue;
- }
_repSpilloverTemplateStore[factionId] = repTemplate;
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index d9124551c63..5664cbb6e4b 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1808,7 +1808,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
return ERR_BATTLEGROUND_NONE; // ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY handled on client side
// get a player as reference, to compare other players' stats to (arena team id, queue id based on level, etc.)
- Player* reference = GetFirstMember()->GetSource();
+ Player* reference = ASSERT_NOTNULL(GetFirstMember())->GetSource();
// no reference found, can't join this way
if (!reference)
return ERR_BATTLEGROUND_JOIN_FAILED;
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index d6d7e3b9876..b6157d6eb94 100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -458,6 +458,12 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
if (!_player->IsInSameRaidWith(originalPlayer))
return;
+ if (!originalPlayer->CanShareQuest(questId))
+ return;
+
+ if (!_player->CanTakeQuest(quest, true))
+ return;
+
if (_player->CanAddQuest(quest, true))
_player->AddQuestAndCheckCompletion(quest, NULL); // NULL, this prevent DB script from duplicate running
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 0775a9a299a..685bcd338a9 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -427,7 +427,7 @@ enum SpellAttr4
SPELL_ATTR4_UNK4 = 0x00000010, // 4 This will no longer cause guards to attack on use??
SPELL_ATTR4_UNK5 = 0x00000020, // 5
SPELL_ATTR4_NOT_STEALABLE = 0x00000040, // 6 although such auras might be dispellable, they cannot be stolen
- SPELL_ATTR4_TRIGGERED = 0x00000080, // 7 spells forced to be triggered
+ SPELL_ATTR4_CAN_CAST_WHILE_CASTING = 0x00000080, // 7 Can be cast while another cast is in progress - see CanCastWhileCasting(SpellRec const*,CGUnit_C *,int &)
SPELL_ATTR4_FIXED_DAMAGE = 0x00000100, // 8 Ignores resilience and any (except mechanic related) damage or % damage taken auras on target.
SPELL_ATTR4_TRIGGER_ACTIVATE = 0x00000200, // 9 initially disabled / trigger activate from event (Execute, Riposte, Deep Freeze end other)
SPELL_ATTR4_SPELL_VS_EXTEND_COST = 0x00000400, // 10 Rogue Shiv have this flag
diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp
index ad71381a1de..b99cb677ba0 100644
--- a/src/server/game/Reputation/ReputationMgr.cpp
+++ b/src/server/game/Reputation/ReputationMgr.cpp
@@ -297,7 +297,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
{
// bonuses are already given, so just modify standing by rate
int32 spilloverRep = int32(standing * repTemplate->faction_rate[i]);
- SetOneFactionReputation(sFactionStore.LookupEntry(repTemplate->faction[i]), spilloverRep, incremental);
+ SetOneFactionReputation(sFactionStore.AssertEntry(repTemplate->faction[i]), spilloverRep, incremental);
}
}
}
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 6cd4d79cf56..e5b8cd111bc 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -379,7 +379,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster):
m_base(base), m_spellInfo(base->GetSpellInfo()),
m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[effIndex].BasePoints),
-m_damage(0), m_critChance(0.0f), m_donePct(1.0f),
+m_bonusAmount(0), m_critChance(0.0f), m_donePct(1.0f),
m_spellmod(NULL), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
m_canBeRecalculated(true), m_isPeriodic(false)
{
@@ -5834,16 +5834,18 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
// AOE spells are not affected by the new periodic system.
bool isAreaAura = m_spellInfo->Effects[m_effIndex].IsAreaAuraEffect() || m_spellInfo->Effects[m_effIndex].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA);
// ignore negative values (can be result apply spellmods to aura damage
- uint32 damage = isAreaAura ? std::max(GetAmount(), 0) : m_damage;
+ uint32 damage = std::max(GetAmount() + GetBonusAmount(), 0); // if isAreaAura == true, GetBonusAmount == 0.
// Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
- if (isAreaAura)
- sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
+ sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE)
{
if (isAreaAura)
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()) * caster->SpellDamagePctDone(target, m_spellInfo, DOT);
+ else
+ damage = std::max(int32(damage * GetDonePct()), 0);
+
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
// Calculate armor mitigation
@@ -5910,7 +5912,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
bool crit = false;
if (CanPeriodicTickCrit(caster))
- crit = roll_chance_f(isAreaAura ? caster->GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo->GetSchoolMask()) : m_critChance);
+ crit = roll_chance_f(isAreaAura ? caster->GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo->GetSchoolMask()) : GetCritChance());
if (crit)
damage = caster->SpellCriticalDamageBonus(m_spellInfo, damage, target);
@@ -5968,14 +5970,16 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
bool isAreaAura = m_spellInfo->Effects[m_effIndex].IsAreaAuraEffect() || m_spellInfo->Effects[m_effIndex].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA);
// ignore negative values (can be result apply spellmods to aura damage
- uint32 damage = isAreaAura ? std::max(GetAmount(), 0) : m_damage;
+ uint32 damage = std::max(GetAmount() + GetBonusAmount(), 0); // if isAreaAura == true, GetBonusAmount == 0.
+
+ // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
+ sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
if (isAreaAura)
- {
- // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
- sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()) * caster->SpellDamagePctDone(target, m_spellInfo, DOT);
- }
+ else
+ damage = std::max(int32(damage * GetDonePct()), 0);
+
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
// Calculate armor mitigation
@@ -5989,15 +5993,15 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
if (!(m_spellInfo->AttributesEx4 & SPELL_ATTR4_FIXED_DAMAGE))
if (m_spellInfo->Effects[m_effIndex].IsTargetingArea() || isAreaAura)
{
- damage = int32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
+ damage = uint32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
if (caster->GetTypeId() != TYPEID_PLAYER)
- damage = int32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
+ damage = uint32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
}
bool crit = false;
if (CanPeriodicTickCrit(caster))
- crit = roll_chance_f(isAreaAura ? caster->GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo->GetSchoolMask()) : m_critChance);
+ crit = roll_chance_f(isAreaAura ? caster->GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo->GetSchoolMask()) : GetCritChance());
if (crit)
damage = caster->SpellCriticalDamageBonus(m_spellInfo, damage, target);
@@ -6088,7 +6092,10 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
bool isAreaAura = m_spellInfo->Effects[m_effIndex].IsAreaAuraEffect() || m_spellInfo->Effects[m_effIndex].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA);
// ignore negative values (can be result apply spellmods to aura damage
- int32 damage = isAreaAura ? std::max(GetAmount(), 0) : m_damage;
+ uint32 damage = std::max(GetAmount() + GetBonusAmount(), 0); // if isAreaAura == true, GetBonusAmount == 0.
+
+ // Script Hook For HandlePeriodicHealAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
+ sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
if (GetAuraType() == SPELL_AURA_OBS_MOD_HEALTH)
{
@@ -6136,15 +6143,19 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
damage += addition;
}
+
if (isAreaAura)
damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()) * caster->SpellHealingPctDone(target, m_spellInfo);
+ else
+ damage = std::max(int32(damage * GetDonePct()), 0);
+
damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
}
bool crit = false;
if (CanPeriodicTickCrit(caster))
- crit = roll_chance_f(isAreaAura ? caster->GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo->GetSchoolMask()) : m_critChance);
+ crit = roll_chance_f(isAreaAura ? caster->GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo->GetSchoolMask()) : GetCritChance());
if (crit)
damage = caster->SpellCriticalHealingBonus(m_spellInfo, damage, target);
@@ -6153,7 +6164,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
GetCasterGUID().ToString().c_str(), target->GetGUID().ToString().c_str(), damage, GetId());
uint32 absorb = 0;
- uint32 heal = uint32(damage);
+ uint32 heal = damage;
caster->CalcHealAbsorb(target, GetSpellInfo(), heal, absorb);
int32 gain = caster->DealHeal(target, heal);
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 3ee52b01e14..753d16a97e1 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -70,8 +70,8 @@ class AuraEffect
void HandleEffect(Unit* target, uint8 mode, bool apply);
void ApplySpellMod(Unit* target, bool apply);
- void SetDamage(int32 val) { m_damage = val; }
- int32 GetDamage() const { return m_damage; }
+ void SetBonusAmount(int32 val) { m_bonusAmount = val; }
+ int32 GetBonusAmount() const { return m_bonusAmount; }
void SetCritChance(float val) { m_critChance = val; }
float GetCritChance() const { return m_critChance; }
void SetDonePct(float val) { m_donePct = val; }
@@ -105,7 +105,7 @@ class AuraEffect
int32 const m_baseAmount;
int32 m_amount;
- int32 m_damage;
+ int32 m_bonusAmount;
float m_critChance;
float m_donePct;
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index d4cc2af6ceb..93a4c96b92f 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1705,14 +1705,8 @@ void Aura::HandleAuraSpecificPeriodics(AuraApplication const* aurApp, Unit* cast
{
AuraEffect* aurEff = GetEffect(i);
- // ignore non positive values (can be result apply spellmods to aura damage
- uint32 damage = std::max(aurEff->GetAmount(), 0);
-
- // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
- sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
-
- aurEff->SetDonePct(caster->SpellDamagePctDone(target, m_spellInfo, DOT)); // Calculate done percentage first!
- aurEff->SetDamage(caster->SpellDamageBonusDone(target, m_spellInfo, damage, DOT, GetStackAmount()) * aurEff->GetDonePct());
+ aurEff->SetDonePct(caster->SpellDamagePctDone(target, m_spellInfo, DOT));
+ aurEff->SetBonusAmount(caster->SpellDamageBonusDone(target, m_spellInfo, 0, DOT, GetStackAmount()));
aurEff->SetCritChance(caster->GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo->GetSchoolMask()));
break;
}
@@ -1721,14 +1715,8 @@ void Aura::HandleAuraSpecificPeriodics(AuraApplication const* aurApp, Unit* cast
{
AuraEffect* aurEff = GetEffect(i);
- // ignore non positive values (can be result apply spellmods to aura damage
- uint32 damage = std::max(aurEff->GetAmount(), 0);
-
- // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
- sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
-
- aurEff->SetDonePct(caster->SpellHealingPctDone(target, m_spellInfo)); // Calculate done percentage first!
- aurEff->SetDamage(caster->SpellHealingBonusDone(target, m_spellInfo, damage, DOT, GetStackAmount()) * aurEff->GetDonePct());
+ aurEff->SetDonePct(caster->SpellHealingPctDone(target, m_spellInfo));
+ aurEff->SetBonusAmount(caster->SpellHealingBonusDone(target, m_spellInfo, 0, DOT, GetStackAmount()));
aurEff->SetCritChance(caster->GetUnitSpellCriticalChance(target, m_spellInfo, m_spellInfo->GetSchoolMask()));
break;
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 8e415b06745..8f8295d57d1 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -574,8 +574,8 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
m_spellState = SPELL_STATE_NULL;
_triggeredCastFlags = triggerFlags;
- if (info->AttributesEx4 & SPELL_ATTR4_TRIGGERED)
- _triggeredCastFlags = TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT);
+ if (info->AttributesEx4 & SPELL_ATTR4_CAN_CAST_WHILE_CASTING)
+ _triggeredCastFlags = TriggerCastFlags(uint32(_triggeredCastFlags) | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_CAST_DIRECTLY);
m_CastItem = NULL;
m_castItemGUID.Clear();
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index db16a7312ea..dd4453cc4c5 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2959,6 +2959,8 @@ void SpellMgr::LoadSpellInfoCorrections()
switch (spellInfo->Id)
{
case 53096: // Quetz'lun's Judgment
+ case 70743: // AoD Special
+ case 70614: // AoD Special - Vegard
spellInfo->MaxAffectedTargets = 1;
break;
case 42436: // Drink! (Brewfest)
@@ -3729,7 +3731,7 @@ void SpellMgr::LoadSpellInfoCorrections()
case 45440: // Steam Tonk Controller
case 60256: // Collect Sample
// Crashes client on pressing ESC
- spellInfo->AttributesEx4 &= ~SPELL_ATTR4_TRIGGERED;
+ spellInfo->AttributesEx4 &= ~SPELL_ATTR4_CAN_CAST_WHILE_CASTING;
break;
// ISLE OF CONQUEST SPELLS
//
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 5e11e37f612..555f89aad8f 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1121,6 +1121,25 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_CHARDELETE_HEROIC_MIN_LEVEL] = sConfigMgr->GetIntDefault("CharDelete.Heroic.MinLevel", 0);
m_int_configs[CONFIG_CHARDELETE_KEEP_DAYS] = sConfigMgr->GetIntDefault("CharDelete.KeepDays", 30);
+ // No aggro from gray mobs
+ m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE] = sConfigMgr->GetIntDefault("NoGrayAggro.Above", 0);
+ m_int_configs[CONFIG_NO_GRAY_AGGRO_BELOW] = sConfigMgr->GetIntDefault("NoGrayAggro.Below", 0);
+ if (m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
+ {
+ TC_LOG_ERROR("server.loading", "NoGrayAggro.Above (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL];
+ }
+ if (m_int_configs[CONFIG_NO_GRAY_AGGRO_BELOW] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
+ {
+ TC_LOG_ERROR("server.loading", "NoGrayAggro.Below (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_NO_GRAY_AGGRO_BELOW], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ m_int_configs[CONFIG_NO_GRAY_AGGRO_BELOW] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL];
+ }
+ if (m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE] > 0 && m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE] < m_int_configs[CONFIG_NO_GRAY_AGGRO_BELOW])
+ {
+ TC_LOG_ERROR("server.loading", "NoGrayAggro.Below (%i) cannot be greater than NoGrayAggro.Above (%i). Set to %i.", m_int_configs[CONFIG_NO_GRAY_AGGRO_BELOW], m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE], m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE]);
+ m_int_configs[CONFIG_NO_GRAY_AGGRO_BELOW] = m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE];
+ }
+
///- Read the "Data" directory from the config file
std::string dataPath = sConfigMgr->GetStringDefault("DataDir", "./");
if (dataPath.empty() || (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\'))
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index c7b5cfeeede..95c737936bc 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -345,6 +345,8 @@ enum WorldIntConfigs
CONFIG_CHARTER_COST_ARENA_2v2,
CONFIG_CHARTER_COST_ARENA_3v3,
CONFIG_CHARTER_COST_ARENA_5v5,
+ CONFIG_NO_GRAY_AGGRO_ABOVE,
+ CONFIG_NO_GRAY_AGGRO_BELOW,
INT_CONFIG_VALUE_COUNT
};
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 5d6cdb3fb63..ccd82aa3ef9 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -299,7 +299,7 @@ public:
else if (commentToken[1] == '/')
{
std::string str;
- getline(ifs, str);
+ std::getline(ifs, str);
continue;
}
// regular data
diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
index 390fd3e529f..ca5e4697c35 100644
--- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
@@ -29,6 +29,7 @@ EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "PassiveAI.h"
#include "Player.h"
/*######
@@ -48,14 +49,18 @@ class npc_webbed_creature : public CreatureScript
public:
npc_webbed_creature() : CreatureScript("npc_webbed_creature") { }
- struct npc_webbed_creatureAI : public ScriptedAI
+ struct npc_webbed_creatureAI : public NullCreatureAI
{
- npc_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) { }
+ npc_webbed_creatureAI(Creature* creature) : NullCreatureAI(creature) { }
void Reset() override { }
void EnterCombat(Unit* /*who*/) override { }
+ void AttackStart(Unit* /*who*/) override { }
+
+ void MoveInLineOfSight(Unit* /*who*/) override { }
+
void JustDied(Unit* killer) override
{
uint32 spawnCreatureID = 0;
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
index 7b80db7dd39..9edde447f32 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
@@ -21,6 +21,7 @@
#include "SpellScript.h"
#include "Transport.h"
#include "Player.h"
+#include "MoveSplineInit.h"
#include "halls_of_reflection.h"
enum Text
@@ -342,6 +343,20 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
public:
npc_jaina_or_sylvanas_intro_hor() : CreatureScript("npc_jaina_or_sylvanas_intro_hor") { }
+ bool OnGossipHello(Player* player, Creature* creature) override
+ {
+ // override default gossip
+ if (InstanceScript* instance = creature->GetInstanceScript())
+ if (instance->GetData(DATA_QUEL_DELAR_EVENT) == IN_PROGRESS || instance->GetData(DATA_QUEL_DELAR_EVENT) == SPECIAL)
+ {
+ player->PlayerTalkClass->ClearMenus();
+ return true;
+ }
+
+ // load default gossip
+ return false;
+ }
+
struct npc_jaina_or_sylvanas_intro_horAI : public ScriptedAI
{
npc_jaina_or_sylvanas_intro_horAI(Creature* creature) : ScriptedAI(creature)
@@ -1998,6 +2013,13 @@ class at_hor_intro_start : public AreaTriggerScript
if (_instance->GetData(DATA_INTRO_EVENT) == NOT_STARTED)
_instance->SetData(DATA_INTRO_EVENT, IN_PROGRESS);
+ if (player->HasAura(SPELL_QUEL_DELAR_COMPULSION) && (player->GetQuestStatus(QUEST_HALLS_OF_REFLECTION_ALLIANCE) == QUEST_STATUS_INCOMPLETE ||
+ player->GetQuestStatus(QUEST_HALLS_OF_REFLECTION_HORDE) == QUEST_STATUS_INCOMPLETE) && _instance->GetData(DATA_QUEL_DELAR_EVENT) == NOT_STARTED)
+ {
+ _instance->SetData(DATA_QUEL_DELAR_EVENT, IN_PROGRESS);
+ _instance->SetGuidData(DATA_QUEL_DELAR_INVOKER, player->GetGUID());
+ }
+
return true;
}
};
@@ -2330,6 +2352,395 @@ class npc_lumbering_abomination : public CreatureScript
}
};
+enum QuelDelarUther
+{
+ ACTION_UTHER_START_SCREAM = 1,
+ ACTION_UTHER_OUTRO = 2,
+
+ EVENT_UTHER_1 = 1,
+ EVENT_UTHER_2 = 2,
+ EVENT_UTHER_3 = 3,
+ EVENT_UTHER_4 = 4,
+ EVENT_UTHER_5 = 5,
+ EVENT_UTHER_6 = 6,
+ EVENT_UTHER_7 = 7,
+ EVENT_UTHER_8 = 8,
+ EVENT_UTHER_9 = 9,
+ EVENT_UTHER_10 = 10,
+ EVENT_UTHER_11 = 11,
+ EVENT_UTHER_FACING = 12,
+ EVENT_UTHER_KNEEL = 13,
+
+ SAY_UTHER_QUEL_DELAR_1 = 16,
+ SAY_UTHER_QUEL_DELAR_2 = 17,
+ SAY_UTHER_QUEL_DELAR_3 = 18,
+ SAY_UTHER_QUEL_DELAR_4 = 19,
+ SAY_UTHER_QUEL_DELAR_5 = 20,
+ SAY_UTHER_QUEL_DELAR_6 = 21,
+
+ SPELL_ESSENCE_OF_CAPTURED_1 = 73036
+};
+
+enum QuelDelarSword
+{
+ SPELL_WHIRLWIND_VISUAL = 70300,
+ SPELL_HEROIC_STRIKE = 29426,
+ SPELL_WHIRLWIND = 67716,
+ SPELL_BLADESTORM = 67541,
+
+ NPC_QUEL_DELAR = 37158,
+ POINT_TAKE_OFF = 1,
+
+ EVENT_QUEL_DELAR_INIT = 1,
+ EVENT_QUEL_DELAR_FLIGHT_INIT = 2,
+ EVENT_QUEL_DELAR_FLIGHT = 3,
+ EVENT_QUEL_DELAR_LAND = 4,
+ EVENT_QUEL_DELAR_FIGHT = 5,
+ EVENT_QUEL_DELAR_BLADESTORM = 6,
+ EVENT_QUEL_DELAR_HEROIC_STRIKE = 7,
+ EVENT_QUEL_DELAR_WHIRLWIND = 8,
+
+ SAY_QUEL_DELAR_SWORD = 0
+};
+
+enum QuelDelarMisc
+{
+ SAY_FROSTMOURNE_BUNNY = 0,
+ SPELL_QUEL_DELAR_WILL = 70698
+};
+
+Position const QuelDelarCenterPos = { 5309.259f, 2006.390f, 718.046f, 0.0f };
+Position const QuelDelarSummonPos = { 5298.473f, 1994.852f, 709.424f, 3.979351f };
+Position const QuelDelarMovement[] =
+{
+ { 5292.870f, 1998.950f, 718.046f, 0.0f },
+ { 5295.819f, 1991.912f, 707.707f, 0.0f },
+ { 5295.301f, 1989.782f, 708.696f, 0.0f }
+};
+
+Position const UtherQuelDelarMovement[] =
+{
+ { 5336.830f, 1981.700f, 709.319f, 0.0f },
+ { 5314.350f, 1993.440f, 707.726f, 0.0f }
+};
+
+class npc_uther_quel_delar : public CreatureScript
+{
+ public:
+ npc_uther_quel_delar() : CreatureScript("npc_uther_quel_delar") { }
+
+ struct npc_uther_quel_delarAI : public ScriptedAI
+ {
+ npc_uther_quel_delarAI(Creature* creature) : ScriptedAI(creature)
+ {
+ _instance = me->GetInstanceScript();
+ }
+
+ void Reset() override
+ {
+ // Prevent to break Uther in intro event during instance encounter
+ if (_instance->GetData(DATA_QUEL_DELAR_EVENT) != IN_PROGRESS && _instance->GetData(DATA_QUEL_DELAR_EVENT) != SPECIAL)
+ return;
+
+ _events.Reset();
+ _events.ScheduleEvent(EVENT_UTHER_1, 1);
+ }
+
+ void DamageTaken(Unit* /*attacker*/, uint32& damage) override
+ {
+ if (damage >= me->GetHealth())
+ damage = me->GetHealth() - 1;
+ }
+
+ void DoAction(int32 action) override
+ {
+ switch (action)
+ {
+ case ACTION_UTHER_START_SCREAM:
+ _instance->SetData(DATA_QUEL_DELAR_EVENT, SPECIAL);
+ _events.ScheduleEvent(EVENT_UTHER_2, 0);
+ break;
+ case ACTION_UTHER_OUTRO:
+ _events.ScheduleEvent(EVENT_UTHER_6, 0);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void MovementInform(uint32 /*type*/, uint32 pointId) override
+ {
+ switch (pointId)
+ {
+ case 1:
+ _events.ScheduleEvent(EVENT_UTHER_FACING, 1000);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ // Prevent to break Uther in intro event during instance encounter
+ if (_instance->GetData(DATA_QUEL_DELAR_EVENT) != IN_PROGRESS && _instance->GetData(DATA_QUEL_DELAR_EVENT) != SPECIAL)
+ return;
+
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_UTHER_1:
+ Talk(SAY_UTHER_QUEL_DELAR_1);
+ break;
+ case EVENT_UTHER_2:
+ if (Creature* bunny = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_FROSTMOURNE_ALTAR_BUNNY)))
+ if (Unit* target = ObjectAccessor::GetPlayer(*me, _instance->GetGuidData(DATA_QUEL_DELAR_INVOKER)))
+ bunny->CastSpell(target, SPELL_QUEL_DELAR_WILL, true);
+ _events.ScheduleEvent(EVENT_UTHER_3, 2000);
+ break;
+ case EVENT_UTHER_3:
+ me->SummonCreature(NPC_QUEL_DELAR, QuelDelarSummonPos);
+ _events.ScheduleEvent(EVENT_UTHER_4, 2000);
+ break;
+ case EVENT_UTHER_4:
+ Talk(SAY_UTHER_QUEL_DELAR_2);
+ _events.ScheduleEvent(EVENT_UTHER_5, 8000);
+ break;
+ case EVENT_UTHER_5:
+ me->GetMotionMaster()->MovePoint(1, UtherQuelDelarMovement[0]);
+ break;
+ case EVENT_UTHER_6:
+ me->SetWalk(true);
+ me->GetMotionMaster()->MovePoint(0, UtherQuelDelarMovement[1]);
+ _events.ScheduleEvent(EVENT_UTHER_7, 5000);
+ break;
+ case EVENT_UTHER_7:
+ Talk(SAY_UTHER_QUEL_DELAR_3);
+ _events.ScheduleEvent(EVENT_UTHER_8, 12000);
+ break;
+ case EVENT_UTHER_8:
+ Talk(SAY_UTHER_QUEL_DELAR_4);
+ _events.ScheduleEvent(EVENT_UTHER_9, 7000);
+ break;
+ case EVENT_UTHER_9:
+ Talk(SAY_UTHER_QUEL_DELAR_5);
+ _events.ScheduleEvent(EVENT_UTHER_10, 10000);
+ break;
+ case EVENT_UTHER_10:
+ Talk(SAY_UTHER_QUEL_DELAR_6);
+ _events.ScheduleEvent(EVENT_UTHER_11, 5000);
+ break;
+ case EVENT_UTHER_11:
+ DoCast(me, SPELL_ESSENCE_OF_CAPTURED_1, true);
+ me->DespawnOrUnsummon(3000);
+ _instance->SetData(DATA_QUEL_DELAR_EVENT, DONE);
+ break;
+ case EVENT_UTHER_FACING:
+ if (Creature* bunny = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_FROSTMOURNE_ALTAR_BUNNY)))
+ me->SetFacingToObject(bunny);
+ _events.ScheduleEvent(EVENT_UTHER_KNEEL, 1000);
+ break;
+ case EVENT_UTHER_KNEEL:
+ me->HandleEmoteCommand(EMOTE_STATE_KNEEL);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ private:
+ EventMap _events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetHallsOfReflectionAI<npc_uther_quel_delarAI>(creature);
+ }
+};
+
+class npc_quel_delar_sword : public CreatureScript
+{
+ public:
+ npc_quel_delar_sword() : CreatureScript("npc_quel_delar_sword") { }
+
+ struct npc_quel_delar_swordAI : public ScriptedAI
+ {
+ npc_quel_delar_swordAI(Creature* creature) : ScriptedAI(creature)
+ {
+ _instance = me->GetInstanceScript();
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
+ _intro = true;
+ }
+
+ void Reset() override
+ {
+ _events.Reset();
+ me->SetSpeed(MOVE_FLIGHT, 4.5f, true);
+ DoCast(SPELL_WHIRLWIND_VISUAL);
+ if (_intro)
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_INIT, 0);
+ else
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ }
+
+ void EnterCombat(Unit* /*victim*/) override
+ {
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_HEROIC_STRIKE, 4000);
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_BLADESTORM, 6000);
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_WHIRLWIND, 6000);
+ }
+
+ void JustDied(Unit* /*killer*/) override
+ {
+ if (Creature* uther = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_UTHER_QUEL_DELAR)))
+ uther->AI()->DoAction(ACTION_UTHER_OUTRO);
+ }
+
+ void MovementInform(uint32 type, uint32 pointId) override
+ {
+ if (type != EFFECT_MOTION_TYPE)
+ return;
+
+ switch (pointId)
+ {
+ case POINT_TAKE_OFF:
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_FLIGHT, 0);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ if (!UpdateVictim())
+ {
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_QUEL_DELAR_INIT:
+ if (Creature* bunny = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_FROSTMOURNE_ALTAR_BUNNY)))
+ bunny->AI()->Talk(SAY_FROSTMOURNE_BUNNY);
+ _intro = false;
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_FLIGHT_INIT, 2500);
+ break;
+ case EVENT_QUEL_DELAR_FLIGHT_INIT:
+ me->GetMotionMaster()->MoveTakeoff(POINT_TAKE_OFF, QuelDelarMovement[0]);
+ break;
+ case EVENT_QUEL_DELAR_FLIGHT:
+ {
+ Movement::MoveSplineInit init(me);
+ FillCirclePath(QuelDelarCenterPos, 18.0f, 718.046f, init.Path(), true);
+ init.SetFly();
+ init.SetCyclic();
+ init.SetAnimation(Movement::ToFly);
+ init.Launch();
+
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_LAND, 15000);
+ break;
+ }
+ case EVENT_QUEL_DELAR_LAND:
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveLand(0, QuelDelarMovement[1]);
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_FIGHT, 6000);
+ break;
+ case EVENT_QUEL_DELAR_FIGHT:
+ Talk(SAY_QUEL_DELAR_SWORD);
+ me->GetMotionMaster()->MovePoint(0, QuelDelarMovement[2]);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else
+ {
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_QUEL_DELAR_BLADESTORM:
+ DoCast(me, SPELL_BLADESTORM);
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_BLADESTORM, 10000);
+ break;
+ case EVENT_QUEL_DELAR_HEROIC_STRIKE:
+ DoCastVictim(SPELL_HEROIC_STRIKE);
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_HEROIC_STRIKE, 6000);
+ break;
+ case EVENT_QUEL_DELAR_WHIRLWIND:
+ DoCastAOE(SPELL_WHIRLWIND);
+ _events.ScheduleEvent(EVENT_QUEL_DELAR_WHIRLWIND, 1000);
+ break;
+ default:
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ }
+
+ private:
+ void FillCirclePath(Position const& centerPos, float radius, float z, Movement::PointsArray& path, bool clockwise)
+ {
+ float step = clockwise ? -M_PI / 8.0f : M_PI / 8.0f;
+ float angle = centerPos.GetAngle(me->GetPositionX(), me->GetPositionY());
+
+ for (uint8 i = 0; i < 16; angle += step, ++i)
+ {
+ G3D::Vector3 point;
+ point.x = centerPos.GetPositionX() + radius * cosf(angle);
+ point.y = centerPos.GetPositionY() + radius * sinf(angle);
+ point.z = z;
+ path.push_back(point);
+ }
+ }
+
+ EventMap _events;
+ InstanceScript* _instance;
+ bool _intro;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetHallsOfReflectionAI<npc_quel_delar_swordAI>(creature);
+ }
+};
+
+// 5660
+class at_hor_uther_quel_delar_start : public AreaTriggerScript
+{
+ public:
+ at_hor_uther_quel_delar_start() : AreaTriggerScript("at_hor_uther_quel_delar_start") { }
+
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) override
+ {
+ if (player->IsGameMaster())
+ return true;
+
+ InstanceScript* _instance = player->GetInstanceScript();
+
+ if (_instance->GetData(DATA_QUEL_DELAR_EVENT) == IN_PROGRESS)
+ if (Creature* uther = ObjectAccessor::GetCreature(*player, _instance->GetGuidData(DATA_UTHER_QUEL_DELAR)))
+ uther->AI()->DoAction(ACTION_UTHER_START_SCREAM);
+
+ return true;
+ }
+};
+
// 72900 - Start Halls of Reflection Quest AE
class spell_hor_start_halls_of_reflection_quest_ae : public SpellScriptLoader
{
@@ -2447,6 +2858,7 @@ void AddSC_halls_of_reflection()
new at_hor_waves_restarter();
new at_hor_impenetrable_door();
new at_hor_shadow_throne();
+ new at_hor_uther_quel_delar_start();
new npc_jaina_or_sylvanas_intro_hor();
new npc_jaina_or_sylvanas_escape_hor();
new npc_the_lich_king_escape_hor();
@@ -2461,6 +2873,8 @@ void AddSC_halls_of_reflection()
new npc_raging_ghoul();
new npc_risen_witch_doctor();
new npc_lumbering_abomination();
+ new npc_uther_quel_delar();
+ new npc_quel_delar_sword();
new spell_hor_start_halls_of_reflection_quest_ae();
new spell_hor_evasion();
new spell_hor_gunship_cannon_fire();
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h
index 9594617fa9a..d2f9ab5d262 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h
@@ -46,7 +46,13 @@ enum DataTypes
DATA_ESCAPE_LEADER = 10,
DATA_ICEWALL = 11,
DATA_ICEWALL_TARGET = 12,
- DATA_GUNSHIP = 13
+ DATA_GUNSHIP = 13,
+
+ // Quest stuff
+ DATA_QUEL_DELAR_EVENT = 14,
+ DATA_FROSTMOURNE_ALTAR_BUNNY = 15,
+ DATA_UTHER_QUEL_DELAR = 16,
+ DATA_QUEL_DELAR_INVOKER = 17
};
enum CreatureIds
@@ -131,7 +137,8 @@ enum InstanceEvents
EVENT_NEXT_WAVE = 2,
EVENT_DO_WIPE = 3,
EVENT_ADD_WAVE = 4,
- EVENT_SPAWN_ESCAPE_EVENT = 5
+ EVENT_SPAWN_ESCAPE_EVENT = 5,
+ EVENT_QUEL_DELAR_SUMMON_UTHER = 6
};
enum InstanceEventIds
@@ -160,7 +167,17 @@ enum InstanceSpells
// Gunship
SPELL_GUNSHIP_CANNON_FIRE = 70017,
SPELL_GUNSHIP_CANNON_FIRE_MISSILE_ALLIANCE = 70021,
- SPELL_GUNSHIP_CANNON_FIRE_MISSILE_HORDE = 70246
+ SPELL_GUNSHIP_CANNON_FIRE_MISSILE_HORDE = 70246,
+
+ // Halls of Reflection quest
+ SPELL_QUEL_DELAR_COMPULSION = 70013,
+ SPELL_ESSENCE_OF_CAPTURED = 70720
+};
+
+enum InstanceQuests
+{
+ QUEST_HALLS_OF_REFLECTION_ALLIANCE = 24480,
+ QUEST_HALLS_OF_REFLECTION_HORDE = 24561
};
enum InstanceWorldStates
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
index ea2a1539f1c..660a639487f 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
@@ -73,6 +73,8 @@ Position const SpawnPos[] =
{ 5299.250f, 2035.998f, 707.7781f, 5.026548f }
};
+Position const UtherQuelDalarPos = { 5302.001f, 1988.698f, 707.7781f, 3.700098f };
+
class instance_halls_of_reflection : public InstanceMapScript
{
public:
@@ -89,6 +91,7 @@ class instance_halls_of_reflection : public InstanceMapScript
_waveCount = 0;
_introState = NOT_STARTED;
_frostswornGeneralState = NOT_STARTED;
+ _quelDelarState = NOT_STARTED;
events.Reset();
}
@@ -159,6 +162,9 @@ class instance_halls_of_reflection : public InstanceMapScript
case NPC_ICE_WALL_TARGET:
IcewallTargetGUID = creature->GetGUID();
break;
+ case NPC_UTHER:
+ UtherGUID = creature->GetGUID();
+ break;
default:
break;
}
@@ -439,6 +445,18 @@ class instance_halls_of_reflection : public InstanceMapScript
HandleGameObject(ShadowThroneDoorGUID, true);
_frostswornGeneralState = data;
break;
+ case DATA_QUEL_DELAR_EVENT:
+ if (data == IN_PROGRESS)
+ {
+ if (_quelDelarState == NOT_STARTED)
+ {
+ if (Creature* bunny = instance->GetCreature(FrostmourneAltarBunnyGUID))
+ bunny->CastSpell((Unit*)NULL, SPELL_ESSENCE_OF_CAPTURED);
+ events.ScheduleEvent(EVENT_QUEL_DELAR_SUMMON_UTHER, 2000);
+ }
+ }
+ _quelDelarState = data;
+ break;
default:
break;
}
@@ -446,6 +464,18 @@ class instance_halls_of_reflection : public InstanceMapScript
SaveToDB();
}
+ void SetGuidData(uint32 type, ObjectGuid data) override
+ {
+ switch (type)
+ {
+ case DATA_QUEL_DELAR_INVOKER:
+ QuelDelarInvokerGUID = data;
+ break;
+ default:
+ break;
+ }
+ }
+
// wave scheduling, checked when wave npcs die
void OnUnitDeath(Unit* unit) override
{
@@ -491,6 +521,9 @@ class instance_halls_of_reflection : public InstanceMapScript
case EVENT_SPAWN_ESCAPE_EVENT:
SpawnEscapeEvent();
break;
+ case EVENT_QUEL_DELAR_SUMMON_UTHER:
+ instance->SummonCreature(NPC_UTHER, UtherQuelDalarPos);
+ break;
}
}
@@ -649,6 +682,8 @@ class instance_halls_of_reflection : public InstanceMapScript
return _introState;
case DATA_FROSTSWORN_GENERAL:
return _frostswornGeneralState;
+ case DATA_QUEL_DELAR_EVENT:
+ return _quelDelarState;
default:
break;
}
@@ -682,6 +717,12 @@ class instance_halls_of_reflection : public InstanceMapScript
return IcewallGUID;
case DATA_ICEWALL_TARGET:
return IcewallTargetGUID;
+ case DATA_FROSTMOURNE_ALTAR_BUNNY:
+ return FrostmourneAltarBunnyGUID;
+ case DATA_UTHER_QUEL_DELAR:
+ return UtherGUID;
+ case DATA_QUEL_DELAR_INVOKER:
+ return QuelDelarInvokerGUID;
default:
break;
}
@@ -691,7 +732,7 @@ class instance_halls_of_reflection : public InstanceMapScript
void WriteSaveDataMore(std::ostringstream& data) override
{
- data << _introState << ' ' << _frostswornGeneralState;
+ data << _introState << ' ' << _frostswornGeneralState << ' ' << _quelDelarState;
}
void ReadSaveDataMore(std::istringstream& data) override
@@ -708,6 +749,12 @@ class instance_halls_of_reflection : public InstanceMapScript
SetData(DATA_FROSTSWORN_GENERAL, DONE);
else
SetData(DATA_FROSTSWORN_GENERAL, NOT_STARTED);
+
+ data >> temp;
+ if (temp == DONE)
+ SetData(DATA_QUEL_DELAR_EVENT, DONE);
+ else
+ SetData(DATA_QUEL_DELAR_EVENT, NOT_STARTED);
}
private:
@@ -731,6 +778,7 @@ class instance_halls_of_reflection : public InstanceMapScript
uint32 _waveCount;
uint32 _introState;
uint32 _frostswornGeneralState;
+ uint32 _quelDelarState;
EventMap events;
GuidSet waveGuidList[8];
@@ -740,6 +788,8 @@ class instance_halls_of_reflection : public InstanceMapScript
ObjectGuid CaptainGUID;
ObjectGuid IcewallGUID;
ObjectGuid IcewallTargetGUID;
+ ObjectGuid QuelDelarInvokerGUID;
+ ObjectGuid UtherGUID;
GuidSet GunshipCannonGUIDs;
GuidSet GunshipStairGUIDs;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index 4c6fd0f2fcc..63082808e03 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -1259,7 +1259,7 @@ class spell_putricide_mutated_plague : public SpellScriptLoader
return;
uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
- SpellInfo const* spell = sSpellMgr->GetSpellInfo(triggerSpell);
+ SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(triggerSpell);
spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, caster);
int32 damage = spell->Effects[EFFECT_0].CalcValue(caster);
diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp
index f73930181f0..91c796a6e69 100644
--- a/src/server/scripts/Northrend/zone_zuldrak.cpp
+++ b/src/server/scripts/Northrend/zone_zuldrak.cpp
@@ -313,7 +313,7 @@ public:
{
player->KilledMonsterCredit(gymerDummy->GetEntry(), gymerDummy->GetGUID());
gymerDummy->CastSpell(gymerDummy, SPELL_GYMER_LOCK_EXPLOSION, true);
- gymerDummy->DespawnOrUnsummon();
+ gymerDummy->DespawnOrUnsummon(4 * IN_MILLISECONDS);
}
}
return true;
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 67ce1485a83..cd0052c24bc 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -1067,7 +1067,7 @@ class spell_dk_pestilence : public SpellScriptLoader
{
aurEffNew->SetCritChance(critChance); // Blood Plague can crit if caster has T9.
aurEffNew->SetDonePct(donePct);
- aurEffNew->SetDamage(caster->SpellDamageBonusDone(hitUnit, aurEffNew->GetSpellInfo(), std::max(aurEffNew->GetAmount(), 0), DOT) * donePct);
+ aurEffNew->SetBonusAmount(caster->SpellDamageBonusDone(hitUnit, aurEffNew->GetSpellInfo(), 0, DOT));
}
}
}
@@ -1086,7 +1086,7 @@ class spell_dk_pestilence : public SpellScriptLoader
if (AuraEffect* aurEffNew = aurNew->GetEffect(EFFECT_0))
{
aurEffNew->SetDonePct(donePct);
- aurEffNew->SetDamage(caster->SpellDamageBonusDone(hitUnit, aurEffNew->GetSpellInfo(), std::max(aurEffNew->GetAmount(), 0), DOT) * donePct);
+ aurEffNew->SetBonusAmount(caster->SpellDamageBonusDone(hitUnit, aurEffNew->GetSpellInfo(), 0, DOT));
}
}
}
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 8a6e191f8a9..3ee337f81d4 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -209,14 +209,11 @@ class spell_hun_chimera_shot : public SpellScriptLoader
{
int32 TickCount = aurEff->GetTotalTicks();
spellId = SPELL_HUNTER_CHIMERA_SHOT_SERPENT;
- basePoint = aurEff->GetDamage();
+ basePoint = (aurEff->GetAmount() + aurEff->GetBonusAmount()) * aurEff->GetDonePct();
ApplyPct(basePoint, TickCount * 40);
basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
- // Recalculate bonus damage on roll.
- uint32 damage = std::max(aurEff->GetAmount(), 0);
- sScriptMgr->ModifyPeriodicDamageAurasTick(unitTarget, caster, damage);
- aurEff->SetDamage(caster->SpellDamageBonusDone(unitTarget, aurEff->GetSpellInfo(), damage, DOT) * aurEff->GetDonePct());
+ aurEff->SetBonusAmount(caster->SpellDamageBonusDone(unitTarget, aurEff->GetSpellInfo(), 0, DOT));
}
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
else if (familyFlag[1] & 0x00000080)
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 0ead78a2ecd..0914089f1c4 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -544,9 +544,7 @@ class spell_pri_pain_and_suffering_proc : public SpellScriptLoader
if (Unit* target = GetHitUnit())
if (AuraEffect* aur = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, caster->GetGUID()))
{
- uint32 damage = std::max(aur->GetAmount(), 0);
- sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
- aur->SetDamage(caster->SpellDamageBonusDone(target, aur->GetSpellInfo(), damage, DOT) * aur->GetDonePct());
+ aur->SetBonusAmount(caster->SpellDamageBonusDone(target, aur->GetSpellInfo(), 0, DOT));
aur->CalculatePeriodic(caster, false, false);
aur->GetBase()->RefreshDuration();
}
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 6105a0d8be2..a2bbfdc246a 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -411,9 +411,7 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader
// Refresh corruption on target
if (AuraEffect* aur = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, caster->GetGUID()))
{
- uint32 damage = std::max(aur->GetAmount(), 0);
- sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
- aur->SetDamage(caster->SpellDamageBonusDone(target, aur->GetSpellInfo(), damage, DOT) * aur->GetDonePct());
+ aur->SetBonusAmount(caster->SpellDamageBonusDone(target, aur->GetSpellInfo(), 0, DOT));
aur->CalculatePeriodic(caster, false, false);
aur->GetBase()->RefreshDuration(true);
}
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index ea519abebd1..fa2b323e220 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -275,7 +275,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader
// Add remaining ticks to damage done
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, EFFECT_0, caster->GetGUID()))
- damage += aurEff->GetDamage() * int32(ticks - aurEff->GetTickNumber());
+ damage += (aurEff->GetAmount() + aurEff->GetBonusAmount()) * aurEff->GetDonePct() * int32(ticks - aurEff->GetTickNumber());
damage /= int32(ticks);
diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h
index 10d4ff1bec9..1cb67a4235e 100644
--- a/src/server/shared/DataStores/DBCStore.h
+++ b/src/server/shared/DataStores/DBCStore.h
@@ -87,6 +87,13 @@ class DBCStorage
return (id >= nCount) ? NULL : indexTable.asT[id];
}
+ T const* AssertEntry(uint32 id) const
+ {
+ T const* entry = LookupEntry(id);
+ ASSERT(entry);
+ return entry;
+ }
+
uint32 GetNumRows() const { return nCount; }
char const* GetFormat() const { return fmt; }
uint32 GetFieldCount() const { return fieldCount; }
diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h
index 5a06ad69a1d..f0ddbe91ad8 100644
--- a/src/server/shared/Database/DatabaseWorkerPool.h
+++ b/src/server/shared/Database/DatabaseWorkerPool.h
@@ -29,6 +29,8 @@
#include "QueryHolder.h"
#include "AdhocStatement.h"
+#include <mysqld_error.h>
+
#define MIN_MYSQL_SERVER_VERSION 50100u
#define MIN_MYSQL_CLIENT_VERSION 50100u
@@ -368,7 +370,8 @@ class DatabaseWorkerPool
void DirectCommitTransaction(SQLTransaction& transaction)
{
T* con = GetFreeConnection();
- if (con->ExecuteTransaction(transaction))
+ int errorCode = con->ExecuteTransaction(transaction);
+ if (!errorCode)
{
con->Unlock(); // OK, operation succesful
return;
@@ -376,12 +379,12 @@ class DatabaseWorkerPool
//! Handle MySQL Errno 1213 without extending deadlock to the core itself
/// @todo More elegant way
- if (con->GetLastError() == 1213)
+ if (errorCode == ER_LOCK_DEADLOCK)
{
uint8 loopBreaker = 5;
for (uint8 i = 0; i < loopBreaker; ++i)
{
- if (con->ExecuteTransaction(transaction))
+ if (!con->ExecuteTransaction(transaction))
break;
}
}
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index bea229df184..1a9f973d47b 100644
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -359,11 +359,11 @@ void MySQLConnection::CommitTransaction()
Execute("COMMIT");
}
-bool MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
+int MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
{
std::list<SQLElementData> const& queries = transaction->m_queries;
if (queries.empty())
- return false;
+ return -1;
BeginTransaction();
@@ -380,8 +380,9 @@ bool MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
if (!Execute(stmt))
{
TC_LOG_WARN("sql.sql", "Transaction aborted. %u queries not executed.", (uint32)queries.size());
+ int errorCode = GetLastError();
RollbackTransaction();
- return false;
+ return errorCode;
}
}
break;
@@ -392,8 +393,9 @@ bool MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
if (!Execute(sql))
{
TC_LOG_WARN("sql.sql", "Transaction aborted. %u queries not executed.", (uint32)queries.size());
+ int errorCode = GetLastError();
RollbackTransaction();
- return false;
+ return errorCode;
}
}
break;
@@ -406,7 +408,7 @@ bool MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
// and not while iterating over every element.
CommitTransaction();
- return true;
+ return 0;
}
MySQLPreparedStatement* MySQLConnection::GetPreparedStatement(uint32 index)
diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h
index 33f17d02228..d486f5b4679 100644
--- a/src/server/shared/Database/MySQLConnection.h
+++ b/src/server/shared/Database/MySQLConnection.h
@@ -86,7 +86,7 @@ class MySQLConnection
void BeginTransaction();
void RollbackTransaction();
void CommitTransaction();
- bool ExecuteTransaction(SQLTransaction& transaction);
+ int ExecuteTransaction(SQLTransaction& transaction);
operator bool () const { return m_Mysql != NULL; }
void Ping() { mysql_ping(m_Mysql); }
diff --git a/src/server/shared/Database/Transaction.cpp b/src/server/shared/Database/Transaction.cpp
index 3dee865267b..b83b787a106 100644
--- a/src/server/shared/Database/Transaction.cpp
+++ b/src/server/shared/Database/Transaction.cpp
@@ -17,6 +17,7 @@
#include "DatabaseEnv.h"
#include "Transaction.h"
+#include <mysqld_error.h>
//- Append a raw ad-hoc query to the transaction
void Transaction::Append(const char* sql)
@@ -74,14 +75,15 @@ void Transaction::Cleanup()
bool TransactionTask::Execute()
{
- if (m_conn->ExecuteTransaction(m_trans))
+ int errorCode = m_conn->ExecuteTransaction(m_trans);
+ if (!errorCode)
return true;
- if (m_conn->GetLastError() == 1213)
+ if (errorCode == ER_LOCK_DEADLOCK)
{
uint8 loopBreaker = 5; // Handle MySQL Errno 1213 without extending deadlock to the core itself
for (uint8 i = 0; i < loopBreaker; ++i)
- if (m_conn->ExecuteTransaction(m_trans))
+ if (!m_conn->ExecuteTransaction(m_trans))
return true;
}
diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h
index df770c2aa47..4d4624b63dd 100644
--- a/src/server/shared/Debugging/Errors.h
+++ b/src/server/shared/Debugging/Errors.h
@@ -49,4 +49,10 @@ namespace Trinity
#define ASSERT WPAssert
+template <typename T> inline T* ASSERT_NOTNULL(T* pointer)
+{
+ ASSERT(pointer);
+ return pointer;
+}
+
#endif
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 33d824fac4b..010c73779bc 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -2691,6 +2691,21 @@ Calculate.Creature.Zone.Area.Data = 0
Calculate.Gameoject.Zone.Area.Data = 0
#
+# NoGrayAggro
+# Description: Gray mobs will not aggro players above/below some levels
+# NoGrayAggro.Above: If player is at this level or above, gray mobs will not attack
+# NoGrayAggro.Below: If player is at this level or below, gray mobs will not attack
+# Example: You can for example make players free from gray until they reach level 30.
+# Then gray will start to attack them, until they reach max level (80 for example):
+# NoGrayAggro.Above = 80
+# NoGrayAggro.Below = 29
+# Default: 0 - (Blizzlike)
+#
+
+NoGrayAggro.Above = 0
+NoGrayAggro.Below = 0
+
+#
###################################################################################################
###################################################################################################
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index 272c8cd1fb5..350c8becb35 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -12,6 +12,3 @@ add_subdirectory(map_extractor)
add_subdirectory(vmap4_assembler)
add_subdirectory(vmap4_extractor)
add_subdirectory(mmaps_generator)
-if (WITH_MESHEXTRACTOR)
- add_subdirectory(mesh_extractor)
-endif()
diff --git a/src/tools/mesh_extractor/ADT.cpp b/src/tools/mesh_extractor/ADT.cpp
deleted file mode 100644
index 0165a9000f1..00000000000
--- a/src/tools/mesh_extractor/ADT.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ADT.h"
-#include "DoodadHandler.h"
-#include "LiquidHandler.h"
-#include "WorldModelHandler.h"
-
-ADT::ADT( std::string file, int x, int y ) : ObjectData(NULL), Data(NULL), HasObjectData(false),
- _DoodadHandler(NULL), _WorldModelHandler(NULL), _LiquidHandler(NULL), X(x), Y(y)
-{
- Data = new ChunkedData(file);
- ObjectData = new ChunkedData(file);
- if (ObjectData->Stream)
- HasObjectData = true;
- else
- ObjectData = NULL;
-}
-
-ADT::~ADT()
-{
- delete ObjectData;
- delete Data;
-
- for (std::vector<MapChunk*>::iterator itr = MapChunks.begin(); itr != MapChunks.end(); ++itr)
- delete *itr;
-
- MapChunks.clear();
- delete _DoodadHandler;
- delete _WorldModelHandler;
- delete _LiquidHandler;
-}
-
-void ADT::Read()
-{
- Header.Read(Data->GetChunkByName("MHDR")->GetStream());
- MapChunks.reserve(16 * 16);
-
- for (std::vector<Chunk*>::iterator itr = Data->Chunks.begin(); itr != Data->Chunks.end(); ++itr)
- if ((*itr)->Name == "MCNK")
- MapChunks.push_back(new MapChunk(this, *itr));
-
- _LiquidHandler = new LiquidHandler(this);
-
- // do this separate from map chunk initialization to access liquid data
- for (std::vector<MapChunk*>::iterator itr = MapChunks.begin(); itr != MapChunks.end(); ++itr)
- (*itr)->GenerateTriangles();
-
- _DoodadHandler = new DoodadHandler(this);
- for (std::vector<MapChunk*>::iterator itr = MapChunks.begin(); itr != MapChunks.end(); ++itr)
- _DoodadHandler->ProcessMapChunk(*itr);
-
- _WorldModelHandler = new WorldModelHandler(this);
- for (std::vector<MapChunk*>::iterator itr = MapChunks.begin(); itr != MapChunks.end(); ++itr)
- _WorldModelHandler->ProcessMapChunk(*itr);
-}
diff --git a/src/tools/mesh_extractor/ADT.h b/src/tools/mesh_extractor/ADT.h
deleted file mode 100644
index 55bd8623351..00000000000
--- a/src/tools/mesh_extractor/ADT.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef ADT_H
-#define ADT_H
-#include "ChunkedData.h"
-#include "MapChunk.h"
-
-class DoodadHandler;
-class WorldModelHandler;
-class LiquidHandler;
-
-class ADT
-{
-public:
- ADT(std::string file, int x, int y);
- ~ADT();
-
- void Read();
-
- ChunkedData* ObjectData;
- ChunkedData* Data;
- std::vector<MapChunk*> MapChunks;
- MHDR Header;
- // Can we dispose of this?
- bool HasObjectData;
-
- DoodadHandler* _DoodadHandler;
- WorldModelHandler* _WorldModelHandler;
- LiquidHandler* _LiquidHandler;
-
- int X;
- int Y;
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/CMakeLists.txt b/src/tools/mesh_extractor/CMakeLists.txt
deleted file mode 100644
index eb3c63504d4..00000000000
--- a/src/tools/mesh_extractor/CMakeLists.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
-# Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-file(GLOB_RECURSE meshExtract_Sources *.cpp *.h)
-
-set(include_Base
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/src/server/shared
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour
- ${CMAKE_SOURCE_DIR}/dep/libmpq
- ${CMAKE_SOURCE_DIR}/dep/g3dlite/include
- ${ACE_INCLUDE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-if( WIN32 )
- set(include_Base
- ${include_Base}
- ${CMAKE_SOURCE_DIR}/dep/libmpq/win
- )
-endif()
-
-include_directories(${include_Base})
-
-add_executable(MeshExtractor ${meshExtract_Sources})
-
-target_link_libraries(MeshExtractor
- g3dlib
- mpq
- Recast
- Detour
- ${BZIP2_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${ACE_LIBRARY}
-)
-
-if( UNIX )
- install(TARGETS MeshExtractor DESTINATION bin)
-elseif( WIN32 )
- install(TARGETS MeshExtractor DESTINATION "${CMAKE_INSTALL_PREFIX}")
-endif()
diff --git a/src/tools/mesh_extractor/Cache.h b/src/tools/mesh_extractor/Cache.h
deleted file mode 100644
index 9cdec6bed2b..00000000000
--- a/src/tools/mesh_extractor/Cache.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef CACHE_H
-#define CACHE_H
-#include <string>
-#include <map>
-#include "Define.h"
-#include <ace/Guard_T.h>
-#include <ace/Synch.h>
-#include "WorldModelRoot.h"
-#include "Model.h"
-
-template<class K, class T>
-class GenericCache
-{
-public:
- GenericCache() {}
-
- static const uint32 FlushLimit = 300; // We can't get too close to filling up all the memory, and we have to be wary of the maximum number of open streams.
-
- void Insert(K key, T* val)
- {
- ACE_GUARD(ACE_Thread_Mutex, g, mutex);
-
- if (_items.size() > FlushLimit)
- Clear();
- _items[key] = val;
- }
-
- T* Get(K key)
- {
- ACE_GUARD_RETURN(ACE_Thread_Mutex, g, mutex, NULL);
- typename std::map<K, T*>::iterator itr = _items.find(key);
- if (itr != _items.end())
- return itr->second;
- return NULL;
- }
-
- void Clear()
- {
- for (typename std::map<K, T*>::iterator itr = _items.begin(); itr != _items.end(); ++itr)
- delete itr->second;
- _items.clear();
- }
-private:
- std::map<K, T*> _items;
- ACE_Thread_Mutex mutex;
-};
-
-class CacheClass
-{
-public:
- CacheClass() {}
- GenericCache<std::string, Model> ModelCache;
- GenericCache<std::string, WorldModelRoot> WorldModelCache;
-
- void Clear()
- {
- ModelCache.Clear();
- WorldModelCache.Clear();
- }
-};
-
-extern CacheClass* Cache;
-#endif
diff --git a/src/tools/mesh_extractor/Chunk.cpp b/src/tools/mesh_extractor/Chunk.cpp
deleted file mode 100644
index 62dd885e167..00000000000
--- a/src/tools/mesh_extractor/Chunk.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Chunk.h"
-#include "Utils.h"
-
-int32 Chunk::FindSubChunkOffset(std::string name)
-{
- // Reverse the name
- name = std::string(name.rbegin(), name.rend());
- if (name.size() != 4)
- return -1;
-
- FILE* stream = GetStream();
- uint32 matched = 0;
- while (uint32(ftell(stream)) < Utils::Size(stream))
- {
- char b = 0;
- if (fread(&b, sizeof(char), 1, stream) != 1 || b != name[matched])
- matched = 0;
- else
- ++matched;
-
- if (matched == 4)
- return ftell(stream) - 4;
- }
- return -1;
-}
-
-FILE* Chunk::GetStream()
-{
- fseek(Stream, Offset, SEEK_SET);
- return Stream;
-}
diff --git a/src/tools/mesh_extractor/Chunk.h b/src/tools/mesh_extractor/Chunk.h
deleted file mode 100644
index 8c8125ce24b..00000000000
--- a/src/tools/mesh_extractor/Chunk.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef CHUNK_H
-#define CHUNK_H
-#include "Define.h"
-#include <string>
-class ChunkedData;
-
-class Chunk
-{
-public:
- Chunk(const char* name, uint32 length, uint32 offset, FILE* stream) : Name(name), Length(length), Offset(offset), Stream(stream) {}
-
- int32 FindSubChunkOffset(std::string name);
- FILE* GetStream();
- std::string Name;
- uint32 Length;
- uint32 Offset;
- FILE* Stream;
-};
-
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/ChunkedData.cpp b/src/tools/mesh_extractor/ChunkedData.cpp
deleted file mode 100644
index 32a6864e040..00000000000
--- a/src/tools/mesh_extractor/ChunkedData.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ChunkedData.h"
-#include "MPQManager.h"
-#include "Utils.h"
-
-#include <string>
-
-ChunkedData::ChunkedData( FILE* stream, uint32 maxLength, uint32 chunksHint /*= 300*/ ) :
-Stream(stream)
-{
- if (!Stream)
- return;
- Load(maxLength, chunksHint);
-}
-
-ChunkedData::ChunkedData( const std::string& file, uint32 chunksHint /*= 300*/ )
-{
- Stream = MPQHandler->GetFile(file);
- if (!Stream)
- return;
- Load(0, chunksHint);
-}
-
-void ChunkedData::Load( uint32 maxLength, uint32 chunksHint )
-{
- if (!maxLength)
- maxLength = Utils::Size(Stream);
- Chunks.reserve(chunksHint);
- uint32 baseOffset = ftell(Stream);
- uint32 calcOffset = 0;
- while ((calcOffset + baseOffset) < Utils::Size(Stream) && (calcOffset < maxLength))
- {
- char nameBytes[5];
- uint32 read = fread(&nameBytes, sizeof(char), 4, Stream);
- nameBytes[read] = '\0';
- std::string name = std::string(nameBytes);
- // Utils::Reverse(nameBytes);
- name = std::string(name.rbegin(), name.rend());
- uint32 length;
- if (fread(&length, sizeof(uint32), 1, Stream) != 1)
- continue;
- calcOffset += 8;
- Chunks.push_back(new Chunk(name.c_str(), length, calcOffset + baseOffset, Stream));
- calcOffset += length;
- // save an extra seek at the end
- if ((calcOffset + baseOffset) < Utils::Size(Stream) && calcOffset < maxLength)
- fseek(Stream, length, SEEK_CUR);
- }
-}
-
-int ChunkedData::GetFirstIndex( const std::string& name )
-{
- for (uint32 i = 0; i < Chunks.size(); ++i)
- if (Chunks[i]->Name == name)
- return i;
- return -1;
-}
-
-Chunk* ChunkedData::GetChunkByName( const std::string& name )
-{
- for (uint32 i = 0; i < Chunks.size(); ++i)
- if (Chunks[i]->Name == name)
- return Chunks[i];
- return NULL;
-}
-
-ChunkedData::~ChunkedData()
-{
- for (std::vector<Chunk*>::iterator itr = Chunks.begin(); itr != Chunks.end(); ++itr)
- delete *itr;
-
- Chunks.clear();
- if (Stream)
- fclose(Stream);
-}
diff --git a/src/tools/mesh_extractor/ChunkedData.h b/src/tools/mesh_extractor/ChunkedData.h
deleted file mode 100644
index c674a2fa87e..00000000000
--- a/src/tools/mesh_extractor/ChunkedData.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef CHNK_H
-#define CHNK_H
-
-#include <vector>
-#include "Chunk.h"
-
-class ChunkedData
-{
-public:
- ChunkedData(FILE* stream, uint32 maxLength, uint32 chunksHint = 300);
- ChunkedData(const std::string &file, uint32 chunksHint = 300);
- ~ChunkedData();
-
- int GetFirstIndex(const std::string& name);
- Chunk* GetChunkByName(const std::string& name);
-
- void Load(uint32 maxLength, uint32 chunksHint);
- std::vector<Chunk*> Chunks;
- FILE* Stream;
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/Constants.h b/src/tools/mesh_extractor/Constants.h
deleted file mode 100644
index daa8eef2a7a..00000000000
--- a/src/tools/mesh_extractor/Constants.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef CONSTANTS_H
-#define CONSTANTS_H
-
-class Constants
-{
-public:
- enum TriangleType
- {
- TRIANGLE_TYPE_UNKNOWN,
- TRIANGLE_TYPE_TERRAIN,
- TRIANGLE_TYPE_WATER,
- TRIANGLE_TYPE_DOODAD,
- TRIANGLE_TYPE_WMO
- };
-
- enum PolyArea
- {
- POLY_AREA_TERRAIN = 1,
- POLY_AREA_WATER = 2,
- POLY_AREA_ROAD = 3,
- POLY_AREA_DANGER = 4,
- };
-
- enum PolyFlag
- {
- POLY_FLAG_WALK = 1,
- POLY_FLAG_SWIM = 2,
- POLY_FLAG_FLIGHTMASTER = 4
- };
-
- enum ExtractFlags
- {
- EXTRACT_FLAG_DBC = 0x01,
- EXTRACT_FLAG_MAPS = 0x02,
- EXTRACT_FLAG_VMAPS = 0x04,
- EXTRACT_FLAG_GOB_MODELS = 0x08,
- EXTRACT_FLAG_MMAPS = 0x10,
- EXTRACT_FLAG_TEST = 0x20,
- EXTRACT_FLAG_ALLOWED = EXTRACT_FLAG_DBC | EXTRACT_FLAG_MAPS | EXTRACT_FLAG_VMAPS | EXTRACT_FLAG_GOB_MODELS | EXTRACT_FLAG_MMAPS | EXTRACT_FLAG_TEST
- };
-
- static const float TileSize;
- static const float MaxXY;
- static const float ChunkSize;
- static const float UnitSize;
- static const float Origin[];
- static const float PI;
- static const float MaxStandableHeight;
- static bool ToWoWCoords;
- static bool Debug;
- static const char* VMAPMagic;
- static const float BaseUnitDim;
- static const int VertexPerMap;
- static const int VertexPerTile;
- static const int TilesPerMap;
-};
-
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/ContinentBuilder.cpp b/src/tools/mesh_extractor/ContinentBuilder.cpp
deleted file mode 100644
index a60a4b4ce3e..00000000000
--- a/src/tools/mesh_extractor/ContinentBuilder.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ContinentBuilder.h"
-#include "TileBuilder.h"
-#include "WDT.h"
-#include "Utils.h"
-#include "DetourNavMesh.h"
-#include "Cache.h"
-#include "ace/Task.h"
-#include "Recast.h"
-#include "DetourCommon.h"
-
-class BuilderThread : public ACE_Task_Base
-{
-private:
- int X, Y, MapId;
- std::string Continent;
- dtNavMeshParams Params;
- ContinentBuilder* cBuilder;
-public:
- BuilderThread(ContinentBuilder* _cBuilder, dtNavMeshParams& params) : Params(params), cBuilder(_cBuilder), Free(true) {}
-
- void SetData(int x, int y, int map, const std::string& cont)
- {
- X = x;
- Y = y;
- MapId = map;
- Continent = cont;
- }
-
- int svc()
- {
- Free = false;
- printf("[%02i,%02i] Building tile\n", X, Y);
- TileBuilder builder(cBuilder, Continent, X, Y, MapId);
- char buff[100];
- sprintf(buff, "mmaps/%03u%02i%02i.mmtile", MapId, Y, X);
- FILE* f = fopen(buff, "r");
- if (f) // Check if file already exists.
- {
- printf("[%02i,%02i] Tile skipped, file already exists\n", X, Y);
- fclose(f);
- Free = true;
- return 0;
- }
- uint8* nav = builder.BuildTiled(Params);
- if (nav)
- {
- f = fopen(buff, "wb");
- if (!f)
- {
- printf("Could not create file %s. Check that you have write permissions to the destination folder and try again\n", buff);
- return 0;
- }
- MmapTileHeader header;
- header.size = builder.DataSize;
- fwrite(&header, sizeof(MmapTileHeader), 1, f);
- fwrite(nav, sizeof(unsigned char), builder.DataSize, f);
- fclose(f);
- }
- dtFree(nav);
- printf("[%02i,%02i] Tile Built!\n", X, Y);
- Free = true;
- return 0;
- }
-
- bool Free;
-};
-
-void ContinentBuilder::getTileBounds(uint32 tileX, uint32 tileY, float* verts, int vertCount, float* bmin, float* bmax)
-{
- // this is for elevation
- if (verts && vertCount)
- rcCalcBounds(verts, vertCount, bmin, bmax);
- else
- {
- bmin[1] = FLT_MIN;
- bmax[1] = FLT_MAX;
- }
-
- // this is for width and depth
- bmax[0] = (32 - int(tileX)) * Constants::TileSize;
- bmax[2] = (32 - int(tileY)) * Constants::TileSize;
- bmin[0] = bmax[0] - Constants::TileSize;
- bmin[2] = bmax[2] - Constants::TileSize;
-}
-
-void ContinentBuilder::CalculateTileBounds()
-{
- for (std::vector<TilePos>::iterator itr = TileMap->TileTable.begin(); itr != TileMap->TileTable.end(); ++itr)
- {
- tileXMax = std::max(itr->X, tileXMax);
- tileXMin = std::min(itr->X, tileXMin);
-
- tileYMax = std::max(itr->Y, tileYMax);
- tileYMin = std::min(itr->Y, tileYMin);
- }
- getTileBounds(tileXMax, tileYMax, NULL, 0, bmin, bmax);
-}
-
-void ContinentBuilder::Build()
-{
- char buff[50];
- sprintf(buff, "mmaps/%03u.mmap", MapId);
- FILE* mmap = fopen(buff, "wb");
- if (!mmap)
- {
- printf("Could not create file %s. Check that you have write permissions to the destination folder and try again\n", buff);
- return;
- }
-
- CalculateTileBounds();
-
- dtNavMeshParams params;
-
- std::vector<BuilderThread*> Threads;
-
- if (TileMap->IsGlobalModel)
- {
- printf("Map %s ( %u ) is a WMO. Building with 1 thread.\n", Continent.c_str(), MapId);
-
- TileBuilder* builder = new TileBuilder(this, Continent, 0, 0, MapId);
- builder->AddGeometry(TileMap->Model, TileMap->ModelDefinition);
- uint8* nav = builder->BuildInstance(params);
- if (nav)
- {
- // Set some params for the navmesh
- dtMeshHeader* header = (dtMeshHeader*)nav;
- dtVcopy(params.orig, header->bmin);
- params.tileWidth = header->bmax[0] - header->bmin[0];
- params.tileHeight = header->bmax[2] - header->bmin[2];
- params.maxTiles = 1;
- params.maxPolys = header->polyCount;
- fwrite(&params, sizeof(dtNavMeshParams), 1, mmap);
- fclose(mmap);
-
- char buff[100];
- sprintf(buff, "mmaps/%03u%02i%02i.mmtile", MapId, 0, 0);
- FILE* f = fopen(buff, "wb");
- if (!f)
- {
- printf("Could not create file %s. Check that you have write permissions to the destination folder and try again\n", buff);
- return;
- }
-
- MmapTileHeader mheader;
- mheader.size = builder->DataSize;
- fwrite(&mheader, sizeof(MmapTileHeader), 1, f);
- fwrite(nav, sizeof(unsigned char), builder->DataSize, f);
- fclose(f);
- }
-
- dtFree(nav);
- delete builder;
- }
- else
- {
- params.maxPolys = 32768;
- params.maxTiles = 4096;
- rcVcopy(params.orig, Constants::Origin);
- params.tileHeight = Constants::TileSize;
- params.tileWidth = Constants::TileSize;
- fwrite(&params, sizeof(dtNavMeshParams), 1, mmap);
- fclose(mmap);
-
- for (uint32 i = 0; i < NumberOfThreads; ++i)
- Threads.push_back(new BuilderThread(this, params));
- printf("Map %s ( %u ) has %u tiles. Building them with %u threads\n", Continent.c_str(), MapId, uint32(TileMap->TileTable.size()), NumberOfThreads);
- for (std::vector<TilePos>::iterator itr = TileMap->TileTable.begin(); itr != TileMap->TileTable.end(); ++itr)
- {
- bool next = false;
- while (!next)
- {
- for (std::vector<BuilderThread*>::iterator _th = Threads.begin(); _th != Threads.end(); ++_th)
- {
- if ((*_th)->Free)
- {
- (*_th)->SetData(itr->X, itr->Y, MapId, Continent);
- (*_th)->activate();
- next = true;
- break;
- }
- }
- // Wait for 20 seconds
- ACE_OS::sleep(ACE_Time_Value (0, 20000));
- }
- }
- }
-
- Cache->Clear();
-
- // Free memory
- for (std::vector<BuilderThread*>::iterator _th = Threads.begin(); _th != Threads.end(); ++_th)
- {
- (*_th)->wait();
- delete *_th;
- }
-}
diff --git a/src/tools/mesh_extractor/ContinentBuilder.h b/src/tools/mesh_extractor/ContinentBuilder.h
deleted file mode 100644
index a2f6512a8dd..00000000000
--- a/src/tools/mesh_extractor/ContinentBuilder.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef CONT_BUILDER_H
-#define CONT_BUILDER_H
-#include <string>
-#include "WDT.h"
-#include "Define.h"
-
-class ContinentBuilder
-{
-public:
- ContinentBuilder(std::string continent, uint32 mapId, WDT* wdt, uint32 tn) :
- Continent(continent), TileMap(wdt), MapId(mapId),
- NumberOfThreads(tn), tileXMin(64), tileYMin(64), tileXMax(0), tileYMax(0)
- {}
-
- void Build();
- void getTileBounds(uint32 tileX, uint32 tileY, float* verts, int vertCount, float* bmin, float* bmax);
- void CalculateTileBounds();
- float bmin[3];
- float bmax[3];
-private:
- std::string Continent;
- WDT* TileMap;
- uint32 MapId;
- uint32 NumberOfThreads;
- int tileXMin;
- int tileYMin;
- int tileXMax;
- int tileYMax;
-};
-#endif
diff --git a/src/tools/mesh_extractor/DBC.cpp b/src/tools/mesh_extractor/DBC.cpp
deleted file mode 100644
index b87015310c9..00000000000
--- a/src/tools/mesh_extractor/DBC.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <cstdio>
-#include "DBC.h"
-#include "Define.h"
-
-DBC::DBC( FILE* stream ) : StringBlock(NULL), StringBlockSize(0), IsFaulty(true)
-{
- char magic[5];
- uint32 count = 0;
- count += fread(&magic, sizeof(char), 4, stream);
- magic[4] = '\0';
- count += fread(&RecordCount, sizeof(uint32), 1, stream);
- Records.reserve(RecordCount);
- count += fread(&Fields, sizeof(uint32), 1, stream);
- count += fread(&RecordSize, sizeof(uint32), 1, stream);
- count += fread(&StringBlockSize, sizeof(uint32), 1, stream);
- if (count != 8)
- printf("DBC::DBC: Failed to read some data expected 8, read %u\n", count);
-
- for (int i = 0; i < RecordCount; i++)
- {
- Record* rec = new Record(this);
- Records.push_back(rec);
- int size = 0;
- for (int f = 0; f < Fields; f++)
- {
- if (size + 4 > RecordSize)
- {
- IsFaulty = true;
- break;
- }
- uint32 tmp;
- if (fread(&tmp, sizeof(uint32), 1, stream) != 1)
- printf("DBC::DBC: Failed to read some data expected 1, read 0\n");
- rec->Values.push_back(tmp);
- size += 4;
- }
- }
- StringBlock = new uint8[StringBlockSize];
- count = fread(StringBlock, sizeof(uint8), StringBlockSize, stream);
- if (count != StringBlockSize)
- printf("DBC::DBC: Failed to read some data expected %u, read %u\n", StringBlockSize, count);
-}
-
-std::string DBC::GetStringByOffset( int offset )
-{
- int len = 0;
- for (uint32 i = offset; i < StringBlockSize; i++)
- {
- if (!StringBlock[i])
- {
- len = (i - offset);
- break;
- }
- }
- char* d = new char[len+1];
- strcpy(d, (const char*)(StringBlock + offset));
- d[len] = '\0';
- std::string val = std::string(d);
- delete [] d;
- return val;
-}
-
-Record* DBC::GetRecordById( int id )
-{
- // we assume Id is index 0
- for (std::vector<Record*>::iterator itr = Records.begin(); itr != Records.end(); ++itr)
- if ((*itr)->Values[0] == id)
- return *itr;
- return NULL;
-}
diff --git a/src/tools/mesh_extractor/DBC.h b/src/tools/mesh_extractor/DBC.h
deleted file mode 100644
index df72800c54c..00000000000
--- a/src/tools/mesh_extractor/DBC.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef DBC_H
-#define DBC_H
-#include <vector>
-#include <string>
-#include "Define.h"
-
-class Record;
-
-class DBC
-{
-public:
- DBC(FILE* stream);
-
- std::string GetStringByOffset(int offset);
-
- Record* GetRecordById(int id);
-
- std::string Name;
- std::vector<Record*> Records;
- int RecordCount;
- int Fields;
- int RecordSize;
- uint8* StringBlock;
- uint32 StringBlockSize;
- bool IsFaulty;
-};
-
-class Record
-{
-public:
- Record(DBC* dbc) : Source(dbc) {}
-
- DBC* Source;
- std::vector<int> Values;
-
- int operator[](int index)
- {
- return Values[index];
- }
-
- template <typename T>
- T GetValue(int index)
- {
- return *(T*)(&Values[index]);
- }
-
- std::string GetString(int index)
- {
- return Source->GetStringByOffset(Values[index]);
- }
-};
-
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/DoodadHandler.cpp b/src/tools/mesh_extractor/DoodadHandler.cpp
deleted file mode 100644
index 72b5ce2fcc6..00000000000
--- a/src/tools/mesh_extractor/DoodadHandler.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "DoodadHandler.h"
-#include "Chunk.h"
-#include "Cache.h"
-#include "Model.h"
-#include "G3D/Matrix4.h"
-
-DoodadHandler::DoodadHandler( ADT* adt ) :
- ObjectDataHandler(adt), _definitions(NULL), _paths(NULL)
-{
- Chunk* mddf = adt->ObjectData->GetChunkByName("MDDF");
- if (mddf)
- ReadDoodadDefinitions(mddf);
-
- Chunk* mmid = adt->ObjectData->GetChunkByName("MMID");
- Chunk* mmdx = adt->ObjectData->GetChunkByName("MMDX");
- if (mmid && mmdx)
- ReadDoodadPaths(mmid, mmdx);
-}
-
-void DoodadHandler::ProcessInternal( MapChunk* mcnk )
-{
- if (!IsSane())
- return;
-
- uint32 refCount = mcnk->Header.DoodadRefs;
- FILE* stream = mcnk->Source->GetStream();
- fseek(stream, mcnk->Source->Offset + mcnk->Header.OffsetMCRF, SEEK_SET);
- for (uint32 i = 0; i < refCount; i++)
- {
- int32 index;
- int32 count;
- if ((count = fread(&index, sizeof(int32), 1, stream)) != 1)
- printf("DoodadHandler::ProcessInternal: Failed to read some data expected 1, read %d\n", count);
- if (index < 0 || uint32(index) >= _definitions->size())
- continue;
- DoodadDefinition doodad = (*_definitions)[index];
- if (_drawn.find(doodad.UniqueId) != _drawn.end())
- continue;
- _drawn.insert(doodad.UniqueId);
- if (doodad.MmidIndex >= _paths->size())
- continue;
-
- std::string path = (*_paths)[doodad.MmidIndex];
- Model* model = Cache->ModelCache.Get(path);
- if (!model)
- {
- model = new Model(path);
- Cache->ModelCache.Insert(path, model);
- }
- if (!model->IsCollidable)
- continue;
-
- Vertices.reserve(refCount * model->Vertices.size() * 0.2);
- Triangles.reserve(refCount * model->Triangles.size() * 0.2);
-
- InsertModelGeometry(doodad, model);
- }
- // Restore the stream position
- fseek(stream, mcnk->Source->Offset, SEEK_SET);
-}
-
-void DoodadHandler::ReadDoodadDefinitions( Chunk* chunk )
-{
- int32 count = chunk->Length / 36;
- _definitions = new std::vector<DoodadDefinition>;
- _definitions->reserve(count);
- FILE* stream = chunk->GetStream();
- for (int i = 0; i < count; i++)
- {
- DoodadDefinition def;
- def.Read(stream);
- _definitions->push_back(def);
- }
-}
-
-void DoodadHandler::ReadDoodadPaths( Chunk* id, Chunk* data )
-{
- int paths = id->Length / 4;
- _paths = new std::vector<std::string>();
- _paths->reserve(paths);
- for (int i = 0; i < paths; i++)
- {
- FILE* idStream = id->GetStream();
- fseek(idStream, i * 4, SEEK_CUR);
- uint32 offset;
- if (fread(&offset, sizeof(uint32), 1, idStream) != 1)
- printf("DoodadHandler::ReadDoodadPaths: Failed to read some data expected 1, read 0\n");
- FILE* dataStream = data->GetStream();
- fseek(dataStream, offset + data->Offset, SEEK_SET);
- _paths->push_back(Utils::ReadString(dataStream));
- }
-}
-
-void DoodadHandler::InsertModelGeometry(const DoodadDefinition& def, Model* model)
-{
- uint32 vertOffset = Vertices.size();
-
- for (std::vector<Vector3>::iterator itr = model->Vertices.begin(); itr != model->Vertices.end(); ++itr)
- Vertices.push_back(Utils::TransformDoodadVertex(def, *itr)); // Vertices have to be converted based on the information from the DoodadDefinition struct
-
- for (std::vector<Triangle<uint16> >::iterator itr = model->Triangles.begin(); itr != model->Triangles.end(); ++itr)
- Triangles.push_back(Triangle<uint32>(Constants::TRIANGLE_TYPE_DOODAD, itr->V0 + vertOffset, itr->V1 + vertOffset, itr->V2 + vertOffset));
-}
-
-DoodadHandler::~DoodadHandler()
-{
- delete _definitions;
- delete _paths;
-}
diff --git a/src/tools/mesh_extractor/DoodadHandler.h b/src/tools/mesh_extractor/DoodadHandler.h
deleted file mode 100644
index f37d5d0f707..00000000000
--- a/src/tools/mesh_extractor/DoodadHandler.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef DOOADHNDL_H
-#define DOOADHNDL_H
-#include "ObjectDataHandler.h"
-#include "Utils.h"
-#include "Chunk.h"
-#include "Model.h"
-#include <set>
-#include <vector>
-
-class DoodadDefinition : public IDefinition
-{
-public:
- uint32 MmidIndex;
- uint32 UniqueId;
- uint16 DecimalScale;
- uint16 Flags;
-
- virtual float Scale() const { return DecimalScale / 1024.0f; }
-
- Vector3 FixCoords(Vector3& vec)
- {
- return Vector3(vec.z, vec.x, vec.y);
- }
-
- void Read(FILE* stream)
- {
- int count = 0;
-
- count += fread(&MmidIndex, sizeof(uint32), 1, stream);
- count += fread(&UniqueId, sizeof(uint32), 1, stream);
- Position = (Vector3::Read(stream));
- Rotation = Vector3::Read(stream);
- count += fread(&DecimalScale, sizeof(uint16), 1, stream);
- count += fread(&Flags, sizeof(uint16), 1, stream);
- if (count != 4)
- printf("DoodadDefinition::Read: Failed to read some data expected 4, read %d\n", count);
- }
-};
-
-class DoodadHandler : public ObjectDataHandler
-{
-public:
- DoodadHandler(ADT* adt);
- ~DoodadHandler();
-
- std::vector<Vector3> Vertices;
- std::vector<Triangle<uint32> > Triangles;
- bool IsSane() { return _definitions && _paths; }
-
-
-protected:
- void ProcessInternal(MapChunk* chunk);
-
-private:
- void ReadDoodadDefinitions(Chunk* chunk);
- void ReadDoodadPaths(Chunk* id, Chunk* data);
- void InsertModelGeometry(const DoodadDefinition& def, Model* model);
- std::set<uint32> _drawn;
- std::vector<DoodadDefinition>* _definitions;
- std::vector<std::string>* _paths;
-};
-#endif
diff --git a/src/tools/mesh_extractor/Geometry.cpp b/src/tools/mesh_extractor/Geometry.cpp
deleted file mode 100644
index b037c44e630..00000000000
--- a/src/tools/mesh_extractor/Geometry.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Geometry.h"
-#include "Constants.h"
-#include "ADT.h"
-#include "WorldModelHandler.h"
-#include "DoodadHandler.h"
-#include <limits.h>
-
-Geometry::Geometry() : Transform(false)
-{
- Vertices.reserve(10000);
- Triangles.reserve(10000);
-}
-
-void Geometry::CalculateBoundingBox( float*& min, float*& max )
-{
- min = new float[3];
- max = new float[3];
- for (int i = 0; i < 3; ++i)
- {
- max[i] = std::numeric_limits<float>::lowest();
- min[i] = std::numeric_limits<float>::max();
- }
-
- for (std::vector<Vector3>::iterator itr = Vertices.begin(); itr != Vertices.end(); ++itr)
- {
- if (itr->x > max[0])
- max[0] = itr->x;
- if (itr->x < min[0])
- min[0] = itr->x;
-
- if (itr->y > max[1])
- max[1] = itr->y;
- if (itr->y < min[1])
- min[1] = itr->y;
-
- if (itr->z > max[2])
- max[2] = itr->z;
- if (itr->z < min[2])
- min[2] = itr->z;
- }
-}
-
-void Geometry::CalculateMinMaxHeight( float& min, float& max )
-{
- min = std::numeric_limits<float>::max();
- max = std::numeric_limits<float>::lowest();
-
- for (std::vector<Vector3>::iterator itr = Vertices.begin(); itr != Vertices.end(); ++itr)
- {
- if (Transform)
- {
- if (itr->y < min)
- min = itr->y;
- if (itr->y > max)
- max = itr->y;
- }
- else
- {
- if (itr->z < min)
- min = itr->z;
- if (itr->z > max)
- max = itr->z;
- }
- }
-}
-
-void Geometry::AddData( std::vector<Vector3>& verts, std::vector<Triangle<uint32> >& tris )
-{
- uint32 vertOffset = Vertices.size();
- for (std::vector<Vector3>::iterator itr = verts.begin(); itr != verts.end(); ++itr)
- Vertices.push_back(Transform ? Utils::ToRecast(*itr) : *itr);
-
- for (std::vector<Triangle<uint32> >::iterator itr = tris.begin(); itr != tris.end(); ++itr)
- Triangles.push_back(Triangle<uint32>(itr->Type, itr->V0 + vertOffset, itr->V1 + vertOffset, itr->V2 + vertOffset));
-}
-
-void Geometry::GetRawData( float*& verts, int*& tris, uint8*& areas )
-{
- verts = new float[Vertices.size() * 3];
- for (uint32 i = 0; i < Vertices.size(); ++i)
- {
- Vector3& vert = Vertices[i];
- verts[(i * 3) + 0] = vert.x;
- verts[(i * 3) + 1] = vert.y;
- verts[(i * 3) + 2] = vert.z;
- }
-
- tris = new int[Triangles.size() * 3];
- for (uint32 i = 0; i < Triangles.size(); ++i)
- {
- Triangle<uint32>& tri = Triangles[i];
- tris[(i * 3) + 0] = (int)tri.V0;
- tris[(i * 3) + 1] = (int)tri.V1;
- tris[(i * 3) + 2] = (int)tri.V2;
- }
-
- areas = new uint8[Triangles.size()];
- for (uint32 i = 0; i < Triangles.size(); i++)
- {
- switch (Triangles[i].Type)
- {
- case Constants::TRIANGLE_TYPE_WATER:
- areas[i] = Constants::POLY_AREA_WATER;
- break;
- default:
- areas[i] = Constants::POLY_AREA_TERRAIN;
- break;
- }
- }
-}
-
-void Geometry::AddAdt( ADT* adt )
-{
- for (std::vector<MapChunk*>::iterator itr = adt->MapChunks.begin(); itr != adt->MapChunks.end(); ++itr)
- {
- std::vector<Triangle<uint32> > tmp;
- tmp.reserve((*itr)->Triangles.size());
- for (std::vector<Triangle<uint8> >::iterator itr2 = (*itr)->Triangles.begin(); itr2 != (*itr)->Triangles.end(); ++itr2)
- tmp.push_back(Triangle<uint32>(itr2->Type, itr2->V0, itr2->V1, itr2->V2));
- AddData((*itr)->Vertices, tmp);
- }
-
- if (!adt->_DoodadHandler->Triangles.empty())
- AddData(adt->_DoodadHandler->Vertices, adt->_DoodadHandler->Triangles);
-
- if (!adt->_WorldModelHandler->Triangles.empty())
- AddData(adt->_WorldModelHandler->Vertices, adt->_WorldModelHandler->Triangles);
-}
-
diff --git a/src/tools/mesh_extractor/Geometry.h b/src/tools/mesh_extractor/Geometry.h
deleted file mode 100644
index 0bef60e16fd..00000000000
--- a/src/tools/mesh_extractor/Geometry.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef GEOMETRY_H
-#define GEOMETRY_H
-#include <vector>
-
-#include "Utils.h"
-
-class ADT;
-class Geometry
-{
-public:
- Geometry();
-
- void CalculateBoundingBox(float*& min, float*& max);
- void CalculateMinMaxHeight(float& min, float& max);
- void AddData(std::vector<Vector3>& verts, std::vector<Triangle<uint32> >& tris);
- void AddAdt(ADT* adt);
- void GetRawData(float*& verts, int*& tris, uint8*& areas);
-
- std::vector<Vector3> Vertices;
- std::vector<Triangle<uint32> > Triangles;
- bool Transform;
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/LiquidHandler.cpp b/src/tools/mesh_extractor/LiquidHandler.cpp
deleted file mode 100644
index 1025c10da55..00000000000
--- a/src/tools/mesh_extractor/LiquidHandler.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "LiquidHandler.h"
-#include "Utils.h"
-
-LiquidHandler::LiquidHandler( ADT* adt ) : Source(adt)
-{
- HandleNewLiquid();
-}
-
-void LiquidHandler::HandleNewLiquid()
-{
- Chunk* chunk = Source->Data->GetChunkByName("MH2O");
- if (!chunk)
- return;
-
- Vertices.reserve(1000);
- Triangles.reserve(1000);
-
- FILE* stream = chunk->GetStream();
- H2OHeader header[256];
- MCNKData.reserve(256);
- for (int i = 0; i < 256; i++)
- header[i] = H2OHeader::Read(stream);
-
- for (int i = 0; i < 256; i++)
- {
- H2OHeader h = header[i];
- if (h.LayerCount == 0)
- {
- // Need to fill in missing data with dummies.
- MCNKData.push_back(MCNKLiquidData(NULL, H2ORenderMask()));
- continue;
- }
- fseek(stream, chunk->Offset + h.OffsetInformation, SEEK_SET);
- H2OInformation information = H2OInformation::Read(stream);
-
- float** heights = new float*[9];
- for (int j = 0; j < 9; ++j)
- {
- heights[j] = new float[9];
- memset(heights[j], 0, sizeof(float) * 9);
- }
-
- H2ORenderMask renderMask;
- if (information.LiquidType != 2)
- {
- fseek(stream, chunk->Offset + h.OffsetRender, SEEK_SET);
- renderMask = H2ORenderMask::Read(stream);
- if ((Utils::IsAllZero(renderMask.Mask, 8) || (information.Width == 8 && information.Height == 8)) && information.OffsetMask2)
- {
- fseek(stream, chunk->Offset + information.OffsetMask2, SEEK_SET);
- uint32 size = ceil(information.Width * information.Height / 8.0f);
- uint8* altMask = new uint8[size];
- if (fread(altMask, sizeof(uint8), size, stream) == size)
- for (uint32 mi = 0; mi < size; mi++)
- renderMask.Mask[mi + information.OffsetY] |= altMask[mi];
- delete[] altMask;
- }
- fseek(stream, chunk->Offset + information.OffsetHeightmap, SEEK_SET);
-
- for (int y = information.OffsetY; y < (information.OffsetY + information.Height); y++)
- for (int x = information.OffsetX; x < (information.OffsetX + information.Width); x++)
- if (fread(&heights[x][y], sizeof(float), 1, stream) != 1)
- return;
- }
- else
- {
- // Fill with ocean data
- for (uint32 i = 0; i < 8; ++i)
- renderMask.Mask[i] = 0xFF;
-
- for (uint32 y = 0; y < 9; ++y)
- for (uint32 x = 0; x < 9; ++x)
- heights[x][y] = information.HeightLevel1;
- }
-
- MCNKData.push_back(MCNKLiquidData(heights, renderMask));
-
- for (int y = information.OffsetY; y < (information.OffsetY + information.Height); y++)
- {
- for (int x = information.OffsetX; x < (information.OffsetX + information.Width); x++)
- {
- if (!renderMask.ShouldRender(x, y))
- continue;
-
- MapChunk* mapChunk = Source->MapChunks[i];
- Vector3 location = mapChunk->Header.Position;
- location.y = location.y - (x * Constants::UnitSize);
- location.x = location.x - (y * Constants::UnitSize);
- location.z = heights[x][y];
-
- uint32 vertOffset = Vertices.size();
- Vertices.push_back(location);
- Vertices.push_back(Vector3(location.x - Constants::UnitSize, location.y, location.z));
- Vertices.push_back(Vector3(location.x, location.y - Constants::UnitSize, location.z));
- Vertices.push_back(Vector3(location.x - Constants::UnitSize, location.y - Constants::UnitSize, location.z));
-
- Triangles.push_back(Triangle<uint32>(Constants::TRIANGLE_TYPE_WATER, vertOffset, vertOffset+2, vertOffset + 1));
- Triangles.push_back(Triangle<uint32>(Constants::TRIANGLE_TYPE_WATER, vertOffset + 2, vertOffset + 3, vertOffset + 1));
- }
- }
- }
-}
diff --git a/src/tools/mesh_extractor/LiquidHandler.h b/src/tools/mesh_extractor/LiquidHandler.h
deleted file mode 100644
index 61fdd213c6b..00000000000
--- a/src/tools/mesh_extractor/LiquidHandler.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef LIQUID_H
-#define LIQUID_H
-#include "ADT.h"
-#include "Utils.h"
-#include "Define.h"
-
-#include <vector>
-
-class LiquidHandler
-{
-public:
- LiquidHandler(ADT* adt);
-
- ADT* Source;
- std::vector<Vector3> Vertices;
- std::vector<Triangle<uint32> > Triangles;
- std::vector<MCNKLiquidData> MCNKData;
-private:
- void HandleNewLiquid();
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/MPQ.cpp b/src/tools/mesh_extractor/MPQ.cpp
deleted file mode 100644
index 7bb882ac703..00000000000
--- a/src/tools/mesh_extractor/MPQ.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "MPQ.h"
-#include "MPQManager.h"
-#include <deque>
-#include <cstdio>
-
-MPQArchive::MPQArchive(const char* filename)
-{
- int result = libmpq__archive_open(&mpq_a, filename, -1);
- printf("Opening %s\n", filename);
- if (result)
- {
- switch (result)
- {
- case LIBMPQ_ERROR_OPEN :
- printf("Error opening archive '%s': Does file really exist?\n", filename);
- break;
- case LIBMPQ_ERROR_FORMAT : /* bad file format */
- printf("Error opening archive '%s': Bad file format\n", filename);
- break;
- case LIBMPQ_ERROR_SEEK : /* seeking in file failed */
- printf("Error opening archive '%s': Seeking in file failed\n", filename);
- break;
- case LIBMPQ_ERROR_READ : /* Read error in archive */
- printf("Error opening archive '%s': Read error in archive\n", filename);
- break;
- case LIBMPQ_ERROR_MALLOC : /* maybe not enough memory? :) */
- printf("Error opening archive '%s': Maybe not enough memory\n", filename);
- break;
- default:
- printf("Error opening archive '%s': Unknown error\n", filename);
- break;
- }
- }
- GetFileListTo(Files);
-}
-
-void MPQArchive::close()
-{
- libmpq__archive_close(mpq_a);
-}
-
-MPQFile::MPQFile(const char* filename):
-eof(false), buffer(0), pointer(0), size(0)
-{
- for (std::deque<MPQArchive*>::iterator i = MPQHandler->Archives.begin(); i != MPQHandler->Archives.end();++i)
- {
- mpq_archive* mpq_a = (*i)->mpq_a;
-
- uint32_t filenum;
- if(libmpq__file_number(mpq_a, filename, &filenum))
- continue;
- libmpq__off_t transferred;
- libmpq__file_unpacked_size(mpq_a, filenum, &size);
-
- // HACK: in patch.mpq some files don't want to open and give 1 for filesize
- if (size<=1) {
- // printf("warning: file %s has size %d; cannot Read.\n", filename, size);
- eof = true;
- buffer = 0;
- return;
- }
- buffer = new char[size];
-
- //libmpq_file_getdata
- libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred);
- /*libmpq_file_getdata(&mpq_a, hash, fileno, (unsigned char*)buffer);*/
- return;
-
- }
- eof = true;
- buffer = 0;
-}
-
-size_t MPQFile::Read(void* dest, size_t bytes)
-{
- if (eof)
- return 0;
-
- size_t rpos = pointer + bytes;
- if (rpos > size_t(size)) {
- bytes = size - pointer;
- eof = true;
- }
-
- memcpy(dest, &(buffer[pointer]), bytes);
-
- pointer = rpos;
-
- return bytes;
-}
-
-void MPQFile::seek(int offset)
-{
- pointer = offset;
- eof = (pointer >= size);
-}
-
-void MPQFile::seekRelative(int offset)
-{
- pointer += offset;
- eof = (pointer >= size);
-}
-
-void MPQFile::close()
-{
- delete[] buffer;
- buffer = 0;
- eof = true;
-}
-
-FILE* MPQFile::GetFileStream()
-{
- FILE* file = tmpfile();
- if (!file)
- {
- printf("Could not create temporary file. Please run as Administrator or root\n");
- exit(1);
- }
- fwrite(buffer, sizeof(char), size, file);
- fseek(file, 0, SEEK_SET);
- return file;
-}
diff --git a/src/tools/mesh_extractor/MPQ.h b/src/tools/mesh_extractor/MPQ.h
deleted file mode 100644
index a5a9c7a77d8..00000000000
--- a/src/tools/mesh_extractor/MPQ.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef MPQ_H
-#define MPQ_H
-
-#include "libmpq/mpq.h"
-#include "Define.h"
-#include <string>
-#include <ctype.h>
-#include <vector>
-#include <iostream>
-#include <deque>
-
-class MPQArchive
-{
-
-public:
- mpq_archive_s *mpq_a;
-
- std::vector<std::string> Files;
-
- MPQArchive(const char* filename);
- void close();
-
- void GetFileListTo(std::vector<std::string>& filelist) {
- uint32_t filenum;
- if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return;
- libmpq__off_t size, transferred;
- libmpq__file_unpacked_size(mpq_a, filenum, &size);
-
- char* buffer = new char[size + 1];
- buffer[size] = '\0';
-
- libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred);
-
- char seps[] = "\n";
- char* token;
-
- token = strtok( buffer, seps );
- uint32 counter = 0;
- while ((token != NULL) && (counter < size)) {
- //cout << token << endl;
- token[strlen(token) - 1] = 0;
- std::string s = token;
- filelist.push_back(s);
- counter += strlen(token) + 2;
- token = strtok(NULL, seps);
- }
-
- delete[] buffer;
- }
-};
-
-class MPQFile
-{
- //MPQHANDLE handle;
- bool eof;
- char *buffer;
- libmpq__off_t pointer,size;
-
- // disable copying
- MPQFile(const MPQFile& /*f*/) {}
- void operator=(const MPQFile& /*f*/) {}
-
-public:
- MPQFile(const char* filename); // filenames are not case sensitive
- ~MPQFile() { close(); }
- size_t Read(void* dest, size_t bytes);
- FILE* GetFileStream();
- size_t getSize() { return size; }
- size_t getPos() { return pointer; }
- char* getBuffer() { return buffer; }
- char* getPointer() { return buffer + pointer; }
- bool isEof() { return eof; }
- void seek(int offset);
- void seekRelative(int offset);
- void close();
-};
-
-inline void flipcc(char *fcc)
-{
- char t;
- t=fcc[0];
- fcc[0]=fcc[3];
- fcc[3]=t;
- t=fcc[1];
- fcc[1]=fcc[2];
- fcc[2]=t;
-}
-
-#endif
diff --git a/src/tools/mesh_extractor/MPQManager.cpp b/src/tools/mesh_extractor/MPQManager.cpp
deleted file mode 100644
index cef6feb6427..00000000000
--- a/src/tools/mesh_extractor/MPQManager.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "MPQManager.h"
-#include "MPQ.h"
-#include "DBC.h"
-#include "Utils.h"
-#include <ace/Guard_T.h>
-
-char const* MPQManager::Files[] = {
- "common.MPQ",
- "common-2.MPQ",
- "expansion.MPQ",
- "lichking.MPQ",
- "patch.MPQ",
- "patch-2.MPQ",
- "patch-3.MPQ"
-};
-
-char const* MPQManager::Languages[] = { "enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU" };
-
-void MPQManager::Initialize()
-{
- InitializeDBC();
- uint32 size = sizeof(Files) / sizeof(char*);
- for (uint32 i = 0; i < size; ++i)
- {
- MPQArchive* arc = new MPQArchive(std::string("Data/" + std::string(Files[i])).c_str());
- Archives.push_front(arc); // MPQ files have to be transversed in reverse order to properly account for patched files
- printf("Opened %s\n", Files[i]);
- }
-}
-
-void MPQManager::InitializeDBC()
-{
- BaseLocale = -1;
- std::string fileName;
- uint32 size = sizeof(Languages) / sizeof(char*);
- MPQArchive* _baseLocale = NULL;
- for (uint32 i = 0; i < size; ++i)
- {
- std::string _fileName = "Data/" + std::string(Languages[i]) + "/locale-" + std::string(Languages[i]) + ".MPQ";
- FILE* file = fopen(_fileName.c_str(), "rb");
- if (file)
- {
- if (BaseLocale == -1)
- {
- BaseLocale = i;
- _baseLocale = new MPQArchive(_fileName.c_str());
- fileName = _fileName;
- LocaleFiles[i] = _baseLocale;
- }
- else
- LocaleFiles[i] = new MPQArchive(_fileName.c_str());
-
- AvailableLocales.insert(i);
- printf("Detected locale: %s\n", Languages[i]);
- }
- }
- Archives.push_front(_baseLocale);
- if (BaseLocale == -1)
- {
- printf("No locale data detected. Please make sure that the executable is in the same folder as your WoW installation.\n");
- ASSERT(false);
- }
- else
- printf("Using default locale: %s\n", Languages[BaseLocale]);
-}
-
-FILE* MPQManager::GetFile(const std::string& path )
-{
- ACE_GUARD_RETURN(ACE_Thread_Mutex, g, mutex, NULL);
- MPQFile file(path.c_str());
- if (file.isEof())
- return NULL;
- return file.GetFileStream();
-}
-
-DBC* MPQManager::GetDBC(const std::string& name )
-{
- std::string path = "DBFilesClient\\" + name + ".dbc";
- return new DBC(GetFile(path));
-}
-
-FILE* MPQManager::GetFileFrom(const std::string& path, MPQArchive* file )
-{
- ACE_GUARD_RETURN(ACE_Thread_Mutex, g, mutex, NULL);
- mpq_archive* mpq_a = file->mpq_a;
-
- uint32_t filenum;
- if(libmpq__file_number(mpq_a, path.c_str(), &filenum))
- return NULL;
-
- libmpq__off_t transferred;
- libmpq__off_t size = 0;
- libmpq__file_unpacked_size(mpq_a, filenum, &size);
-
- // HACK: in patch.mpq some files don't want to open and give 1 for filesize
- if (size <= 1)
- return NULL;
-
- uint8* buffer = new uint8[size];
-
- //libmpq_file_getdata
- libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred);
-
- // Pack the return into a FILE stream
- FILE* ret = tmpfile();
- if (!ret)
- {
- printf("Could not create temporary file. Please run as Administrator or root\n");
- exit(1);
- }
- fwrite(buffer, sizeof(uint8), size, ret);
- fseek(ret, 0, SEEK_SET);
- delete[] buffer;
- return ret;
-}
diff --git a/src/tools/mesh_extractor/MPQManager.h b/src/tools/mesh_extractor/MPQManager.h
deleted file mode 100644
index 43419269226..00000000000
--- a/src/tools/mesh_extractor/MPQManager.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef MPQ_MANAGER_H
-#define MPQ_MANAGER_H
-
-#include "MPQ.h"
-#include <ace/Synch.h>
-#include <set>
-#include <map>
-
-class DBC;
-class MPQManager
-{
-public:
- MPQManager() {}
- ~MPQManager() {}
-
- void Initialize();
- FILE* GetFile(const std::string& path);
- FILE* GetFileFrom(const std::string& path, MPQArchive* file);
- DBC* GetDBC(const std::string& name);
- std::vector<std::string> GetAllFiles(std::string extension);
-
- std::deque<MPQArchive*> Archives;
- int32 BaseLocale;
- std::set<uint32> AvailableLocales;
- std::map<uint32, MPQArchive*> LocaleFiles;
-
- static char const* Files[];
- static char const* Languages[];
-protected:
- void InitializeDBC();
-private:
- ACE_Thread_Mutex mutex;
-};
-
-extern MPQManager* MPQHandler;
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/MapChunk.cpp b/src/tools/mesh_extractor/MapChunk.cpp
deleted file mode 100644
index d21815ebd8a..00000000000
--- a/src/tools/mesh_extractor/MapChunk.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "MapChunk.h"
-#include "ADT.h"
-#include "LiquidHandler.h"
-
-MapChunk::MapChunk( ADT* _adt, Chunk* chunk ) : Adt(_adt), Source(chunk)
-{
- FILE* stream = chunk->GetStream();
- Header.Read(stream);
- fseek(stream, chunk->Offset, SEEK_SET);
- Index = Header.IndexX + Header.IndexY * 16;
- GenerateVertices(stream);
-}
-
-void MapChunk::GenerateTriangles()
-{
- Triangles.reserve(256);
- for (int y = 0; y < 8; y++)
- {
- for (int x = 0; x < 8; x++)
- {
- if (HasHole(Header.Holes, x / 2, y / 2))
- continue;
-
- uint32 topLeft = (17 * y) + x;
- uint32 topRight = (17 * y) + x + 1;
- uint32 bottomLeft = (17 * (y + 1)) + x;
- uint32 bottomRight = (17 * (y + 1)) + x + 1;
- uint32 center = (17 * y) + 9 + x;
-
- Constants::TriangleType triangleType = Constants::TRIANGLE_TYPE_TERRAIN;
- if (Adt->_LiquidHandler && !Adt->_LiquidHandler->MCNKData.empty())
- {
- MCNKLiquidData& data = Adt->_LiquidHandler->MCNKData[Index];
- float maxHeight = std::max(
- std::max(
- std::max(std::max(Vertices[topLeft].z, Vertices[topRight].z), Vertices[bottomLeft].z),
- Vertices[bottomRight].z), Vertices[center].z);
- if (data.IsWater(x, y, maxHeight))
- triangleType = Constants::TRIANGLE_TYPE_WATER;
- }
-
- Triangles.push_back(Triangle<uint8>(triangleType, topRight, topLeft, center));
- Triangles.push_back(Triangle<uint8>(triangleType, topLeft, bottomLeft, center));
- Triangles.push_back(Triangle<uint8>(triangleType, bottomLeft, bottomRight, center));
- Triangles.push_back(Triangle<uint8>(triangleType, bottomRight, topRight, center));
- }
- }
-}
-
-void MapChunk::GenerateVertices( FILE* stream )
-{
- fseek(stream, Header.OffsetMCVT, SEEK_CUR);
- Vertices.reserve(125);
-
- for (int j = 0; j < 17; j++)
- {
- int values = j % 2 ? 8 : 9;
- for (int i = 0; i < values; i++)
- {
- float tmp;
- if (fread(&tmp, sizeof(float), 1, stream) != 1)
- printf("MapChunk::GenerateVertices: Failed to read some data expected 1, read 0\n");
- Vector3 vert(Header.Position.x - (j * (Constants::UnitSize * 0.5f)), Header.Position.y - (i * Constants::UnitSize), Header.Position.z + tmp);
- if (values == 8)
- vert.y -= Constants::UnitSize * 0.5f;
- Vertices.push_back(vert);
- }
- }
- // Restore stream position.
- fseek(stream, Source->Offset, SEEK_SET);
-}
-
-bool MapChunk::HasHole( uint32 map, int x, int y )
-{
- return (map & 0x0000FFFF) & ((1 << x) << (y << 2));
-}
diff --git a/src/tools/mesh_extractor/MapChunk.h b/src/tools/mesh_extractor/MapChunk.h
deleted file mode 100644
index 47873178730..00000000000
--- a/src/tools/mesh_extractor/MapChunk.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef MAPCHUNK_H
-#define MAPCHUNK_H
-#include "Chunk.h"
-#include "Utils.h"
-#include "Constants.h"
-#include <vector>
-class ADT;
-
-class MapChunk
-{
-public:
- MapChunk(ADT* _adt, Chunk* chunk);
-
- void GenerateTriangles();
- void GenerateVertices(FILE* stream);
- static bool HasHole(uint32 map, int x, int y);
- ADT* Adt;
- Chunk* Source;
- MapChunkHeader Header;
- std::vector<Vector3> Vertices;
- std::vector<Triangle<uint8> > Triangles;
- int32 Index;
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/MeshExtractor.cpp b/src/tools/mesh_extractor/MeshExtractor.cpp
deleted file mode 100644
index 08afb93194b..00000000000
--- a/src/tools/mesh_extractor/MeshExtractor.cpp
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "MPQManager.h"
-#include "WDT.h"
-#include "ContinentBuilder.h"
-#include "Cache.h"
-#include "DBC.h"
-#include "Constants.h"
-#include "Model.h"
-
-#include "Recast.h"
-#include "DetourNavMesh.h"
-#include "DetourNavMeshQuery.h"
-
-#include <stdio.h>
-
-#include <set>
-
-MPQManager* MPQHandler;
-CacheClass* Cache;
-
-void ExtractMMaps(std::set<uint32>& mapIds, uint32 threads)
-{
- DBC* dbc = MPQHandler->GetDBC("Map");
- printf("Map.dbc contains %u rows.\n", dbc->Records.size());
- for (std::vector<Record*>::iterator itr = dbc->Records.begin(); itr != dbc->Records.end(); ++itr)
- {
- uint32 mapId = (*itr)->Values[0];
-
- // Skip this map if a list of specific maps was provided and this one is not contained in it.
- if (!mapIds.empty() && mapIds.find(mapId) == mapIds.end())
- {
- if (Constants::Debug)
- printf("Map %u will not be built.\n", mapId);
- continue;
- }
-
- std::string name = (*itr)->GetString(1);
- WDT wdt("World\\maps\\" + name + "\\" + name + ".wdt");
- if (!wdt.IsValid)
- {
- printf("Could not find WDT data for map %u (%s)\n", mapId, name.c_str());
- continue;
- }
- printf("Building %s MapId %u\n", name.c_str(), mapId);
- ContinentBuilder builder(name, mapId, &wdt, threads);
- builder.Build();
- }
-}
-
-void ExtractDBCs()
-{
- printf("Extracting DBCs\n");
- // Create the file system structure
- std::string baseDBCPath = "dbc/";
- Utils::CreateDir(baseDBCPath);
-
- std::set<std::string> DBCFiles;
- const size_t extLen = strlen(".dbc");
- // Populate list of DBC files
- // We get the DBC names by going over the (guaranteed to exist) default locale files
- // Then we look in other locale files in case that they are available.
- for (std::vector<std::string>::iterator itr = MPQHandler->LocaleFiles[MPQHandler->BaseLocale]->Files.begin(); itr != MPQHandler->LocaleFiles[MPQHandler->BaseLocale]->Files.end(); ++itr)
- if (itr->rfind(".dbc") == itr->length() - extLen) // Check if the extension is ".dbc"
- DBCFiles.insert(*itr);
-
- const size_t folderLen = strlen("DBFilesClient\\");
- // Iterate over all available locales
- for (std::set<uint32>::iterator itr = MPQHandler->AvailableLocales.begin(); itr != MPQHandler->AvailableLocales.end(); ++itr)
- {
- printf("Extracting DBCs for locale %s\n", MPQManager::Languages[*itr]);
- std::string path = baseDBCPath;
- if (*itr != uint32(MPQHandler->BaseLocale))
- {
- path += std::string(MPQManager::Languages[*itr]) + "/";
- Utils::CreateDir(path);
- }
-
- std::string component = "component.wow-" + std::string(MPQManager::Languages[*itr]) + ".txt";
- // Extract the component file
- Utils::SaveToDisk(MPQHandler->GetFileFrom(component, MPQHandler->LocaleFiles[*itr]), path + component);
- // Extract the DBC files for the given locale
- for (std::set<std::string>::iterator itr2 = DBCFiles.begin(); itr2 != DBCFiles.end(); ++itr2)
- Utils::SaveToDisk(MPQHandler->GetFileFrom(*itr2, MPQHandler->LocaleFiles[*itr]), path + (itr2->c_str() + folderLen));
- }
- printf("DBC extraction finished!\n");
-}
-
-void ExtractGameobjectModels()
-{
- Constants::ToWoWCoords = true;
- printf("Extracting GameObject models\n");
-
- std::string baseBuildingsPath = "Buildings/";
- std::string baseVmapsPath = "vmaps/";
- Utils::CreateDir(baseVmapsPath);
- Utils::CreateDir(baseBuildingsPath);
-
- FILE* modelList = fopen((baseVmapsPath + "GameObjectModels.list").c_str(), "wb");
- if (!modelList)
- {
- printf("Could not create file vmaps/GameObjectModels.list, please make sure that you have the write permissions in the folder\n");
- return;
- }
-
- DBC* dbc = MPQHandler->GetDBC("GameObjectDisplayInfo");
- for (std::vector<Record*>::iterator itr = dbc->Records.begin(); itr != dbc->Records.end(); ++itr)
- {
- std::string path = (*itr)->GetString(1);
- std::string fileName = Utils::GetPlainName(path.c_str());
- std::string extension = Utils::GetExtension(fileName);
- // Convert the extension to lowercase
- std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
- if (extension == "mdx" || extension == "m2")
- {
- fileName = Utils::FixModelPath(fileName);
- Model model(path);
-
- if (model.IsBad)
- continue;
-
- FILE* output = fopen((baseBuildingsPath + fileName).c_str(), "wb");
- if (!output)
- {
- printf("Could not create file %s, please check that you have write permissions\n", (baseBuildingsPath + fileName).c_str());
- continue;
- }
- // Placeholder for 0 values
- int Nop[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
- fwrite(Constants::VMAPMagic, 8, 1, output);
- uint32 numVerts = model.Header.CountBoundingVertices;
- fwrite(&numVerts, sizeof(uint32), 1, output);
- uint32 numGroups = 1;
- fwrite(&numGroups, sizeof(uint32), 1, output);
- fwrite(Nop, 4 * 3 , 1, output); // rootwmoid, flags, groupid
- fwrite(Nop, sizeof(float), 3 * 2, output);//bbox, only needed for WMO currently
- fwrite(Nop, 4, 1, output);// liquidflags
- fwrite("GRP ", 4, 1, output);
-
- uint32 branches = 1;
- uint32 wsize = sizeof(branches) + sizeof(uint32) * branches;
- fwrite(&wsize, sizeof(uint32), 1, output);
- fwrite(&branches, sizeof(branches), 1, output);
- uint32 numTris = model.Header.CountBoundingTriangles;
- fwrite(&numTris, sizeof(uint32), 1, output);
- fwrite("INDX", 4, 1, output);
- wsize = sizeof(uint32) + sizeof(unsigned short) * numTris;
- fwrite(&wsize, sizeof(int), 1, output);
- fwrite(&numTris, sizeof(uint32), 1, output);
- uint16* indices = new uint16[numTris];
-
- if (numTris > 0)
- {
- uint32 i = 0;
- for (std::vector<Triangle<uint16> >::iterator itr2 = model.Triangles.begin(); itr2 != model.Triangles.end(); ++itr2, ++i)
- {
- indices[i * 3 + 0] = itr2->V0;
- indices[i * 3 + 1] = itr2->V1;
- indices[i * 3 + 2] = itr2->V2;
- }
- fwrite(indices, sizeof(uint16), numTris, output);
- }
-
-
- fwrite("VERT", 4, 1, output);
- wsize = sizeof(int) + sizeof(float) * 3 * numVerts;
- fwrite(&wsize, sizeof(int), 1, output);
- fwrite(&numVerts, sizeof(int), 1, output);
- float* vertices = new float[numVerts*3];
-
- if (numVerts > 0)
- {
- uint32 i = 0;
- for (std::vector<Vector3>::iterator itr2 = model.Vertices.begin(); itr2 != model.Vertices.end(); ++itr2, ++i)
- {
- vertices[i * 3 + 0] = itr2->x;
- vertices[i * 3 + 1] = itr2->y;
- vertices[i * 3 + 2] = itr2->z;
- }
-
- fwrite(vertices, sizeof(float), numVerts * 3, output);
- }
-
- fclose(output);
- delete[] indices;
- delete[] vertices;
-
- uint32 displayId = (*itr)->Values[0];
- uint32 pathLength = fileName.size();
- fwrite(&displayId, sizeof(uint32), 1, modelList);
- fwrite(&pathLength, sizeof(uint32), 1, modelList);
- fwrite(fileName.c_str(), sizeof(char), pathLength, modelList);
- }
- else if (extension == "wmo")
- {
- WorldModelRoot model(path);
-
- FILE* output = fopen((baseBuildingsPath + fileName).c_str(), "wb");
- if (!output)
- {
- printf("Could not create file %s, please check that you have write permissions\n", (baseBuildingsPath + fileName).c_str());
- continue;
- }
-
- fwrite(Constants::VMAPMagic, 1, 8, output);
- uint32 numVertices = 0;
- fwrite(&numVertices, sizeof(uint32), 1, output); // will be filled later
- fwrite(&model.Header.CountGroups, sizeof(uint32), 1, output);
- fwrite(&model.Header.WmoId, sizeof(uint32), 1, output);
-
- const char grp[] = { 'G' , 'R' , 'P', ' ' };
- for (std::vector<WorldModelGroup>::iterator itr2 = model.Groups.begin(); itr2 != model.Groups.end(); ++itr2)
- {
- const WMOGroupHeader& header = itr2->Header;
- fwrite(&header.Flags, sizeof(uint32), 1, output);
- fwrite(&header.WmoId, sizeof(uint32), 1, output);
- fwrite(&header.BoundingBox[0], sizeof(uint32), 1, output);
- fwrite(&header.BoundingBox[1], sizeof(uint32), 1, output);
- uint32 LiquidFlags = itr2->HasLiquidData ? 1 : 0;
- fwrite(&LiquidFlags, sizeof(uint32), 1, output);
-
- fwrite(grp, sizeof(char), sizeof(grp), output);
- uint32 k = 0;
- uint32 mobaBatch = itr2->MOBALength / 12;
- uint32* MobaEx = new uint32[mobaBatch*4];
-
- for(uint32 i = 8; i < itr2->MOBALength; i += 12)
- MobaEx[k++] = itr2->MOBA[i];
-
- int mobaSizeGrp = mobaBatch * 4 + 4;
- fwrite(&mobaSizeGrp, 4, 1, output);
- fwrite(&mobaBatch, 4, 1, output);
- fwrite(MobaEx, 4, k, output);
- delete[] MobaEx;
-
- //@TODO: Finish this.
- }
-
- fclose(output);
- }
- }
-
- fclose(modelList);
- printf("GameObject models extraction finished!");
- Constants::ToWoWCoords = false;
-}
-
-bool HandleArgs(int argc, char** argv, uint32& threads, std::set<uint32>& mapList, bool& debugOutput, uint32& extractFlags)
-{
- char* param = NULL;
- extractFlags = 0;
-
- for (int i = 1; i < argc; ++i)
- {
- if (strcmp(argv[i], "--threads") == 0)
- {
- param = argv[++i];
- if (!param)
- return false;
-
- threads = atoi(param);
- printf("Using %u threads\n", threads);
- }
- else if (strcmp(argv[i], "--maps") == 0)
- {
- param = argv[++i];
- if (!param)
- return false;
-
- char* copy = strdup(param);
- char* token = strtok(copy, ",");
- while (token)
- {
- mapList.insert(atoi(token));
- token = strtok(NULL, ",");
- }
-
- free(copy);
-
- printf("Extracting only provided list of maps (%u).\n", uint32(mapList.size()));
- }
- else if (strcmp(argv[i], "--debug") == 0)
- {
- param = argv[++i];
- if (!param)
- return false;
- debugOutput = atoi(param);
- if (debugOutput)
- printf("Output will contain debug information (.obj files)\n");
- }
- else if (strcmp(argv[i], "--extract") == 0)
- {
- param = argv[++i];
- if (!param)
- return false;
-
- extractFlags = atoi(param);
-
- if (!(extractFlags & Constants::EXTRACT_FLAG_ALLOWED)) // Tried to use an invalid flag
- return false;
-
- printf("Detected flags: \n");
- printf("* Extract DBCs: %s\n", (extractFlags & Constants::EXTRACT_FLAG_DBC) ? "Yes" : "No");
- printf("* Extract Maps: %s\n", (extractFlags & Constants::EXTRACT_FLAG_MAPS) ? "Yes" : "No");
- printf("* Extract VMaps: %s\n", (extractFlags & Constants::EXTRACT_FLAG_VMAPS) ? "Yes" : "No");
- printf("* Extract GameObject Models: %s\n", (extractFlags & Constants::EXTRACT_FLAG_GOB_MODELS) ? "Yes" : "No");
- printf("* Extract MMaps: %s\n", (extractFlags & Constants::EXTRACT_FLAG_MMAPS) ? "Yes" : "No");
- }
- }
- return true;
-}
-
-void PrintUsage()
-{
- printf("MeshExtractor help.\n");
- printf("* Use \"--threads <number>\" to specify <number> threads, default to 4 (Only available when extracting MMaps)\n");
- printf("* Use \"--maps a,b,c,d,e\" to extract only the maps specified (Do not use spaces)\n");
- printf("* Use \"--debug 1\" to generate debug information of the tiles (Only available when extracting MMaps)\n");
- printf("* Use \"--extract X\" to extract the data specified by the flag X (Note: You can combine the flags with the bitwise OR operator |). Available flags are: \n");
- {
- printf("- %u to extract DBCs\n", Constants::EXTRACT_FLAG_DBC);
- printf("- %u to extract Maps (Not yet implemented)\n", Constants::EXTRACT_FLAG_MAPS);
- printf("- %u to extract VMaps (Not yet implemented)\n", Constants::EXTRACT_FLAG_VMAPS);
- printf("- %u to extract GameObject models (Not yet finished, you need to run VMapAssembler on the extracted files)\n", Constants::EXTRACT_FLAG_GOB_MODELS);
- printf("- %u to extract MMaps (Not yet finished)\n", Constants::EXTRACT_FLAG_MMAPS);
- }
-}
-
-void LoadTile(dtNavMesh*& navMesh, const char* tile)
-{
- FILE* f = fopen(tile, "rb");
- if (!f)
- return;
- MmapTileHeader header;
-
- if (fread(&header, sizeof(MmapTileHeader), 1, f) != 1)
- return;
-
- uint8* nav = new uint8[header.size];
- if (fread(nav, header.size, 1, f) != 1)
- return;
-
- navMesh->addTile(nav, header.size, DT_TILE_FREE_DATA, 0, NULL);
-
- fclose(f);
-}
-
-int main(int argc, char* argv[])
-{
- _setmaxstdio(2048);
- uint32 threads = 4, extractFlags = 0;
- std::set<uint32> mapIds;
-
- if (!HandleArgs(argc, argv, threads, mapIds, Constants::Debug, extractFlags))
- {
- PrintUsage();
- return -1;
- }
-
- if (extractFlags == 0)
- {
- printf("You must provide valid extract flags.\n");
- PrintUsage();
- return -1;
- }
-
- Cache = new CacheClass();
- MPQHandler = new MPQManager();
- MPQHandler->Initialize();
-
- if (extractFlags & Constants::EXTRACT_FLAG_DBC)
- ExtractDBCs();
-
- if (extractFlags & Constants::EXTRACT_FLAG_MMAPS)
- ExtractMMaps(mapIds, threads);
-
- if (extractFlags & Constants::EXTRACT_FLAG_GOB_MODELS)
- ExtractGameobjectModels();
-
- if (extractFlags & Constants::EXTRACT_FLAG_TEST)
- {
- float start[] = { 16226.200195f, 16257.000000f, 13.202200f };
- float end[] = { 16245.725586f, 16382.465820f, 47.384956f };
-
- //
- float m_spos[3];
- m_spos[0] = -start[1];
- m_spos[1] = start[2];
- m_spos[2] = -start[0];
-
- //
- float m_epos[3];
- m_epos[0] = -end[1];
- m_epos[1] = end[2];
- m_epos[2] = -end[0];
-
- //
- dtQueryFilter m_filter;
- m_filter.setIncludeFlags(Constants::POLY_AREA_ROAD | Constants::POLY_AREA_TERRAIN);
- m_filter.setExcludeFlags(Constants::POLY_AREA_WATER);
-
- //
- float m_polyPickExt[3];
- m_polyPickExt[0] = 2.5f;
- m_polyPickExt[1] = 2.5f;
- m_polyPickExt[2] = 2.5f;
-
- //
- dtPolyRef m_startRef;
- dtPolyRef m_endRef;
-
- FILE* mmap = fopen("mmaps/001.mmap", "rb");
- dtNavMeshParams params;
- int count = fread(&params, sizeof(dtNavMeshParams), 1, mmap);
- fclose(mmap);
- if (count != 1)
- {
- printf("main: Error reading from .mmap\n");
- return 0;
- }
-
- dtNavMesh* navMesh = new dtNavMesh();
- dtNavMeshQuery* navMeshQuery = new dtNavMeshQuery();
-
- navMesh->init(&params);
- for (int i = 0; i <= 32; ++i)
- {
- for (int j = 0; j <= 32; ++j)
- {
- char buff[100];
- sprintf(buff, "mmaps/001%02i%02i.mmtile", i, j);
- LoadTile(navMesh, buff);
- }
- }
-
- navMeshQuery->init(navMesh, 2048);
-
- float nearestPt[3];
-
- navMeshQuery->findNearestPoly(m_spos, m_polyPickExt, &m_filter, &m_startRef, nearestPt);
- navMeshQuery->findNearestPoly(m_epos, m_polyPickExt, &m_filter, &m_endRef, nearestPt);
-
- if ( !m_startRef || !m_endRef )
- {
- std::cerr << "Could not find any nearby poly's (" << m_startRef << "," << m_endRef << ")" << std::endl;
- return 0;
- }
-
- int hops;
- dtPolyRef* hopBuffer = new dtPolyRef[8192];
- dtStatus status = navMeshQuery->findPath(m_startRef, m_endRef, m_spos, m_epos, &m_filter, hopBuffer, &hops, 8192);
-
- int resultHopCount;
- float* straightPath = new float[2048*3];
- unsigned char* pathFlags = new unsigned char[2048];
- dtPolyRef* pathRefs = new dtPolyRef[2048];
-
- status = navMeshQuery->findStraightPath(m_spos, m_epos, hopBuffer, hops, straightPath, pathFlags, pathRefs, &resultHopCount, 2048);
- std::vector<Vector3> FinalPath;
- FinalPath.reserve(resultHopCount);
- for (uint32 i = 0; i < resultHopCount; ++i)
- {
- Vector3 finalV = Utils::ToWoWCoords(Vector3(straightPath[i * 3 + 0], straightPath[i * 3 + 1], straightPath[i * 3 + 2]));
- FinalPath.push_back(finalV);
- printf("Point %f %f %f\n", finalV.x, finalV.y, finalV.z);
- }
- }
-
- return 0;
-}
diff --git a/src/tools/mesh_extractor/Model.cpp b/src/tools/mesh_extractor/Model.cpp
deleted file mode 100644
index ce9132bd4a3..00000000000
--- a/src/tools/mesh_extractor/Model.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Model.h"
-#include "MPQManager.h"
-#include "Utils.h"
-
-Model::Model( std::string path ) : IsCollidable(false), IsBad(false)
-{
- Stream = MPQHandler->GetFile(Utils::FixModelPath(path));
- if (!Stream)
- {
- IsBad = true;
- return;
- }
- Header.Read(Stream);
- if (Header.OffsetBoundingNormals > 0 && Header.OffsetBoundingVertices > 0 &&
- Header.OffsetBoundingTriangles > 0 && Header.BoundingRadius > 0.0f)
- {
- IsCollidable = true;
- ReadVertices();
- ReadBoundingNormals();
- ReadBoundingTriangles();
- }
-}
-
-Model::~Model()
-{
- if (Stream)
- fclose(Stream);
-}
-
-void Model::ReadVertices()
-{
- fseek(Stream, Header.OffsetBoundingVertices, SEEK_SET);
- Vertices.reserve(Header.CountBoundingVertices);
- for (uint32 i = 0; i < Header.CountBoundingVertices; ++i)
- {
- Vertices.push_back(Vector3::Read(Stream));
- if (Constants::ToWoWCoords)
- Vertices[i] = Utils::ToWoWCoords(Vertices[i]);
- }
-}
-
-void Model::ReadBoundingTriangles()
-{
- fseek(Stream, Header.OffsetBoundingTriangles, SEEK_SET);
- Triangles.reserve(Header.CountBoundingTriangles / 3);
- for (uint32 i = 0; i < Header.CountBoundingTriangles / 3; i++)
- {
- Triangle<uint16> tri;
- tri.Type = Constants::TRIANGLE_TYPE_DOODAD;
- int count = 0;
- count += fread(&tri.V0, sizeof(uint16), 1, Stream);
- count += fread(&tri.V1, sizeof(uint16), 1, Stream);
- count += fread(&tri.V2, sizeof(uint16), 1, Stream);
- if (count != 3)
- printf("Model::ReadBoundingTriangles: Error reading data, expected 3, read %d\n", count);
- Triangles.push_back(tri);
- }
-}
-
-void Model::ReadBoundingNormals()
-{
- fseek(Stream, Header.OffsetBoundingNormals, SEEK_SET);
- Normals.reserve(Header.CountBoundingNormals);
- for (uint32 i = 0; i < Header.CountBoundingNormals; i++)
- Normals.push_back(Vector3::Read(Stream));
-}
-
diff --git a/src/tools/mesh_extractor/Model.h b/src/tools/mesh_extractor/Model.h
deleted file mode 100644
index 31899ff2191..00000000000
--- a/src/tools/mesh_extractor/Model.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef MODEL_H
-#define MODEL_H
-#include <vector>
-#include "Utils.h"
-
-class Model
-{
-public:
- Model(std::string path);
- ~Model();
-
- void ReadVertices();
- void ReadBoundingTriangles();
- void ReadBoundingNormals();
- ModelHeader Header;
- std::vector<Vector3> Vertices;
- std::vector<Vector3> Normals;
- std::vector<Triangle<uint16> > Triangles;
- bool IsCollidable;
- FILE* Stream;
- bool IsBad;
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/ObjectDataHandler.cpp b/src/tools/mesh_extractor/ObjectDataHandler.cpp
deleted file mode 100644
index 1f7c15fd872..00000000000
--- a/src/tools/mesh_extractor/ObjectDataHandler.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ObjectDataHandler.h"
-#include "Chunk.h"
-#include "ADT.h"
-#include "ChunkedData.h"
-
-void ObjectDataHandler::ProcessMapChunk( MapChunk* chunk )
-{
- ProcessInternal(chunk);
-}
diff --git a/src/tools/mesh_extractor/ObjectDataHandler.h b/src/tools/mesh_extractor/ObjectDataHandler.h
deleted file mode 100644
index 5f6674be488..00000000000
--- a/src/tools/mesh_extractor/ObjectDataHandler.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef ODATA_HNDL_H
-#define ODATA_HNDL_H
-#include "ADT.h"
-#include "MapChunk.h"
-
-class ObjectDataHandler
-{
-public:
- ObjectDataHandler(ADT* _adt) : Source(_adt) {}
-
- void ProcessMapChunk(MapChunk* chunk);
- virtual void ProcessInternal(MapChunk* data) = 0;
- ADT* Source;
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/TileBuilder.cpp b/src/tools/mesh_extractor/TileBuilder.cpp
deleted file mode 100644
index d9807603d53..00000000000
--- a/src/tools/mesh_extractor/TileBuilder.cpp
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ContinentBuilder.h"
-#include "TileBuilder.h"
-#include "Geometry.h"
-#include "WorldModelRoot.h"
-#include "Constants.h"
-#include "Utils.h"
-#include "Cache.h"
-#include "ADT.h"
-#include "WDT.h"
-#include "Recast.h"
-#include "RecastAlloc.h"
-#include "DetourNavMeshBuilder.h"
-
-#include <ace/Synch.h>
-
-TileBuilder::TileBuilder(ContinentBuilder* _cBuilder, std::string world, int x, int y, uint32 mapId) :
- World(world), X(x), Y(y), MapId(mapId), _Geometry(NULL), DataSize(0), cBuilder(_cBuilder)
-{
- // Config for normal maps
- memset(&Config, 0, sizeof(rcConfig));
- Config.cs = Constants::TileSize / 1800.0f; // TileSize / voxelSize
- Config.ch = 0.3f;
- Config.minRegionArea = 36;
- Config.mergeRegionArea = 144;
- Config.walkableSlopeAngle = 50.0f;
- Config.detailSampleDist = 3.0f;
- Config.detailSampleMaxError = 1.25f;
- Config.walkableClimb = 1.0f / Config.ch;
- Config.walkableHeight = 2.1 / Config.ch;
- Config.walkableRadius = 0.6f / Config.cs;
- Config.maxEdgeLen = Config.walkableRadius * 8;
- Config.borderSize = Config.walkableRadius + 8;
- Config.tileSize = 1800;
- Config.maxSimplificationError = 1.3f;
- Config.maxVertsPerPoly = 6;
-
- // Config for instances
- memset(&InstanceConfig, 0, sizeof(rcConfig));
- InstanceConfig.cs = 0.2f;
- InstanceConfig.ch = 0.3f;
- InstanceConfig.minRegionArea = 25;
- InstanceConfig.mergeRegionArea = 100;
- InstanceConfig.walkableSlopeAngle = 50.0f;
- InstanceConfig.detailSampleDist = 3.0f;
- InstanceConfig.detailSampleMaxError = 1.5f;
- InstanceConfig.walkableClimb = 1.0f / InstanceConfig.ch;
- InstanceConfig.walkableHeight = 2.1f / InstanceConfig.ch;
- InstanceConfig.walkableRadius = 0.6f / InstanceConfig.cs;
- InstanceConfig.maxEdgeLen = 8 * InstanceConfig.walkableRadius;
- InstanceConfig.maxVertsPerPoly = 6;
- InstanceConfig.maxSimplificationError = 1.25f;
- InstanceConfig.borderSize = 0;
-
- Context = new rcContext;
-}
-
-void TileBuilder::CalculateTileBounds( float*& bmin, float*& bmax, dtNavMeshParams& /*navMeshParams*/ )
-{
- bmin = new float[3];
- bmax = new float[3];
- bmin[0] = Constants::Origin[0] /*navMeshParams.orig[0]*/ + (Constants::TileSize * X);
- bmin[2] = Constants::Origin[2] /*navMeshParams.orig[2]*/ + (Constants::TileSize * Y);
- bmax[0] = Constants::Origin[0] /*navMeshParams.orig[0]*/ + (Constants::TileSize * (X + 1));
- bmax[2] = Constants::Origin[2] /*navMeshParams.orig[2]*/ + (Constants::TileSize * (Y + 1));
-}
-
-void TileBuilder::AddGeometry(WorldModelRoot* root, const WorldModelDefinition& def)
-{
- _Geometry = new Geometry();
- _Geometry->Transform = true;
-
- WorldModelHandler::InsertModelGeometry(_Geometry->Vertices, _Geometry->Triangles, def, root, false);
-
- OutputDebugVertices();
-}
-
-uint8* TileBuilder::BuildInstance( dtNavMeshParams& navMeshParams )
-{
- float* bmin = NULL, *bmax = NULL;
-
- _Geometry->CalculateBoundingBox(bmin, bmax);
-
- rcVcopy(InstanceConfig.bmax, bmax);
- rcVcopy(InstanceConfig.bmin, bmin);
-
- uint32 numVerts = _Geometry->Vertices.size();
- uint32 numTris = _Geometry->Triangles.size();
- float* vertices;
- int* triangles;
- uint8* areas;
- _Geometry->GetRawData(vertices, triangles, areas);
-
- // this sets the dimensions of the heightfield
- rcCalcGridSize(InstanceConfig.bmin, InstanceConfig.bmax, InstanceConfig.cs, &InstanceConfig.width, &InstanceConfig.height);
-
- rcHeightfield* hf = rcAllocHeightfield();
- rcCreateHeightfield(Context, *hf, InstanceConfig.width, InstanceConfig.height, InstanceConfig.bmin, InstanceConfig.bmax, InstanceConfig.cs, InstanceConfig.ch);
-
- rcClearUnwalkableTriangles(Context, InstanceConfig.walkableSlopeAngle, vertices, numVerts, triangles, numTris, areas);
- rcRasterizeTriangles(Context, vertices, numVerts, triangles, areas, numTris, *hf, InstanceConfig.walkableClimb);
-
- rcFilterLowHangingWalkableObstacles(Context, InstanceConfig.walkableClimb, *hf);
- rcFilterLedgeSpans(Context, InstanceConfig.walkableHeight, InstanceConfig.walkableClimb, *hf);
- rcFilterWalkableLowHeightSpans(Context, InstanceConfig.walkableHeight, *hf);
-
- rcCompactHeightfield* chf = rcAllocCompactHeightfield();
- rcBuildCompactHeightfield(Context, InstanceConfig.walkableHeight, InstanceConfig.walkableClimb, *hf, *chf);
-
- rcErodeWalkableArea(Context, InstanceConfig.walkableRadius, *chf);
- rcBuildDistanceField(Context, *chf);
- rcBuildRegions(Context, *chf, InstanceConfig.borderSize, InstanceConfig.minRegionArea, InstanceConfig.minRegionArea);
-
- rcContourSet* contours = rcAllocContourSet();
- rcBuildContours(Context, *chf, InstanceConfig.maxSimplificationError, InstanceConfig.maxEdgeLen, *contours);
-
- rcPolyMesh* pmesh = rcAllocPolyMesh();
- rcBuildPolyMesh(Context, *contours, InstanceConfig.maxVertsPerPoly, *pmesh);
-
- rcPolyMeshDetail* dmesh = rcAllocPolyMeshDetail();
- rcBuildPolyMeshDetail(Context, *pmesh, *chf, InstanceConfig.detailSampleDist, InstanceConfig.detailSampleMaxError, *dmesh);
-
- // Set flags according to area types (e.g. Swim for Water)
- for (int i = 0; i < pmesh->npolys; i++)
- {
- if (pmesh->areas[i] == Constants::POLY_AREA_ROAD || pmesh->areas[i] == Constants::POLY_AREA_TERRAIN)
- pmesh->flags[i] = Constants::POLY_FLAG_WALK;
- else if (pmesh->areas[i] == Constants::POLY_AREA_WATER)
- pmesh->flags[i] = Constants::POLY_FLAG_SWIM;
- }
-
- dtNavMeshCreateParams params;
- memset(&params, 0, sizeof(params));
- // PolyMesh data
- params.verts = pmesh->verts;
- params.vertCount = pmesh->nverts;
- params.polys = pmesh->polys;
- params.polyAreas = pmesh->areas;
- params.polyFlags = pmesh->flags;
- params.polyCount = pmesh->npolys;
- params.nvp = pmesh->nvp;
- // PolyMeshDetail data
- params.detailMeshes = dmesh->meshes;
- params.detailVerts = dmesh->verts;
- params.detailVertsCount = dmesh->nverts;
- params.detailTris = dmesh->tris;
- params.detailTriCount = dmesh->ntris;
- rcVcopy(params.bmin, pmesh->bmin);
- rcVcopy(params.bmax, pmesh->bmax);
- // General settings
- params.ch = InstanceConfig.ch;
- params.cs = InstanceConfig.cs;
- params.walkableClimb = InstanceConfig.walkableClimb * InstanceConfig.ch;
- params.walkableHeight = InstanceConfig.walkableHeight * InstanceConfig.ch;
- params.walkableRadius = InstanceConfig.walkableRadius * InstanceConfig.cs;
- params.tileX = X;
- params.tileY = Y;
- params.tileLayer = 0;
- params.buildBvTree = true;
-
- rcVcopy(params.bmax, bmax);
- rcVcopy(params.bmin, bmin);
-
- // Offmesh-connection settings
- params.offMeshConCount = 0; // none for now
-
- rcFreeHeightField(hf);
- rcFreeCompactHeightfield(chf);
- rcFreeContourSet(contours);
- delete vertices;
- delete triangles;
- delete areas;
- delete bmin;
- delete bmax;
-
- if (!params.polyCount || !params.polys || Constants::TilesPerMap * Constants::TilesPerMap == params.polyCount)
- {
- // we have flat tiles with no actual geometry - don't build those, its useless
- // keep in mind that we do output those into debug info
- // drop tiles with only exact count - some tiles may have geometry while having less tiles
- printf("No polygons to build on tile, skipping.\n");
- rcFreePolyMesh(pmesh);
- rcFreePolyMeshDetail(dmesh);
- return NULL;
- }
-
- int navDataSize;
- uint8* navData;
- printf("Creating the navmesh with %i vertices, %i polys, %i triangles!\n", params.vertCount, params.polyCount, params.detailTriCount);
- bool result = dtCreateNavMeshData(&params, &navData, &navDataSize);
-
- rcFreePolyMesh(pmesh);
- rcFreePolyMeshDetail(dmesh);
-
- if (result)
- {
- printf("NavMesh created, size %i!\n", navDataSize);
- DataSize = navDataSize;
- return navData;
- }
-
- return NULL;
-}
-
-uint8* TileBuilder::BuildTiled(dtNavMeshParams& navMeshParams)
-{
- _Geometry = new Geometry();
- _Geometry->Transform = true;
- ADT* adt = new ADT(Utils::GetAdtPath(World, X, Y), X, Y);
- adt->Read();
- _Geometry->AddAdt(adt);
- delete adt;
-
- if (_Geometry->Vertices.empty() && _Geometry->Triangles.empty())
- return NULL;
-
- float* bmin = NULL, *bmax = NULL;
- CalculateTileBounds(bmin, bmax, navMeshParams);
- _Geometry->CalculateMinMaxHeight(bmin[1], bmax[1]);
-
- // again, we load everything - wasteful but who cares
- for (int ty = Y - 1; ty <= Y + 1; ty++)
- {
- for (int tx = X - 1; tx <= X + 1; tx++)
- {
- // don't load main tile again
- if (tx == X && ty == Y)
- continue;
-
- ADT* _adt = new ADT(Utils::GetAdtPath(World, tx, ty), tx, ty);
- // If this condition is met, it means that this WDT does not contain the ADT
- if (!_adt->Data->Stream)
- {
- delete _adt;
- continue;
- }
- _adt->Read();
- _Geometry->AddAdt(_adt);
- delete _adt;
- }
- }
-
- OutputDebugVertices();
-
- uint32 numVerts = _Geometry->Vertices.size();
- uint32 numTris = _Geometry->Triangles.size();
- float* vertices;
- int* triangles;
- uint8* areas;
- _Geometry->GetRawData(vertices, triangles, areas);
- _Geometry->Vertices.clear();
- _Geometry->Triangles.clear();
-
- // add border
- bmin[0] -= Config.borderSize * Config.cs;
- bmin[2] -= Config.borderSize * Config.cs;
- bmax[0] += Config.borderSize * Config.cs;
- bmax[2] += Config.borderSize * Config.cs;
-
- rcHeightfield* hf = rcAllocHeightfield();
- int width = Config.tileSize + (Config.borderSize * 2);
- rcCreateHeightfield(Context, *hf, width, width, bmin, bmax, Config.cs, Config.ch);
-
- rcClearUnwalkableTriangles(Context, Config.walkableSlopeAngle, vertices, numVerts, triangles, numTris, areas);
- rcRasterizeTriangles(Context, vertices, numVerts, triangles, areas, numTris, *hf, Config.walkableClimb);
-
- rcFilterLowHangingWalkableObstacles(Context, Config.walkableClimb, *hf);
- rcFilterLedgeSpans(Context, Config.walkableHeight, Config.walkableClimb, *hf);
- rcFilterWalkableLowHeightSpans(Context, Config.walkableHeight, *hf);
-
- rcCompactHeightfield* chf = rcAllocCompactHeightfield();
- rcBuildCompactHeightfield(Context, Config.walkableHeight, Config.walkableClimb, *hf, *chf);
-
- rcErodeWalkableArea(Context, Config.walkableRadius, *chf);
- rcBuildDistanceField(Context, *chf);
- rcBuildRegions(Context, *chf, Config.borderSize, Config.minRegionArea, Config.mergeRegionArea);
-
- rcContourSet* contours = rcAllocContourSet();
- rcBuildContours(Context, *chf, Config.maxSimplificationError, Config.maxEdgeLen, *contours);
-
- rcPolyMesh* pmesh = rcAllocPolyMesh();
- rcBuildPolyMesh(Context, *contours, Config.maxVertsPerPoly, *pmesh);
-
- rcPolyMeshDetail* dmesh = rcAllocPolyMeshDetail();
- rcBuildPolyMeshDetail(Context, *pmesh, *chf, Config.detailSampleDist, Config.detailSampleMaxError, *dmesh);
-
- // Set flags according to area types (e.g. Swim for Water)
- for (int i = 0; i < pmesh->npolys; i++)
- {
- if (pmesh->areas[i] == Constants::POLY_AREA_ROAD || pmesh->areas[i] == Constants::POLY_AREA_TERRAIN)
- pmesh->flags[i] = Constants::POLY_FLAG_WALK;
- else if (pmesh->areas[i] == Constants::POLY_AREA_WATER)
- pmesh->flags[i] = Constants::POLY_FLAG_SWIM;
- }
-
- dtNavMeshCreateParams params;
- memset(&params, 0, sizeof(params));
- // PolyMesh data
- params.verts = pmesh->verts;
- params.vertCount = pmesh->nverts;
- params.polys = pmesh->polys;
- params.polyAreas = pmesh->areas;
- params.polyFlags = pmesh->flags;
- params.polyCount = pmesh->npolys;
- params.nvp = pmesh->nvp;
- // PolyMeshDetail data
- params.detailMeshes = dmesh->meshes;
- params.detailVerts = dmesh->verts;
- params.detailVertsCount = dmesh->nverts;
- params.detailTris = dmesh->tris;
- params.detailTriCount = dmesh->ntris;
- // General settings
- params.ch = Config.ch;
- params.cs = Config.cs;
- params.walkableClimb = Config.walkableClimb * Config.ch;
- params.walkableHeight = Config.walkableHeight * Config.ch;
- params.walkableRadius = Config.walkableRadius * Config.cs;
- params.tileX = X;
- params.tileY = Y;
- params.tileLayer = 0;
- params.buildBvTree = true;
-
- // Recalculate the bounds with the added geometry
- float* bmin2 = NULL, *bmax2 = NULL;
- CalculateTileBounds(bmin2, bmax2, navMeshParams);
- bmin2[1] = bmin[1];
- bmax2[1] = bmax[1];
-
- rcVcopy(params.bmax, bmax2);
- rcVcopy(params.bmin, bmin2);
-
- // Offmesh-connection settings
- params.offMeshConCount = 0; // none for now
-
- rcFreeHeightField(hf);
- rcFreeCompactHeightfield(chf);
- rcFreeContourSet(contours);
- delete vertices;
- delete triangles;
- delete areas;
- delete bmin;
- delete bmax;
-
- if (!params.polyCount || !params.polys || Constants::TilesPerMap * Constants::TilesPerMap == params.polyCount)
- {
- // we have flat tiles with no actual geometry - don't build those, its useless
- // keep in mind that we do output those into debug info
- // drop tiles with only exact count - some tiles may have geometry while having less tiles
- printf("[%02i, %02i] No polygons to build on tile, skipping.\n", X, Y);
- rcFreePolyMesh(pmesh);
- rcFreePolyMeshDetail(dmesh);
- return NULL;
- }
-
- int navDataSize;
- uint8* navData;
- printf("[%02i, %02i] Creating the navmesh with %i vertices, %i polys, %i triangles!\n", X, Y, params.vertCount, params.polyCount, params.detailTriCount);
- bool result = dtCreateNavMeshData(&params, &navData, &navDataSize);
-
- rcFreePolyMesh(pmesh);
- rcFreePolyMeshDetail(dmesh);
-
- if (result)
- {
- printf("[%02i, %02i] NavMesh created, size %i!\n", X, Y, navDataSize);
- DataSize = navDataSize;
- return navData;
- }
-
- return NULL;
-}
-
-void TileBuilder::OutputDebugVertices()
-{
- if (Constants::Debug)
- {
- char buff[100];
- sprintf(buff, "mmaps/%s_%02u%02u.obj", World.c_str(), Y, X);
- FILE* debug = fopen(buff, "wb");
- for (uint32 i = 0; i < _Geometry->Vertices.size(); ++i)
- {
- const Vector3& vector = _Geometry->Vertices[i];
- fprintf(debug, "v %f %f %f\n", vector.x, vector.y, vector.z);
- }
- for (uint32 i = 0; i < _Geometry->Triangles.size(); ++i)
- {
- const Triangle<uint32>& triangle = _Geometry->Triangles[i];
- fprintf(debug, "f %u %u %u\n", triangle.V0 + 1, triangle.V1 + 1, triangle.V2 + 1);
- }
- fclose(debug);
- }
-}
-
-TileBuilder::~TileBuilder()
-{
- delete Context;
- delete _Geometry;
-}
diff --git a/src/tools/mesh_extractor/TileBuilder.h b/src/tools/mesh_extractor/TileBuilder.h
deleted file mode 100644
index 815f9597d46..00000000000
--- a/src/tools/mesh_extractor/TileBuilder.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef TILE_BUILD_H
-#define TILE_BUILD_H
-#include <string>
-#include "Recast.h"
-
-#include "Geometry.h"
-#include "WorldModelRoot.h"
-
-class ContinentBuilder;
-class WDT;
-
-class TileBuilder
-{
-public:
- TileBuilder(ContinentBuilder* _cBuilder, std::string world, int x, int y, uint32 mapId);
- ~TileBuilder();
-
- void CalculateTileBounds(float*& bmin, float*& bmax, dtNavMeshParams& navMeshParams);
- uint8* BuildTiled(dtNavMeshParams& navMeshParams);
- uint8* BuildInstance(dtNavMeshParams& navMeshParams);
- void AddGeometry(WorldModelRoot* root, const WorldModelDefinition& def);
- void OutputDebugVertices();
- std::string World;
- int X;
- int Y;
- int MapId;
- rcConfig Config;
- rcConfig InstanceConfig;
- rcContext* Context;
- Geometry* _Geometry;
- uint32 DataSize;
- ContinentBuilder* cBuilder;
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/Utils.cpp b/src/tools/mesh_extractor/Utils.cpp
deleted file mode 100644
index 3dcdd6598e5..00000000000
--- a/src/tools/mesh_extractor/Utils.cpp
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Utils.h"
-#include "WorldModelHandler.h"
-#include "Constants.h"
-#include <cstring>
-#include "G3D/Matrix4.h"
-#include "G3D/Quat.h"
-
-#ifdef _WIN32
- #include "direct.h"
-#else
- #include <sys/stat.h>
- #include <unistd.h>
-#endif
-
-const float Constants::TileSize = 533.0f + (1/3.0f);
-const float Constants::MaxXY = 32.0f * Constants::TileSize;
-const float Constants::ChunkSize = Constants::TileSize / 16.0f;
-const float Constants::UnitSize = Constants::ChunkSize / 8.0f;
-const float Constants::Origin[] = { -Constants::MaxXY, 0.0f, -Constants::MaxXY };
-const float Constants::PI = 3.1415926f;
-const float Constants::MaxStandableHeight = 1.5f;
-const char* Constants::VMAPMagic = "VMAP041";
-bool Constants::ToWoWCoords = false;
-bool Constants::Debug = false;
-const float Constants::BaseUnitDim = 0.533333f;
-const int Constants::VertexPerMap = (Constants::TileSize / Constants::BaseUnitDim) + 0.5f;
-const int Constants::VertexPerTile = 40;
-const int Constants::TilesPerMap = Constants::VertexPerMap / Constants::VertexPerTile;
-
-void Utils::CreateDir( const std::string& Path )
-{
-#ifdef _WIN32
- _mkdir( Path.c_str());
-#else
- mkdir( Path.c_str(), 0777 );
-#endif
-}
-
-void Utils::Reverse(char word[])
-{
- int len = strlen(word);
- for (int i = 0;i < len / 2; i++)
- {
- word[i] ^= word[len-i-1];
- word[len-i-1] ^= word[i];
- word[i] ^= word[len-i-1];
- }
-}
-
-std::string Utils::ReadString( FILE* file )
-{
- std::string ret;
- while (true)
- {
- char b;
- if (fread(&b, sizeof(char), 1, file) != 1 || b == 0)
- break;
- ret.push_back(b);
- }
- return ret;
-}
-
-uint32 Utils::Size( FILE* file )
-{
- // store the old position
- uint32 offset = ftell(file);
- // Get file size
- fseek(file, 0, SEEK_END);
- uint32 size = ftell(file);
- // reset back to the old position
- fseek(file, offset, SEEK_SET);
- return size;
-}
-
-Vector3 Utils::ToRecast(const Vector3& val )
-{
- return Vector3(-val.y, val.z, -val.x);
-}
-
-std::string Utils::GetAdtPath(const std::string& world, int x, int y )
-{
- return "World\\Maps\\" + world + "\\" + world + "_" + Utils::ToString(x) + "_" + Utils::ToString(y) + ".adt";
-}
-
-std::string Utils::FixModelPath(const std::string& path )
-{
- return Utils::GetPathBase(path) + ".M2";
-}
-
-Vector3 Utils::TransformDoodadVertex(const IDefinition& def, Vector3& vec, bool translate)
-{
- // Sources of information:
- /// http://www.pxr.dk/wowdev/wiki/index.php?title=ADT/v18&oldid=3715
-
- // This function applies to both external doodads and WMOs
-
- // Rotate our Doodad vertex
- G3D::Matrix4 rot = G3D::Matrix3::fromEulerAnglesXYZ(Utils::ToRadians(def.Rotation.z), Utils::ToRadians(-def.Rotation.x), Utils::ToRadians(def.Rotation.y + 180));
- Vector3 ret = Utils::VectorTransform(vec, rot);
-
- // And finally scale and translate it to our origin
- ret = ret * def.Scale();
- if (translate)
- ret = ret + Vector3(Constants::MaxXY - def.Position.z, Constants::MaxXY - def.Position.x, def.Position.y);
- return ret;
-}
-
-Vector3 Utils::TransformWmoDoodad(const DoodadInstance& inst, const WorldModelDefinition& root, Vector3& vec, bool translate )
-{
- G3D::Quat quat = G3D::Quat(-inst.QuatY, inst.QuatZ, -inst.QuatX, inst.QuatW);
-
- Vector3 ret = Utils::VectorTransform(vec, G3D::Matrix4(quat.toRotationMatrix()));
- ret = ret * (inst.Scale / 1024.0f);
- if (translate)
- ret = ret + Vector3(Constants::MaxXY - inst.Position.z, Constants::MaxXY - inst.Position.x, inst.Position.y);
- return ret;
-}
-
-float Utils::ToRadians( float degrees )
-{
- return Constants::PI * degrees / 180.0f;
-}
-
-Vector3 Utils::VectorTransform(const Vector3& vec, const G3D::Matrix4& matrix, bool normal )
-{
- G3D::Vector3 ret(vec.x, vec.y, vec.z);
- ret = matrix.homoMul(ret, normal ? 0 : 1);
- return Vector3(ret.x, ret.y, ret.z);
-}
-
-std::string Utils::GetPathBase(const std::string& path )
-{
- size_t lastIndex = path.find_last_of(".");
- if (lastIndex != std::string::npos)
- return path.substr(0, lastIndex);
- return path;
-}
-
-Vector3 Vector3::Read( FILE* file )
-{
- Vector3 ret;
- if (fread(&ret, sizeof(Vector3), 1, file) != 1)
- printf("Vector3::Read: Failed to read some data expected 1, read 0\n");
- return ret;
-}
-
-Vector3 Utils::GetLiquidVert(const IDefinition& def, Vector3 basePosition, float height, int x, int y, bool translate)
-{
- if (Utils::Distance(height, 0.0f) > 0.5f)
- basePosition.z = 0.0f;
- return Utils::TransformDoodadVertex(def, basePosition + Vector3(x * Constants::UnitSize, y * Constants::UnitSize, height), translate);
-}
-
-float Utils::Distance( float x, float y )
-{
- return sqrt(x*x + y*y);
-}
-
-std::string Utils::Replace( std::string str, const std::string& oldStr, const std::string& newStr )
-{
- size_t pos = 0;
- while((pos = str.find(oldStr, pos)) != std::string::npos)
- {
- str.replace(pos, oldStr.length(), newStr);
- pos += newStr.length();
- }
- return str;
-}
-
-void Utils::SaveToDisk( FILE* stream, const std::string& path )
-{
- FILE* disk = fopen(path.c_str(), "wb");
- if (!disk)
- {
- printf("SaveToDisk: Could not save file %s to disk, please verify that you have write permissions on that directory\n", path.c_str());
- fclose(stream);
- return;
- }
-
- uint32 size = Utils::Size(stream);
- uint8* data = new uint8[size];
- // Read the data to an array
- size_t read = fread(data, size, 1, stream);
- if (read != 1)
- {
- printf("SaveToDisk: Error reading from Stream while trying to save file %s to disk.\n", path.c_str());
- fclose(disk);
- fclose(stream);
- return;
- }
-
- // And write it in the file
- size_t wrote = fwrite(data, size, 1, disk);
- if (wrote != 1)
- {
- printf("SaveToDisk: Error writing to the file while trying to save %s to disk.\n", path.c_str());
- fclose(stream);
- fclose(disk);
- return;
- }
-
- // Close the filestream
- fclose(disk);
- fclose(stream);
-
- // Free the used memory
- delete[] data;
-}
-
-Vector3 Utils::ToWoWCoords(const Vector3& vec )
-{
- return Vector3(-vec.z, -vec.x, vec.y);
-}
-
-std::string Utils::GetExtension( std::string path )
-{
- std::string::size_type idx = path.rfind('.');
- std::string extension = "";
-
- if(idx != std::string::npos)
- extension = path.substr(idx+1);
- return extension;
-}
-
-void MapChunkHeader::Read(FILE* stream)
-{
- int count = 0;
-
- count += fread(&Flags, sizeof(uint32), 1, stream);
- count += fread(&IndexX, sizeof(uint32), 1, stream);
- count += fread(&IndexY, sizeof(uint32), 1, stream);
- count += fread(&Layers, sizeof(uint32), 1, stream);
- count += fread(&DoodadRefs, sizeof(uint32), 1, stream);
- count += fread(&OffsetMCVT, sizeof(uint32), 1, stream);
- count += fread(&OffsetMCNR, sizeof(uint32), 1, stream);
- count += fread(&OffsetMCLY, sizeof(uint32), 1, stream);
- count += fread(&OffsetMCRF, sizeof(uint32), 1, stream);
- count += fread(&OffsetMCAL, sizeof(uint32), 1, stream);
- count += fread(&SizeMCAL, sizeof(uint32), 1, stream);
- count += fread(&OffsetMCSH, sizeof(uint32), 1, stream);
- count += fread(&SizeMCSH, sizeof(uint32), 1, stream);
- count += fread(&AreaId, sizeof(uint32), 1, stream);
- count += fread(&MapObjectRefs, sizeof(uint32), 1, stream);
- count += fread(&Holes, sizeof(uint32), 1, stream);
- LowQualityTextureMap = new uint32[4];
- count += fread(LowQualityTextureMap, sizeof(uint32), 4, stream);
- count += fread(&PredTex, sizeof(uint32), 1, stream);
- count += fread(&NumberEffectDoodad, sizeof(uint32), 1, stream);
- count += fread(&OffsetMCSE, sizeof(uint32), 1, stream);
- count += fread(&SoundEmitters, sizeof(uint32), 1, stream);
- count += fread(&OffsetMCLQ, sizeof(uint32), 1, stream);
- count += fread(&SizeMCLQ, sizeof(uint32), 1, stream);
- Position = Vector3::Read(stream);
- count += fread(&OffsetMCCV, sizeof(uint32), 1, stream);
-
- if (count != 27)
- printf("MapChunkHeader::Read: Failed to read some data expected 27, read %d\n", count);
-}
-
-void MHDR::Read(FILE* stream)
-{
- int count = 0;
-
- count += fread(&Flags, sizeof(uint32), 1, stream);
- count += fread(&OffsetMCIN, sizeof(uint32), 1, stream);
- count += fread(&OffsetMTEX, sizeof(uint32), 1, stream);
- count += fread(&OffsetMMDX, sizeof(uint32), 1, stream);
- count += fread(&OffsetMMID, sizeof(uint32), 1, stream);
- count += fread(&OffsetMWMO, sizeof(uint32), 1, stream);
- count += fread(&OffsetMWID, sizeof(uint32), 1, stream);
- count += fread(&OffsetMDDF, sizeof(uint32), 1, stream);
- count += fread(&OffsetMODF, sizeof(uint32), 1, stream);
- count += fread(&OffsetMFBO, sizeof(uint32), 1, stream);
- count += fread(&OffsetMH2O, sizeof(uint32), 1, stream);
- count += fread(&OffsetMTFX, sizeof(uint32), 1, stream);
-
- if (count != 12)
- printf("MHDR::Read: Failed to read some data expected 12, read %d\n", count);
-}
-
-void ModelHeader::Read(FILE* stream)
-{
- int count = 0;
-
- count += fread(&Magic, sizeof(char), 4, stream);
- Magic[4] = '\0'; // null-terminate it.
- count += fread(&Version, sizeof(uint32), 1, stream);
- count += fread(&LengthModelName, sizeof(uint32), 1, stream);
- count += fread(&OffsetName, sizeof(uint32), 1, stream);
- count += fread(&ModelFlags, sizeof(uint32), 1, stream);
- count += fread(&CountGlobalSequences, sizeof(uint32), 1, stream);
- count += fread(&OffsetGlobalSequences, sizeof(uint32), 1, stream);
- count += fread(&CountAnimations, sizeof(uint32), 1, stream);
- count += fread(&OffsetAnimations, sizeof(uint32), 1, stream);
- count += fread(&CountAnimationLookup, sizeof(uint32), 1, stream);
- count += fread(&OffsetAnimationLookup, sizeof(uint32), 1, stream);
- count += fread(&CountBones, sizeof(uint32), 1, stream);
- count += fread(&OffsetBones, sizeof(uint32), 1, stream);
- count += fread(&CountKeyBoneLookup, sizeof(uint32), 1, stream);
- count += fread(&OffsetKeyBoneLookup, sizeof(uint32), 1, stream);
- count += fread(&CountVertices, sizeof(uint32), 1, stream);
- count += fread(&OffsetVertices, sizeof(uint32), 1, stream);
- count += fread(&CountViews, sizeof(uint32), 1, stream);
- count += fread(&CountColors, sizeof(uint32), 1, stream);
- count += fread(&OffsetColors, sizeof(uint32), 1, stream);
- count += fread(&CountTextures, sizeof(uint32), 1, stream);
- count += fread(&OffsetTextures, sizeof(uint32), 1, stream);
- count += fread(&CountTransparency, sizeof(uint32), 1, stream);
- count += fread(&OffsetTransparency, sizeof(uint32), 1, stream);
- count += fread(&CountUvAnimation, sizeof(uint32), 1, stream);
- count += fread(&OffsetUvAnimation, sizeof(uint32), 1, stream);
- count += fread(&CountTexReplace, sizeof(uint32), 1, stream);
- count += fread(&OffsetTexReplace, sizeof(uint32), 1, stream);
- count += fread(&CountRenderFlags, sizeof(uint32), 1, stream);
- count += fread(&OffsetRenderFlags, sizeof(uint32), 1, stream);
- count += fread(&CountBoneLookup, sizeof(uint32), 1, stream);
- count += fread(&OffsetBoneLookup, sizeof(uint32), 1, stream);
- count += fread(&CountTexLookup, sizeof(uint32), 1, stream);
- count += fread(&OffsetTexLookup, sizeof(uint32), 1, stream);
- count += fread(&CountTexUnits, sizeof(uint32), 1, stream);
- count += fread(&OffsetTexUnits, sizeof(uint32), 1, stream);
- count += fread(&CountTransLookup, sizeof(uint32), 1, stream);
- count += fread(&OffsetTransLookup, sizeof(uint32), 1, stream);
- count += fread(&CountUvAnimLookup, sizeof(uint32), 1, stream);
- count += fread(&OffsetUvAnimLookup, sizeof(uint32), 1, stream);
- VertexBox[0] = Vector3::Read(stream);
- VertexBox[1] = Vector3::Read(stream);
- count += fread(&VertexRadius, sizeof(float), 1, stream);
- BoundingBox[0] = Vector3::Read(stream);
- BoundingBox[1] = Vector3::Read(stream);
- count += fread(&BoundingRadius, sizeof(float), 1, stream);
- count += fread(&CountBoundingTriangles, sizeof(uint32), 1, stream);
- count += fread(&OffsetBoundingTriangles, sizeof(uint32), 1, stream);
- count += fread(&CountBoundingVertices, sizeof(uint32), 1, stream);
- count += fread(&OffsetBoundingVertices, sizeof(uint32), 1, stream);
- count += fread(&CountBoundingNormals, sizeof(uint32), 1, stream);
- count += fread(&OffsetBoundingNormals, sizeof(uint32), 1, stream);
-
- if (count != 51)
- printf("ModelHeader::Read: Failed to read some data expected 51, read %d\n", count);
-
-}
-
-WorldModelHeader WorldModelHeader::Read(FILE* stream)
-{
- WorldModelHeader ret;
- int count = 0;
-
- count += fread(&ret.CountMaterials, sizeof(uint32), 1, stream);
- count += fread(&ret.CountGroups, sizeof(uint32), 1, stream);
- count += fread(&ret.CountPortals, sizeof(uint32), 1, stream);
- count += fread(&ret.CountLights, sizeof(uint32), 1, stream);
- count += fread(&ret.CountModels, sizeof(uint32), 1, stream);
- count += fread(&ret.CountDoodads, sizeof(uint32), 1, stream);
- count += fread(&ret.CountSets, sizeof(uint32), 1, stream);
- count += fread(&ret.AmbientColorUnk, sizeof(uint32), 1, stream);
- count += fread(&ret.WmoId, sizeof(uint32), 1, stream);
- ret.BoundingBox[0] = Vector3::Read(stream);
- ret.BoundingBox[1] = Vector3::Read(stream);
- count += fread(&ret.LiquidTypeRelated, sizeof(uint32), 1, stream);
-
- if (count != 10)
- printf("WorldModelHeader::Read: Failed to read some data expected 10, read %d\n", count);
-
- return ret;
-}
-
-DoodadInstance DoodadInstance::Read(FILE* stream)
-{
- DoodadInstance ret;
- int count = 0;
-
- count += fread(&ret.FileOffset, sizeof(uint32), 1, stream);
- ret.Position = Vector3::Read(stream);
- count += fread(&ret.QuatW, sizeof(float), 1, stream);
- count += fread(&ret.QuatX, sizeof(float), 1, stream);
- count += fread(&ret.QuatY, sizeof(float), 1, stream);
- count += fread(&ret.QuatZ, sizeof(float), 1, stream);
- count += fread(&ret.Scale, sizeof(float), 1, stream);
- count += fread(&ret.LightColor, sizeof(uint32), 1, stream);
-
- if (count != 7)
- printf("DoodadInstance::Read: Failed to read some data expected 7, read %d\n", count);
-
- return ret;
-}
-
-DoodadSet DoodadSet::Read(FILE* stream)
-{
- DoodadSet ret;
- char name[21];
- int count = 0;
-
- count += fread(&name, sizeof(char), 20, stream);
- name[20] = '\0';
- ret.Name = name;
- count += fread(&ret.FirstInstanceIndex, sizeof(uint32), 1, stream);
- count += fread(&ret.CountInstances, sizeof(uint32), 1, stream);
- count += fread(&ret.UnknownZero, sizeof(uint32), 1, stream);
-
- if (count != 23)
- printf("DoodadSet::Read: Failed to read some data expected 23, read %d\n", count);
-
- return ret;
-}
-
-LiquidHeader LiquidHeader::Read(FILE* stream)
-{
- LiquidHeader ret;
- int count = 0;
- count += fread(&ret.CountXVertices, sizeof(uint32), 1, stream);
- count += fread(&ret.CountYVertices, sizeof(uint32), 1, stream);
- count += fread(&ret.Width, sizeof(uint32), 1, stream);
- count += fread(&ret.Height, sizeof(uint32), 1, stream);
- ret.BaseLocation = Vector3::Read(stream);
- count += fread(&ret.MaterialId, sizeof(uint16), 1, stream);
-
- if (count != 5)
- printf("LiquidHeader::Read: Failed to read some data expected 5, read %d\n", count);
-
- return ret;
-}
-
-LiquidData LiquidData::Read(FILE* stream, LiquidHeader& header)
-{
- LiquidData ret;
- ret.HeightMap = new float*[header.CountXVertices];
- for (uint32 i = 0; i < header.CountXVertices; ++i)
- ret.HeightMap[i] = new float[header.CountYVertices];
-
- ret.RenderFlags = new uint8*[header.Width];
- for (uint32 i = 0; i < header.Width; ++i)
- ret.RenderFlags[i] = new uint8[header.Height];
-
- for (uint32 y = 0; y < header.CountYVertices; y++)
- {
- for (uint32 x = 0; x < header.CountXVertices; x++)
- {
- uint32 discard;
- float tmp;
- if (fread(&discard, sizeof(uint32), 1, stream) == 1 &&
- fread(&tmp, sizeof(float), 1, stream) == 1)
- {
- ret.HeightMap[x][y] = tmp;
- }
- }
- }
-
- for (uint32 y = 0; y < header.Height; y++)
- {
- for (uint32 x = 0; x < header.Width; x++)
- {
- uint8 tmp = 0;
- if (fread(&tmp, sizeof(uint8), 1, stream) == 1)
- ret.RenderFlags[x][y] = tmp;
- }
- }
-
- return ret;
-}
-
-H2ORenderMask H2ORenderMask::Read(FILE* stream)
-{
- H2ORenderMask ret;
- int32 count;
- if ((count = fread(&ret.Mask, sizeof(uint8), 8, stream)) != 8)
- printf("H2OHeader::Read: Failed to read some data expected 8, read %d\n", count);
- return ret;
-}
-
-bool MCNKLiquidData::IsWater(int x, int y, float height)
-{
- if (!Heights)
- return false;
- if (!Mask.ShouldRender(x, y))
- return false;
- float diff = Heights[x][y] - height;
- if (diff > Constants::MaxStandableHeight)
- return true;
- return false;
-}
-
-H2OHeader H2OHeader::Read(FILE* stream)
-{
- H2OHeader ret;
- int count = 0;
- count += fread(&ret.OffsetInformation, sizeof(uint32), 1, stream);
- count += fread(&ret.LayerCount, sizeof(uint32), 1, stream);
- count += fread(&ret.OffsetRender, sizeof(uint32), 1, stream);
-
- if (count != 3)
- printf("H2OHeader::Read: Failed to read some data expected 3, read %d\n", count);
-
- return ret;
-}
-
-H2OInformation H2OInformation::Read(FILE* stream)
-{
- H2OInformation ret;
- int count = 0;
- count += fread(&ret.LiquidType, sizeof(uint16), 1, stream);
- count += fread(&ret.Flags, sizeof(uint16), 1, stream);
- count += fread(&ret.HeightLevel1, sizeof(float), 1, stream);
- count += fread(&ret.HeightLevel2, sizeof(float), 1, stream);
- count += fread(&ret.OffsetX, sizeof(uint8), 1, stream);
- count += fread(&ret.OffsetY, sizeof(uint8), 1, stream);
- count += fread(&ret.Width, sizeof(uint8), 1, stream);
- count += fread(&ret.Height, sizeof(uint8), 1, stream);
- count += fread(&ret.OffsetMask2, sizeof(uint32), 1, stream);
- count += fread(&ret.OffsetHeightmap, sizeof(uint32), 1, stream);
-
- if (count != 10)
- printf("H2OInformation::Read: Failed to read some data expected 10, read %d\n", count);
-
- return ret;
-}
-
-char* Utils::GetPlainName(const char* FileName)
-{
- char* temp;
-
- if((temp = (char*)strrchr(FileName, '\\')) != NULL)
- FileName = temp + 1;
- return (char*)FileName;
-}
-
-WMOGroupHeader WMOGroupHeader::Read( FILE* stream )
-{
- WMOGroupHeader ret;
- int count = 0;
- count += fread(&ret.OffsetGroupName, sizeof(uint32), 1, stream);
- count += fread(&ret.OffsetDescriptiveName, sizeof(uint32), 1, stream);
- count += fread(&ret.Flags, sizeof(uint32), 1, stream);
- ret.BoundingBox[0] = Vector3::Read(stream);
- ret.BoundingBox[1] = Vector3::Read(stream);
- count += fread(&ret.OffsetPortals, sizeof(uint32), 1, stream);
- count += fread(&ret.CountPortals, sizeof(uint32), 1, stream);
- count += fread(&ret.CountBatches, sizeof(uint16), 4, stream);
- count += fread(&ret.Fogs, sizeof(uint8), 4, stream);
- count += fread(&ret.LiquidTypeRelated, sizeof(uint32), 1, stream);
- count += fread(&ret.WmoId, sizeof(uint32), 1, stream);
-
- if (count != 15)
- printf("WMOGroupHeader::Read: Failed to read some data expected 15, read %d\n", count);
-
- return ret;
-}
diff --git a/src/tools/mesh_extractor/Utils.h b/src/tools/mesh_extractor/Utils.h
deleted file mode 100644
index fcdffe0f8f3..00000000000
--- a/src/tools/mesh_extractor/Utils.h
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef UTILS_H
-#define UTILS_H
-#include <cstdio>
-#include <string>
-#include <sstream>
-
-#include "G3D/Matrix4.h"
-#include "DetourNavMesh.h"
-
-#include "Define.h"
-#include "Constants.h"
-
-#include <ace/Stack_Trace.h>
-
-struct WorldModelDefinition;
-class DoodadDefinition;
-class DoodadInstance;
-
-#define ASSERT(assertion) { if (!(assertion)) { ACE_Stack_Trace st; fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); *((volatile int*)NULL) = 0; } }
-
-struct Vector3
-{
- Vector3() {}
- Vector3(float X, float Y, float Z) : x(X), y(Y), z(Z) {}
- float x;
- float y;
- float z;
-
- Vector3 operator +(Vector3 const& other) const
- {
- return Vector3(x + other.x, y + other.y, z + other.z);
- }
-
- Vector3 operator -(Vector3 const& other) const
- {
- return Vector3(x - other.x, y - other.y, z - other.z);
- }
-
- template<typename T>
- Vector3 operator *(T s) const
- {
- return Vector3(x * s, y * s, z * s);
- }
-
- static Vector3 Read(FILE* file);
-};
-
-struct TilePos
-{
- TilePos(int x, int y) : X(x), Y(y) {}
- int X;
- int Y;
-};
-
-template<typename T>
-struct Triangle
-{
- Triangle() {}
- Triangle(Constants::TriangleType type, T v0, T v1, T v2) : V0(v0), V1(v1), V2(v2), Type(type) {}
- T V0;
- T V1;
- T V2;
- Constants::TriangleType Type;
-};
-
-class MapChunkHeader
-{
-public:
- MapChunkHeader() {}
- uint32 Flags;
- uint32 IndexX;
- uint32 IndexY;
- uint32 Layers;
- uint32 DoodadRefs;
- uint32 OffsetMCVT;
- uint32 OffsetMCNR;
- uint32 OffsetMCLY;
- uint32 OffsetMCRF;
- uint32 OffsetMCAL;
- uint32 SizeMCAL;
- uint32 OffsetMCSH;
- uint32 SizeMCSH;
- uint32 AreaId;
- uint32 MapObjectRefs;
- uint32 Holes;
- uint32* LowQualityTextureMap;
- uint32 PredTex;
- uint32 NumberEffectDoodad;
- uint32 OffsetMCSE;
- uint32 SoundEmitters;
- uint32 OffsetMCLQ;
- uint32 SizeMCLQ;
- Vector3 Position;
- uint32 OffsetMCCV;
-
- void Read(FILE* stream);
-};
-
-class MHDR
-{
-public:
- MHDR() {}
- uint32 Flags;
- uint32 OffsetMCIN;
- uint32 OffsetMTEX;
- uint32 OffsetMMDX;
- uint32 OffsetMMID;
- uint32 OffsetMWMO;
- uint32 OffsetMWID;
- uint32 OffsetMDDF;
- uint32 OffsetMODF;
- uint32 OffsetMFBO;
- uint32 OffsetMH2O;
- uint32 OffsetMTFX;
-
- void Read(FILE* stream);
-};
-
-class ModelHeader
-{
-public:
- char Magic[5];
- uint32 Version;
- uint32 LengthModelName;
- uint32 OffsetName;
- uint32 ModelFlags;
- uint32 CountGlobalSequences;
- uint32 OffsetGlobalSequences;
- uint32 CountAnimations;
- uint32 OffsetAnimations;
- uint32 CountAnimationLookup;
- uint32 OffsetAnimationLookup;
- uint32 CountBones;
- uint32 OffsetBones;
- uint32 CountKeyBoneLookup;
- uint32 OffsetKeyBoneLookup;
- uint32 CountVertices;
- uint32 OffsetVertices;
- uint32 CountViews;
- uint32 CountColors;
- uint32 OffsetColors;
- uint32 CountTextures;
- uint32 OffsetTextures;
- uint32 CountTransparency;
- uint32 OffsetTransparency;
- uint32 CountUvAnimation;
- uint32 OffsetUvAnimation;
- uint32 CountTexReplace;
- uint32 OffsetTexReplace;
- uint32 CountRenderFlags;
- uint32 OffsetRenderFlags;
- uint32 CountBoneLookup;
- uint32 OffsetBoneLookup;
- uint32 CountTexLookup;
- uint32 OffsetTexLookup;
- uint32 CountTexUnits;
- uint32 OffsetTexUnits;
- uint32 CountTransLookup;
- uint32 OffsetTransLookup;
- uint32 CountUvAnimLookup;
- uint32 OffsetUvAnimLookup;
- Vector3 VertexBox[2];
- float VertexRadius;
- Vector3 BoundingBox[2];
- float BoundingRadius;
- uint32 CountBoundingTriangles;
- uint32 OffsetBoundingTriangles;
- uint32 CountBoundingVertices;
- uint32 OffsetBoundingVertices;
- uint32 CountBoundingNormals;
- uint32 OffsetBoundingNormals;
-
- void Read(FILE* stream);
-};
-
-class WorldModelHeader
-{
-public:
- WorldModelHeader() {}
- uint32 CountMaterials;
- uint32 CountGroups;
- uint32 CountPortals;
- uint32 CountLights;
- uint32 CountModels;
- uint32 CountDoodads;
- uint32 CountSets;
- uint32 AmbientColorUnk;
- uint32 WmoId;
- Vector3 BoundingBox[2];
- uint32 LiquidTypeRelated;
-
- static WorldModelHeader Read(FILE* stream);
-};
-
-class DoodadInstance
-{
-public:
- DoodadInstance() {}
- uint32 FileOffset;
- std::string File;
- Vector3 Position;
- float QuatW;
- float QuatX;
- float QuatY;
- float QuatZ;
- float Scale;
- uint32 LightColor;
-
- static DoodadInstance Read(FILE* stream);
-};
-
-class DoodadSet
-{
-public:
- DoodadSet() {}
- std::string Name;
- uint32 FirstInstanceIndex;
- uint32 CountInstances;
- uint32 UnknownZero;
-
- static DoodadSet Read(FILE* stream);
-};
-
-class LiquidHeader
-{
-public:
- LiquidHeader() {}
- uint32 CountXVertices;
- uint32 CountYVertices;
- uint32 Width;
- uint32 Height;
- Vector3 BaseLocation;
- uint16 MaterialId;
-
- static LiquidHeader Read(FILE* stream);
-};
-
-class LiquidData
-{
-public:
- LiquidData() {}
- float** HeightMap;
- uint8** RenderFlags;
-
- bool ShouldRender(int x, int y)
- {
- return RenderFlags[x][y] != 0x0F;
- }
-
- static LiquidData Read(FILE* stream, LiquidHeader& header);
-};
-
-class H2ORenderMask
-{
-public:
- H2ORenderMask() {}
- uint8 Mask[8];
-
- bool ShouldRender(int x, int y)
- {
- return (Mask[y] >> x & 1) != 0;
- }
-
- static H2ORenderMask Read(FILE* stream);
-};
-
-class MCNKLiquidData
-{
-public:
- MCNKLiquidData() {}
- MCNKLiquidData(float** heights, H2ORenderMask mask) : Heights(heights), Mask(mask) {}
-
- float** Heights;
- H2ORenderMask Mask;
-
- bool IsWater(int x, int y, float height);
-};
-
-class H2OHeader
-{
-public:
- H2OHeader() {}
- uint32 OffsetInformation;
- uint32 LayerCount;
- uint32 OffsetRender;
-
- static H2OHeader Read(FILE* stream);
-};
-
-class H2OInformation
-{
-public:
- H2OInformation() {}
- uint16 LiquidType;
- uint16 Flags;
- float HeightLevel1;
- float HeightLevel2;
- uint8 OffsetX;
- uint8 OffsetY;
- uint8 Width;
- uint8 Height;
- uint32 OffsetMask2;
- uint32 OffsetHeightmap;
-
- static H2OInformation Read(FILE* stream);
-};
-
-class WMOGroupHeader
-{
-public:
- WMOGroupHeader() {}
-
- uint32 OffsetGroupName;
- uint32 OffsetDescriptiveName;
- uint32 Flags;
- Vector3 BoundingBox[2];
- uint32 OffsetPortals;
- uint32 CountPortals;
- uint16 CountBatches[4];
- uint8 Fogs[4];
- uint32 LiquidTypeRelated;
- uint32 WmoId;
-
- static WMOGroupHeader Read(FILE* stream);
-};
-
-// Dummy class to act as an interface.
-class IDefinition
-{
-public:
- Vector3 Position;
- Vector3 Rotation;
- virtual float Scale() const { return 1.0f; };
-};
-
-#define MMAP_MAGIC 0x4d4d4150 // 'MMAP'
-#define MMAP_VERSION 3
-
-struct MmapTileHeader
-{
- uint32 mmapMagic;
- uint32 dtVersion;
- uint32 mmapVersion;
- uint32 size;
- bool usesLiquids;
-
- MmapTileHeader() : mmapMagic(MMAP_MAGIC), dtVersion(DT_NAVMESH_VERSION),
- mmapVersion(MMAP_VERSION), size(0), usesLiquids(true) {}
-};
-
-class Utils
-{
-public:
- static void Reverse(char word[]);
- static std::string ReadString(FILE* file);
- static uint32 Size(FILE* file);
- static Vector3 ToRecast(const Vector3& val );
- static std::string GetAdtPath(const std::string& world, int x, int y);
- static std::string FixModelPath(const std::string& path);
- /// They say its better to declare template functions in the header files.
- template <typename T>
- static std::string ToString(T val)
- {
- std::stringstream ss;
- ss << val;
- return ss.str();
- }
- static float ToRadians(float degrees);
- static std::string GetPathBase(const std::string& path);
- static Vector3 GetLiquidVert(const IDefinition& def, Vector3 basePosition, float height, int /*x*/, int /*y*/, bool translate = true);
- static float Distance(float x, float y);
- template<typename T>
- static bool IsAllZero(T* arr, uint32 size)
- {
- for (uint32 i = 0; i < size; ++i)
- if (arr[i])
- return false;
- return true;
- }
- static std::string Replace( std::string str, const std::string& oldStr, const std::string& newStr );
- static void CreateDir( const std::string& Path );
- static void SaveToDisk(FILE* stream, const std::string& path);
- static Vector3 ToWoWCoords(const Vector3& vec );
- static std::string GetExtension( std::string path );
- static char* GetPlainName(const char* FileName);
- static Vector3 TransformDoodadVertex(const IDefinition& def, Vector3& vec, bool translate = true);
- static Vector3 VectorTransform(const Vector3& vec, const G3D::Matrix4& matrix, bool normal = false );
- static Vector3 TransformWmoDoodad(const DoodadInstance& inst, const WorldModelDefinition& root, Vector3& vec, bool translate = true );
-};
-#endif
diff --git a/src/tools/mesh_extractor/WDT.cpp b/src/tools/mesh_extractor/WDT.cpp
deleted file mode 100644
index 707a44611af..00000000000
--- a/src/tools/mesh_extractor/WDT.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "WDT.h"
-#include "Chunk.h"
-#include "ChunkedData.h"
-#include "Utils.h"
-#include "WorldModelHandler.h"
-
-WDT::WDT(std::string file) : IsGlobalModel(false), IsValid(false), Model(NULL)
-{
- Data = new ChunkedData(file, 2);
- ReadTileTable();
- ReadGlobalModel();
-}
-
-void WDT::ReadGlobalModel()
-{
- Chunk* fileChunk = Data->GetChunkByName("MWMO");
- Chunk* defChunk = Data->GetChunkByName("MODF");
- if (!fileChunk || !defChunk)
- return;
-
- IsGlobalModel = true;
- ModelDefinition = WorldModelDefinition::Read(defChunk->GetStream());
- ModelFile = Utils::ReadString(fileChunk->GetStream());
- Model = new WorldModelRoot(ModelFile);
-}
-
-void WDT::ReadTileTable()
-{
- Chunk* chunk = Data->GetChunkByName("MAIN");
- if (!chunk)
- return;
- IsValid = true;
- FILE* stream = chunk->GetStream();
- for (int y = 0; y < 64; ++y)
- {
- for (int x = 0; x < 64; ++x)
- {
- const uint32 hasTileFlag = 0x1;
- uint32 flags;
- uint32 discard;
- int count = 0;
- count += fread(&flags, sizeof(uint32), 1, stream);
- count += fread(&discard, sizeof(uint32), 1, stream);
-
- if (count != 2)
- printf("WDT::ReadTileTable: Failed to read some data expected 2, read %d\n", count);
-
- if (flags & hasTileFlag)
- TileTable.push_back(TilePos(x, y));
-
- }
- }
-}
-
-bool WDT::HasTile( int x, int y )
-{
- for (std::vector<TilePos>::iterator itr = TileTable.begin(); itr != TileTable.end(); ++itr)
- if (itr->X == x && itr->Y == y)
- return true;
- return false;
-}
diff --git a/src/tools/mesh_extractor/WDT.h b/src/tools/mesh_extractor/WDT.h
deleted file mode 100644
index b0961c03ed5..00000000000
--- a/src/tools/mesh_extractor/WDT.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef WDT_H
-#define WDT_H
-#include <string>
-#include <vector>
-
-#include "ChunkedData.h"
-#include "WorldModelHandler.h"
-#include "WorldModelRoot.h"
-#include "Utils.h"
-
-class WDT
-{
-public:
- WDT(std::string file);
-
- ChunkedData* Data;
- std::vector<TilePos> TileTable;
- bool IsGlobalModel;
- bool IsValid;
- std::string ModelFile;
- WorldModelDefinition ModelDefinition;
- WorldModelRoot* Model;
- bool HasTile(int x, int y);
-private:
- void ReadGlobalModel();
- void ReadTileTable();
-};
-
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/WorldModelGroup.cpp b/src/tools/mesh_extractor/WorldModelGroup.cpp
deleted file mode 100644
index 71ca604a57f..00000000000
--- a/src/tools/mesh_extractor/WorldModelGroup.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "WorldModelGroup.h"
-#include "ChunkedData.h"
-#include "Chunk.h"
-#include "Utils.h"
-
-WorldModelGroup::WorldModelGroup( std::string path, int groupIndex ) : GroupIndex(groupIndex), MOBA(NULL), IsBad(false), HasLiquidData(false)
-{
- Data = new ChunkedData(path);
- if (!Data->Stream)
- {
- IsBad = true;
- return;
- }
- Chunk* mainChunk = Data->GetChunkByName("MOGP");
- int32 firstSub = mainChunk->FindSubChunkOffset("MOPY");
- if (firstSub == -1)
- return;
-
- Name = Utils::GetPlainName(path.c_str());
-
- FILE* stream = mainChunk->GetStream();
- fseek(stream, firstSub, SEEK_SET);
- SubData = new ChunkedData(stream, mainChunk->Length - firstSub);
-
- ReadHeader();
- ReadMaterials();
- ReadTriangles();
- ReadVertices();
- ReadNormals();
- ReadLiquid();
- ReadBatches();
-}
-
-void WorldModelGroup::ReadNormals()
-{
- Chunk* chunk = SubData->GetChunkByName("MONR");
- if (!chunk)
- return;
-
- uint32 normalCount = chunk->Length / 12;
- ASSERT(normalCount == Vertices.size() && "normalCount is different than the Vertices count");
- Normals.reserve(normalCount);
- FILE* stream = chunk->GetStream();
- for (uint32 i = 0; i < normalCount; i++)
- Normals.push_back(Vector3::Read(stream));
-}
-
-void WorldModelGroup::ReadLiquid()
-{
- Chunk* chunk = SubData->GetChunkByName("MLIQ");
- if (!chunk)
- return;
-
- HasLiquidData = true;
- FILE* stream = chunk->GetStream();
- LiquidDataHeader = LiquidHeader::Read(stream);
- LiquidDataGeometry = LiquidData::Read(stream, LiquidDataHeader);
-}
-
-void WorldModelGroup::ReadVertices()
-{
- Chunk* chunk = SubData->GetChunkByName("MOVT");
- if (!chunk)
- return;
-
- uint32 verticeCount = chunk->Length / 12;
- Vertices.reserve(verticeCount);
- FILE* stream = chunk->GetStream();
- for (uint32 i = 0; i < verticeCount; i++)
- Vertices.push_back(Vector3::Read(stream));
-}
-
-void WorldModelGroup::ReadTriangles()
-{
- Chunk* chunk = SubData->GetChunkByName("MOVI");
- if (!chunk)
- return;
-
- uint32 triangleCount = chunk->Length / 6;
- ASSERT(triangleCount == TriangleFlags.size() && "triangleCount != TriangleFlags.size()");
- FILE* stream = chunk->GetStream();
- Triangles.reserve(triangleCount);
- for (uint32 i = 0; i < triangleCount; i++)
- {
- uint16 v0;
- uint16 v1;
- uint16 v2;
- int count = 0;
- count += fread(&v0, sizeof(uint16), 1, stream);
- count += fread(&v1, sizeof(uint16), 1, stream);
- count += fread(&v2, sizeof(uint16), 1, stream);
- if (count != 3)
- printf("WorldModelGroup::ReadMaterials: Error reading data, expected 3, read %d\n", count);
-
- Triangles.push_back(Triangle<uint16>(Constants::TRIANGLE_TYPE_WMO, v0, v1, v2));
- }
-}
-
-void WorldModelGroup::ReadMaterials()
-{
- Chunk* chunk = SubData->GetChunkByName("MOPY");
- if (!chunk)
- return;
-
- FILE* stream = chunk->GetStream();
- uint32 triangleCount = chunk->Length / 2;
- TriangleFlags.reserve(triangleCount);
- TriangleMaterials.reserve(triangleCount);
- for (uint32 i = 0; i < triangleCount; i++)
- {
- uint8 tmp;
- if (fread(&tmp, sizeof(uint8), 1, stream) != 1)
- printf("WorldModelGroup::ReadMaterials: Error reading data, expected 1, read 0\n");
- TriangleFlags.push_back(tmp);
- // Read again for material.
- if (fread(&tmp, sizeof(uint8), 1, stream) != 1)
- printf("WorldModelGroup::ReadMaterials: Error reading data, expected 1, read 0\n");
- TriangleMaterials.push_back(tmp);
- }
-}
-
-void WorldModelGroup::ReadHeader()
-{
- Chunk* chunk = Data->GetChunkByName("MOGP");
- if (!chunk)
- return;
-
- FILE* stream = chunk->GetStream();
- Header = WMOGroupHeader::Read(stream);
-}
-
-void WorldModelGroup::ReadBatches()
-{
- Chunk* chunk = Data->GetChunkByName("MOBA");
- if (!chunk)
- return;
-
- MOBALength = chunk->Length / 2;
- MOBA = new uint16[MOBALength];
- uint32 count = (uint32)fread(MOBA, sizeof(uint16), MOBALength, chunk->GetStream());
- if (count != MOBALength)
- printf("WorldModelGroup::ReadBatches: Error reading data, expected %u, read %u\n", MOBALength, count);
-}
diff --git a/src/tools/mesh_extractor/WorldModelGroup.h b/src/tools/mesh_extractor/WorldModelGroup.h
deleted file mode 100644
index 9ce5a11e07c..00000000000
--- a/src/tools/mesh_extractor/WorldModelGroup.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef WMOGROUP_H
-#define WMOGROUP_H
-#include "ChunkedData.h"
-#include "Utils.h"
-
-class WorldModelGroup
-{
-public:
- WorldModelGroup(std::string path, int groupIndex);
- ChunkedData* Data;
- ChunkedData* SubData;
- int GroupIndex;
- std::string Name;
- WMOGroupHeader Header;
-
- std::vector<uint8> TriangleFlags;
- std::vector<uint8> TriangleMaterials;
- std::vector<Triangle<uint16> > Triangles;
- std::vector<Vector3> Vertices;
- std::vector<Vector3> Normals;
- // @ToDo: Research.
- uint16* MOBA;
- uint32 MOBALength;
-
- bool HasLiquidData;
- bool IsBad;
- LiquidHeader LiquidDataHeader;
- LiquidData LiquidDataGeometry;
-private:
- void ReadNormals();
- void ReadLiquid();
- void ReadVertices();
- void ReadTriangles();
- void ReadMaterials();
- void ReadHeader();
- void ReadBatches();
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/WorldModelHandler.cpp b/src/tools/mesh_extractor/WorldModelHandler.cpp
deleted file mode 100644
index b62f7f3435b..00000000000
--- a/src/tools/mesh_extractor/WorldModelHandler.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "WorldModelHandler.h"
-#include "WorldModelRoot.h"
-#include "Chunk.h"
-#include "Cache.h"
-#include "Model.h"
-#include "Define.h"
-#include "G3D/Matrix4.h"
-#include "G3D/Quat.h"
-#include <cstdio>
-
-WorldModelDefinition WorldModelDefinition::Read( FILE* file )
-{
- WorldModelDefinition ret;
- int count = 0;
- count += fread(&ret.MwidIndex, sizeof(uint32), 1, file);
- count += fread(&ret.UniqueId, sizeof(uint32), 1, file);
- ret.Position = Vector3::Read(file);
- ret.Rotation = Vector3::Read(file);
- ret.UpperExtents = Vector3::Read(file);
- ret.LowerExtents = Vector3::Read(file);
- count += fread(&ret.Flags, sizeof(uint16), 1, file);
- count += fread(&ret.DoodadSet, sizeof(uint16), 1, file);
- uint32 discard;
- count += fread(&discard, sizeof(uint32), 1, file);
-
- if (count != 5)
- printf("WorldModelDefinition::Read: Error reading data, expected 5, read %d\n", count);
- return ret;
-}
-
-
-WorldModelHandler::WorldModelHandler( ADT* adt ) : ObjectDataHandler(adt), _definitions(NULL), _paths(NULL)
-{
- ReadModelPaths();
- ReadDefinitions();
-}
-
-void WorldModelHandler::ProcessInternal( MapChunk* mcnk )
-{
- if (!IsSane())
- return;
-
- uint32 refCount = mcnk->Header.MapObjectRefs;
- FILE* stream = mcnk->Source->GetStream();
- fseek(stream, mcnk->Source->Offset + mcnk->Header.OffsetMCRF, SEEK_SET);
- // Start looping at the last Doodad Ref index
- for (uint32 i = mcnk->Header.DoodadRefs; i < refCount; i++)
- {
- int32 index;
- if (fread(&index, sizeof(int32), 1, stream) != 1)
- printf("WorldModelDefinition::Read: Error reading data, expected 1, read 0\n");
-
- if (index < 0 || uint32(index) >= _definitions->size())
- continue;
-
- WorldModelDefinition wmo = (*_definitions)[index];
-
- if (_drawn.find(wmo.UniqueId) != _drawn.end())
- continue;
- _drawn.insert(wmo.UniqueId);
-
- if (wmo.MwidIndex >= _paths->size())
- continue;
-
- std::string path = (*_paths)[wmo.MwidIndex];
- WorldModelRoot* model = Cache->WorldModelCache.Get(path);
- if (!model)
- {
- model = new WorldModelRoot(path);
- Cache->WorldModelCache.Insert(path, model);
- }
-
- Vertices.reserve(1000);
- Triangles.reserve(1000);
-
- InsertModelGeometry(Vertices, Triangles, wmo, model);
- }
- // Restore the stream position
- fseek(stream, mcnk->Source->Offset, SEEK_SET);
-}
-
-void WorldModelHandler::InsertModelGeometry( std::vector<Vector3>& verts, std::vector<Triangle<uint32> >& tris, const WorldModelDefinition& def, WorldModelRoot* root, bool translate )
-{
- for (std::vector<WorldModelGroup>::iterator group = root->Groups.begin(); group != root->Groups.end(); ++group)
- {
- uint32 vertOffset = verts.size();
- for (std::vector<Vector3>::iterator itr2 = group->Vertices.begin(); itr2 != group->Vertices.end(); ++itr2)
- {
- Vector3 v = Utils::TransformDoodadVertex(def, *itr2, translate);
- // If translate is false, then we were called directly from the TileBuilder to add data to it's _Geometry member, hence, we have to manually convert the vertices to Recast format.
- verts.push_back(translate ? v : Utils::ToRecast(v)); // Transform the vertex to world space
- }
-
- for (uint32 i = 0; i < group->Triangles.size(); ++i)
- {
- // only include colliding tris
- if ((group->TriangleFlags[i] & 0x04) != 0 && group->TriangleMaterials[i] != 0xFF)
- continue;
- Triangle<uint16> tri = group->Triangles[i];
- tris.push_back(Triangle<uint32>(Constants::TRIANGLE_TYPE_WMO, tri.V0 + vertOffset, tri.V1 + vertOffset, tri.V2 + vertOffset));
- }
- }
-
- if (def.DoodadSet < root->DoodadSets.size())
- {
- DoodadSet set = root->DoodadSets[def.DoodadSet];
- std::vector<DoodadInstance> instances;
- instances.reserve(set.CountInstances);
- for (uint32 i = set.FirstInstanceIndex; i < (set.CountInstances + set.FirstInstanceIndex); i++)
- {
- if (i >= root->DoodadInstances.size())
- break;
- instances.push_back(root->DoodadInstances[i]);
- }
-
- for (std::vector<DoodadInstance>::iterator instance = instances.begin(); instance != instances.end(); ++instance)
- {
- Model* model = Cache->ModelCache.Get(instance->File);
- if (!model)
- {
- model = new Model(instance->File);
- Cache->ModelCache.Insert(instance->File, model);
- }
-
- if (!model->IsCollidable)
- continue;
- int vertOffset = verts.size();
- for (std::vector<Vector3>::iterator itr2 = model->Vertices.begin(); itr2 != model->Vertices.end(); ++itr2)
- {
- Vector3 v = Utils::TransformDoodadVertex(def, Utils::TransformWmoDoodad(*instance, def, *itr2, false), translate);
- verts.push_back(translate ? v : Utils::ToRecast(v));
- }
- for (std::vector<Triangle<uint16> >::iterator itr2 = model->Triangles.begin(); itr2 != model->Triangles.end(); ++itr2)
- tris.push_back(Triangle<uint32>(Constants::TRIANGLE_TYPE_WMO, itr2->V0 + vertOffset, itr2->V1 + vertOffset, itr2->V2 + vertOffset));
- }
-
- for (std::vector<WorldModelGroup>::iterator group = root->Groups.begin(); group != root->Groups.end(); ++group)
- {
- if (!group->HasLiquidData)
- continue;
-
- const LiquidHeader& liquidHeader = group->LiquidDataHeader;
- LiquidData& liquidDataGeometry = group->LiquidDataGeometry;
-
- for (uint32 y = 0; y < liquidHeader.Height; y++)
- {
- for (uint32 x = 0; x < liquidHeader.Width; x++)
- {
-
- if (!liquidDataGeometry.ShouldRender(x, y))
- continue;
-
- uint32 vertOffset = verts.size();
-
- Vector3 v1 = Utils::GetLiquidVert(def, liquidHeader.BaseLocation,
- liquidDataGeometry.HeightMap[x][y], x, y, translate);
- Vector3 v2 = Utils::GetLiquidVert(def, liquidHeader.BaseLocation,
- liquidDataGeometry.HeightMap[x + 1][y], x + 1, y, translate);
- Vector3 v3 = Utils::GetLiquidVert(def, liquidHeader.BaseLocation,
- liquidDataGeometry.HeightMap[x][y + 1], x, y + 1, translate);
- Vector3 v4 = Utils::GetLiquidVert(def, liquidHeader.BaseLocation,
- liquidDataGeometry.HeightMap[x + 1][y + 1], x + 1, y + 1, translate);
-
- verts.push_back(translate ? v1 : Utils::ToRecast(v1));
- verts.push_back(translate ? v2 : Utils::ToRecast(v2));
- verts.push_back(translate ? v3 : Utils::ToRecast(v3));
- verts.push_back(translate ? v4 : Utils::ToRecast(v4));
-
- tris.push_back(Triangle<uint32>(Constants::TRIANGLE_TYPE_WATER, vertOffset, vertOffset + 2, vertOffset + 1));
- tris.push_back(Triangle<uint32>(Constants::TRIANGLE_TYPE_WATER, vertOffset + 2, vertOffset + 3, vertOffset + 1));
-
- }
- }
- }
- }
-}
-
-void WorldModelHandler::ReadDefinitions()
-{
- Chunk* chunk = Source->ObjectData->GetChunkByName("MODF");
- if (!chunk)
- return;
-
- const int32 definitionSize = 64;
- uint32 definitionCount = chunk->Length / definitionSize;
- _definitions = new std::vector<WorldModelDefinition>;
- _definitions->reserve(definitionCount);
- FILE* stream = chunk->GetStream();
- for (uint32 i = 0; i < definitionCount; i++)
- _definitions->push_back(WorldModelDefinition::Read(stream));
-}
-
-void WorldModelHandler::ReadModelPaths()
-{
- Chunk* mwid = Source->ObjectData->GetChunkByName("MWID");
- Chunk* mwmo = Source->ObjectData->GetChunkByName("MWMO");
- if (!mwid || !mwmo)
- return;
-
- uint32 paths = mwid->Length / 4;
- _paths = new std::vector<std::string>;
- _paths->reserve(paths);
- for (uint32 i = 0; i < paths; i++)
- {
- FILE* stream = mwid->GetStream();
- fseek(stream, i * 4, SEEK_CUR);
- uint32 offset;
- if (fread(&offset, sizeof(uint32), 1, stream) != 1)
- printf("WorldModelDefinition::Read: Error reading data, expected 1, read 0\n");
- FILE* dataStream = mwmo->GetStream();
- fseek(dataStream, offset + mwmo->Offset, SEEK_SET);
- _paths->push_back(Utils::ReadString(dataStream));
- }
-}
-
-WorldModelHandler::~WorldModelHandler()
-{
- delete _definitions;
- delete _paths;
-}
diff --git a/src/tools/mesh_extractor/WorldModelHandler.h b/src/tools/mesh_extractor/WorldModelHandler.h
deleted file mode 100644
index fdb31a35c48..00000000000
--- a/src/tools/mesh_extractor/WorldModelHandler.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef WMODEL_HNDL_H
-#define WMODEL_HNDL_H
-#include "Define.h"
-#include "Utils.h"
-#include "WorldModelRoot.h"
-#include "ObjectDataHandler.h"
-
-#include <set>
-#include <vector>
-
-class ADT;
-
-struct WorldModelDefinition : public IDefinition
-{
-public:
- WorldModelDefinition() {}
-
- uint32 MwidIndex;
- uint32 UniqueId;
- Vector3 UpperExtents;
- Vector3 LowerExtents;
- uint16 Flags;
- uint16 DoodadSet;
-
- static WorldModelDefinition Read(FILE* file);
-};
-
-class WorldModelHandler : public ObjectDataHandler
-{
-public:
- WorldModelHandler(ADT* adt);
- ~WorldModelHandler();
-
- std::vector<Vector3> Vertices;
- std::vector<Triangle<uint32> > Triangles;
- bool IsSane() { return _definitions && _paths; }
- static void InsertModelGeometry(std::vector<Vector3>& verts, std::vector<Triangle<uint32> >& tris, const WorldModelDefinition& def, WorldModelRoot* root, bool translate = true);
-protected:
- void ProcessInternal(MapChunk* data);
-private:
- void ReadDefinitions();
- void ReadModelPaths();
- std::set<uint32> _drawn;
- std::vector<WorldModelDefinition>* _definitions;
- std::vector<std::string>* _paths;
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/WorldModelRoot.cpp b/src/tools/mesh_extractor/WorldModelRoot.cpp
deleted file mode 100644
index f75b2eead3e..00000000000
--- a/src/tools/mesh_extractor/WorldModelRoot.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "WorldModelRoot.h"
-#include "ChunkedData.h"
-#include "Utils.h"
-
-WorldModelRoot::WorldModelRoot( std::string path )
-{
- Data = new ChunkedData(path);
- Path = path;
- ReadHeader();
- ReadGroups();
- ReadDoodadInstances();
- ReadDoodadSets();
-}
-
-WorldModelRoot::~WorldModelRoot()
-{
- delete Data;
-}
-
-void WorldModelRoot::ReadGroups()
-{
- std::string pathBase = Utils::GetPathBase(Path);
- Groups.reserve(Header.CountGroups);
- for (uint32 i = 0; i < Header.CountGroups; i++)
- {
- char name[200];
- sprintf(name, "%s_%03u.wmo", pathBase.c_str(), i);
- WorldModelGroup group(name, i);
- if (!group.IsBad)
- Groups.push_back(group);
- }
-}
-
-void WorldModelRoot::ReadDoodadSets()
-{
- Chunk* chunk = Data->GetChunkByName("MODS");
- if (!chunk)
- return;
-
- FILE* stream = chunk->GetStream();
- ASSERT(chunk->Length / 32 == Header.CountSets && "chunk.Length / 32 == Header.CountSets");
- DoodadSets.reserve(Header.CountSets);
- for (uint32 i = 0; i < Header.CountSets; i++)
- DoodadSets.push_back(DoodadSet::Read(stream));
-}
-
-void WorldModelRoot::ReadDoodadInstances()
-{
- Chunk* chunk = Data->GetChunkByName("MODD");
- Chunk* nameChunk = Data->GetChunkByName("MODN");
- if (!chunk || !nameChunk)
- return;
-
- const uint32 instanceSize = 40;
- uint32 countInstances = chunk->Length / instanceSize;
- DoodadInstances.reserve(countInstances);
- for (uint32 i = 0; i < countInstances; i++)
- {
- FILE* stream = chunk->GetStream();
- fseek(stream, instanceSize * i, SEEK_CUR);
- DoodadInstance instance = DoodadInstance::Read(stream);
- FILE* nameStream = nameChunk->GetStream();
- if (instance.FileOffset >= nameChunk->Length)
- continue;
- fseek(nameStream, instance.FileOffset, SEEK_CUR);
- instance.File = Utils::ReadString(nameStream);
- DoodadInstances.push_back(instance);
- }
-}
-
-void WorldModelRoot::ReadHeader()
-{
- Chunk* chunk = Data->GetChunkByName("MOHD");
- if (!chunk)
- return;
-
- FILE* stream = chunk->GetStream();
- Header = WorldModelHeader::Read(stream);
-}
diff --git a/src/tools/mesh_extractor/WorldModelRoot.h b/src/tools/mesh_extractor/WorldModelRoot.h
deleted file mode 100644
index 1be2086b466..00000000000
--- a/src/tools/mesh_extractor/WorldModelRoot.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef WMOROOT_H
-#define WMOROOT_H
-#include <string>
-#include <vector>
-
-#include "ChunkedData.h"
-#include "Utils.h"
-#include "WorldModelGroup.h"
-
-class WorldModelRoot
-{
-public:
- WorldModelRoot(std::string path);
- ~WorldModelRoot();
- std::string Path;
- ChunkedData* Data;
- WorldModelHeader Header;
- std::vector<DoodadInstance> DoodadInstances;
- std::vector<DoodadSet> DoodadSets;
- std::vector<WorldModelGroup> Groups;
-private:
- void ReadGroups();
- void ReadDoodadSets();
- void ReadDoodadInstances();
- void ReadHeader();
-};
-#endif \ No newline at end of file
diff --git a/src/tools/mesh_extractor/readme b/src/tools/mesh_extractor/readme
deleted file mode 100644
index 85cd7cfc975..00000000000
--- a/src/tools/mesh_extractor/readme
+++ /dev/null
@@ -1,6 +0,0 @@
-Experimental mesh extractor.
-Original work in C# by stschake
-Thanks to:
-Subv
-~
-For helping in the porting to C++ \ No newline at end of file