Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git://github.com/blueboy/portal

  • Loading branch information...
commit a7d9d2bccadd6556e86fbeb5821951b25e720b0f 2 parents 28ab4bd + 03a5c35
blueboy blueboy authored
Showing with 1,895 additions and 1,209 deletions.
  1. +56 −29 README
  2. +3 −3 contrib/extractor_binary/ExtractResources.sh
  3. +1 −1  contrib/extractor_binary/README.txt
  4. 0  contrib/extractor_binary/{vmapExtractor3.exe → vmapExtractor.exe}
  5. +2 −2 contrib/git_id/git_id.cpp
  6. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/.gitignore
  7. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/CMakeLists.txt
  8. +3 −3 contrib/{vmap_extractor_v3 → vmap_extractor}/README
  9. +1 −1  contrib/{vmap_extractor_v3 → vmap_extractor}/make_vmaps.bat
  10. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/CMakeLists.txt
  11. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/adtfile.cpp
  12. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/adtfile.h
  13. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/dbcfile.cpp
  14. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/dbcfile.h
  15. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/loadlib/loadlib.h
  16. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/model.cpp
  17. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/model.h
  18. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/modelheaders.h
  19. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/mpq_libmpq.cpp
  20. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/mpq_libmpq04.h
  21. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/vec3d.h
  22. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/vmapexport.cpp
  23. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/vmapexport.h
  24. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/wdtfile.cpp
  25. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/wdtfile.h
  26. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/wmo.cpp
  27. 0  contrib/{vmap_extractor_v3 → vmap_extractor}/vmapextract/wmo.h
  28. +1 −1  .../{vmap_extractor_v3/win/VC100/vmapExtractor3.vcxproj → vmap_extractor/win/VC100/vmapExtractor.vcxproj}
  29. +2 −2 contrib/{vmap_extractor_v3/win/VC90/vmapExtractor3.vcproj → vmap_extractor/win/VC90/vmapExtractor.vcproj}
  30. +1 −1  contrib/{vmap_extractor_v3/win/vmapExtractor3_VC100.sln → vmap_extractor/win/vmapExtractor_VC100.sln}
  31. +1 −1  contrib/{vmap_extractor_v3/win/vmapExtractor3_VC90.sln → vmap_extractor/win/vmapExtractor_VC90.sln}
  32. +21 −3 doc/EventAI.txt
  33. +46 −2 sql/mangos.sql
  34. +13 −0 sql/updates/12188_01_mangos_vehicle_accessory.sql
  35. +23 −0 sql/updates/12189_01_mangos_creature_template_spells.sql
  36. +2 −2 src/game/AuctionHouseBot/AuctionHouseBot.cpp
  37. +1 −1  src/game/BattleGround/BattleGroundAV.cpp
  38. +48 −33 src/game/Creature.cpp
  39. +13 −9 src/game/Creature.h
  40. +21 −14 src/game/CreatureEventAI.cpp
  41. +4 −2 src/game/CreatureEventAI.h
  42. +3 −2 src/game/CreatureEventAIMgr.cpp
  43. +23 −0 src/game/DBCEnums.h
  44. +4 −0 src/game/DBCStores.cpp
  45. +1 −1  src/game/DuelHandler.cpp
  46. +3 −3 src/game/FleeingMovementGenerator.cpp
  47. +1 −1  src/game/GridNotifiersImpl.h
  48. +1 −1  src/game/HomeMovementGenerator.cpp
  49. +7 −7 src/game/Level3.cpp
  50. +2 −4 src/game/LootHandler.cpp
  51. +9 −9 src/game/LootMgr.cpp
  52. +1 −0  src/game/Map.h
  53. +2 −8 src/game/MiscHandler.cpp
  54. +0 −6 src/game/MotionMaster.cpp
  55. +0 −3  src/game/MotionMaster.h
  56. +1 −1  src/game/MoveMap.h
  57. +0 −2  src/game/MovementGenerator.h
  58. +5 −2 src/game/MovementHandler.cpp
  59. +1 −1  src/game/NPCHandler.cpp
  60. +0 −2  src/game/Object.h
  61. +96 −162 src/game/ObjectMgr.cpp
  62. +11 −30 src/game/ObjectMgr.h
  63. +2 −2 src/game/Opcodes.cpp
  64. +1 −1  src/game/OutdoorPvP/OutdoorPvPNA.cpp
  65. +1 −1  src/game/OutdoorPvP/OutdoorPvPNA.h
  66. +2 −2 src/game/OutdoorPvP/OutdoorPvPSI.cpp
  67. +6 −6 src/game/OutdoorPvP/OutdoorPvPZM.cpp
  68. +15 −20 src/game/PathFinder.cpp
  69. +1 −1  src/game/Pet.cpp
  70. +61 −67 src/game/Player.cpp
  71. +102 −102 src/game/Player.h
  72. +2 −2 src/game/QueryHandler.cpp
  73. +2 −2 src/game/RandomMovementGenerator.cpp
  74. +12 −4 src/game/SQLStorages.cpp
  75. +6 −2 src/game/SQLStorages.h
  76. +50 −59 src/game/ScriptMgr.cpp
  77. +13 −4 src/game/SharedDefines.h
  78. +136 −78 src/game/Spell.cpp
  79. +4 −0 src/game/Spell.h
  80. +2 −2 src/game/SpellAuraDefines.h
  81. +59 −42 src/game/SpellAuras.cpp
  82. +1 −0  src/game/SpellAuras.h
  83. +84 −20 src/game/SpellEffects.cpp
  84. +7 −4 src/game/SpellMgr.cpp
  85. +1 −3 src/game/SpellMgr.h
  86. +40 −75 src/game/TargetedMovementGenerator.cpp
  87. +4 −5 src/game/TargetedMovementGenerator.h
  88. +2 −2 src/game/Totem.cpp
  89. +1 −1  src/game/Totem.h
  90. +20 −1 src/game/TransportSystem.cpp
  91. +6 −0 src/game/TransportSystem.h
  92. +135 −110 src/game/Unit.cpp
  93. +17 −8 src/game/Unit.h
  94. +2 −2 src/game/UnitAuraProcHandler.cpp
  95. +117 −17 src/game/Vehicle.cpp
  96. +20 −2 src/game/Vehicle.h
  97. +40 −0 src/game/VehicleHandler.cpp
  98. +3 −3 src/game/WaypointMovementGenerator.cpp
  99. +1 −1  src/game/Weather.cpp
  100. +7 −1 src/game/World.cpp
  101. +1 −1  src/game/WorldSession.cpp
  102. +2 −0  src/game/WorldSession.h
  103. +3 −2 src/game/movement/MoveSpline.cpp
  104. +1 −1  src/game/movement/MoveSplineInit.cpp
  105. +3 −1 src/game/movement/MoveSplineInitArgs.h
  106. +5 −5 src/mangosd/mangosd.conf.dist.in
  107. +1 −1  src/shared/Database/DBCFileLoader.h
  108. +180 −58 src/shared/Database/SQLStorage.cpp
  109. +204 −46 src/shared/Database/SQLStorage.h
  110. +68 −80 src/shared/Database/SQLStorageImpl.h
  111. +2 −2 src/shared/Database/SqlOperations.cpp
  112. +2 −2 src/shared/Log.cpp
  113. +2 −1  src/shared/WheatyExceptionReport.cpp
  114. +1 −1  src/shared/revision_nr.h
  115. +1 −1  src/shared/revision_sql.h
85 README
View
@@ -1,8 +1,8 @@
-= MaNGOS -- README =
+= C(ontinued)-MaNGOS -- README =
-Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
+Copyright (C) 2005-2012 C(ontinued)-MaNGOS project
- MaNGOS is free software; you can redistribute it and/or modify
+ CMaNGOS 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.
@@ -16,37 +16,64 @@ Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- In addition, as a special exception, the MaNGOS project
- gives permission to link the code of its release of MaNGOS with the
- OpenSSL project's "OpenSSL" library (or with modified versions of it
- that use the same license as the "OpenSSL" library), and distribute
- the linked executables. You must obey the GNU General Public License
- in all respects for all of the code used other than "OpenSSL". If you
- modify this file, you may extend this exception to your version of the
- file, but you are not obligated to do so. If you do not wish to do
- so, delete this exception statement from your version.
+ Exceptions where the GPL does not apply are below
+
+=== Welcome to C(ontinued)-MaNGOS ===
+
+C(ontinued)-MaNGOS is a project with the goal:
+
+ Doing WoW-Emulation Right!
+
+This means, we want to focus on:
-Comments are welcome.
+* WoW-Emulation:
+ This project is about developing a server software to be able to
+ emulate some well known MMORPG service
- - theluda <theluda@getmangos.com>
+* Doing:
+ - This project is focused about developing content!
+ - Also there are many more aspects that need to be done and are
+ considered equally important.
+ So anybody who wants to do stuff is very welcome to do so!
-== Welcome to MaNGOS ==
+* Right:
+ - Our goal always must be to provide the best code we can
+ - Being 'right' is defined by the behavior of the system
+ we want to emulate
+ - Developing things right also contains documenting and discussing
+ _how_ to do things better, hence
+ - Learning and Teaching are very important in our view, and must
+ always be part of what we do.
-MaNGOS (the Massive Network Game Object Server) is an Open Source reference
-implementation for a MMORPG server system. Please see the file COPYING for
-license details.
+To be able to provide for these goals, we assert:
-For further information on the MaNGOS project, please visit our project web
-site at <http://getmangos.com/>
+* Freedom
+ - for our developers and contributers on things that interest them.
+ No one here is telling anybody _what_ to do.
+ If you want somebody to do something for you, pay him,
+ but we are here to enjoy.
+ - to have FUN with developing.
-Documentation on various development related topics can be found in the doc/
-subdirectory, including Doxygen-generated API documentation.
+* A friendly environment
+ - we try to let personal issues behind us
+ - we only argue about content, and not about thin air!
+ - we follow the Netiquette <insert link when found>
-The required SQL files for creating the database backend are included in the
-sql/ subdirectory. In case you are upgrading from an older MaNGOS release,
-make sure you as well take a look at the SQL files in the sql/updates/ sub-
-directory.
+Documentation can be found in the doc/ subdirectory.
-In order to build and install MaNGOS under Windows, simply use the delivered
-project files under win/. If you use a different system use CMake to generate
-the appropriate build files for your system.
+-- The C(ontinued)-MaNGOS Team!
+
+== Exceptions to GPL ==
+
+ Some third-party libraries CMaNGOS uses have other licenses, that must be uphold.
+ These libraries are located within the dep/ directory
+
+ In addition, as a special exception, the CMaNGOS project
+ gives permission to link the code of its release of MaNGOS with the
+ OpenSSL project's "OpenSSL" library (or with modified versions of it
+ that use the same license as the "OpenSSL" library), and distribute
+ the linked executables. You must obey the GNU General Public License
+ in all respects for all of the code used other than "OpenSSL". If you
+ modify this file, you may extend this exception to your version of the
+ file, but you are not obligated to do so. If you do not wish to do
+ so, delete this exception statement from your version.
6 contrib/extractor_binary/ExtractResources.sh
View
@@ -144,11 +144,11 @@ fi
if [ "$USE_VMAPS" = "1" ]
then
echo "`date`: Start extraction of vmaps..." | tee -a $LOG_FILE
- vmapExtractor3 | tee -a $DETAIL_LOG_FILE
+ vmapExtractor | tee -a $DETAIL_LOG_FILE
echo "`date`: Extracting of vmaps finished" | tee -a $LOG_FILE
mkdir vmaps
echo "`date`: Start assembling of vmaps..." | tee -a $LOG_FILE
- vmap_assembler.exe buildings vmaps | tee -a $DETAIL_LOG_FILE
+ vmap_assembler buildings vmaps | tee -a $DETAIL_LOG_FILE
echo "`date`: Assembling of vmaps finished" | tee -a $LOG_FILE
echo | tee -a $LOG_FILE
@@ -158,5 +158,5 @@ fi
## Extract mmaps
if [ "$USE_MMAPS" = "1" ]
then
- MoveMapGen.sh $NUM_CPU $LOG_FILE $DETAIL_LOG_FILE
+ sh MoveMapGen.sh $NUM_CPU $LOG_FILE $DETAIL_LOG_FILE
fi
2  contrib/extractor_binary/README.txt
View
@@ -31,6 +31,6 @@ MaNGOSExtractor_detailed.log which includes all the information about the extrac
If you want to toggle some parts in the extraction process, there are a few internal variables in the extraction scripts, that can be modified.
-Consider the Readme's in the directories extractor, vmap_assembler, vmap_extractor_v3 and mmap for further information about detail.
+Consider the Readme's in the directories extractor, vmap_assembler, vmap_extractor and mmap for further information about detail.
Also especially related to mmaps updating you might be interested in using the MoveMapGen.sh script.
0  contrib/extractor_binary/vmapExtractor3.exe → contrib/extractor_binary/vmapExtractor.exe
View
File renamed without changes
4 contrib/git_id/git_id.cpp
View
@@ -53,8 +53,8 @@
#define NUM_DATABASES 3
char remotes[NUM_REMOTES][MAX_REMOTE] = {
- "git@github.com:mangos/mangos.git",
- "git://github.com/mangos/mangos.git" // used for fetch if present
+ "git@github.com:cmangos/mangos-wotlk.git",
+ "git://github.com/cmangos/mangos-wotlk.git" // used for fetch if present
};
char remote_branch[MAX_REMOTE] = "master";
0  contrib/vmap_extractor_v3/.gitignore → contrib/vmap_extractor/.gitignore
View
File renamed without changes
0  contrib/vmap_extractor_v3/CMakeLists.txt → contrib/vmap_extractor/CMakeLists.txt
View
File renamed without changes
6 contrib/vmap_extractor_v3/README → contrib/vmap_extractor/README
View
@@ -9,7 +9,7 @@ Linux:
$ ./configure
$ make
- After that, cd to contrib/vmap_extractor_v2/ and execute:
+ After that, cd to contrib/vmap_extractor/ and execute:
$ cmake .
$ make
@@ -30,8 +30,8 @@ Windows:
1. Building
- Just build the solution in contrib\vmap_extractor_v2\win
- Resulting binaries will be in contrib\vmap_extractor_v2\bin\$(PlatformName)_$(ConfigurationName)
+ Just build the solution in contrib\vmap_extractor\win
+ Resulting binaries will be in contrib\vmap_extractor\bin\$(PlatformName)_$(ConfigurationName)
2. Extracting
2  contrib/vmap_extractor_v3/make_vmaps.bat → contrib/vmap_extractor/make_vmaps.bat
View
@@ -14,7 +14,7 @@ IF EXIST buildings\dir (ECHO The buildings folder already exist do you want to d
echo If YES hit Enter to continue if no CLOSE the program now! . . .
pause>nul
DEL /S /Q buildings)
-vmapExtractor3.exe
+vmapExtractor.exe
cls
echo.
echo.
0  contrib/vmap_extractor_v3/vmapextract/CMakeLists.txt → contrib/vmap_extractor/vmapextract/CMakeLists.txt
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/adtfile.cpp → contrib/vmap_extractor/vmapextract/adtfile.cpp
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/adtfile.h → contrib/vmap_extractor/vmapextract/adtfile.h
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/dbcfile.cpp → contrib/vmap_extractor/vmapextract/dbcfile.cpp
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/dbcfile.h → contrib/vmap_extractor/vmapextract/dbcfile.h
View
File renamed without changes
0  ...b/vmap_extractor_v3/vmapextract/loadlib/loadlib.h → contrib/vmap_extractor/vmapextract/loadlib/loadlib.h
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/model.cpp → contrib/vmap_extractor/vmapextract/model.cpp
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/model.h → contrib/vmap_extractor/vmapextract/model.h
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/modelheaders.h → contrib/vmap_extractor/vmapextract/modelheaders.h
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/mpq_libmpq.cpp → contrib/vmap_extractor/vmapextract/mpq_libmpq.cpp
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/mpq_libmpq04.h → contrib/vmap_extractor/vmapextract/mpq_libmpq04.h
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/vec3d.h → contrib/vmap_extractor/vmapextract/vec3d.h
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/vmapexport.cpp → contrib/vmap_extractor/vmapextract/vmapexport.cpp
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/vmapexport.h → contrib/vmap_extractor/vmapextract/vmapexport.h
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/wdtfile.cpp → contrib/vmap_extractor/vmapextract/wdtfile.cpp
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/wdtfile.h → contrib/vmap_extractor/vmapextract/wdtfile.h
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/wmo.cpp → contrib/vmap_extractor/vmapextract/wmo.cpp
View
File renamed without changes
0  contrib/vmap_extractor_v3/vmapextract/wmo.h → contrib/vmap_extractor/vmapextract/wmo.h
View
File renamed without changes
2  ...map_extractor_v3/win/VC100/vmapExtractor3.vcxproj → ...ib/vmap_extractor/win/VC100/vmapExtractor.vcxproj
View
@@ -12,7 +12,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}</ProjectGuid>
- <RootNamespace>vmapExtractor3</RootNamespace>
+ <RootNamespace>vmapExtractor</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
4 .../vmap_extractor_v3/win/VC90/vmapExtractor3.vcproj → contrib/vmap_extractor/win/VC90/vmapExtractor.vcproj
View
@@ -2,9 +2,9 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
- Name="vmapExtractor3"
+ Name="vmapExtractor"
ProjectGUID="{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
- RootNamespace="vmapExtractor3"
+ RootNamespace="vmapExtractor"
TargetFrameworkVersion="196613"
>
<Platforms>
2  ...ib/vmap_extractor_v3/win/vmapExtractor3_VC100.sln → contrib/vmap_extractor/win/vmapExtractor_VC100.sln
View
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor3", "VC100\vmapExtractor3.vcxproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor", "VC100\vmapExtractor.vcxproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
ProjectSection(ProjectDependencies) = postProject
{B96F612A-C91D-43B3-A4C3-D4294817EC6C} = {B96F612A-C91D-43B3-A4C3-D4294817EC6C}
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}
2  ...rib/vmap_extractor_v3/win/vmapExtractor3_VC90.sln → contrib/vmap_extractor/win/vmapExtractor_VC90.sln
View
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor3", "VC90\vmapExtractor3.vcproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor", "VC90\vmapExtractor.vcproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
ProjectSection(ProjectDependencies) = postProject
{B96F612A-C91D-43B3-A4C3-D4294817EC6C} = {B96F612A-C91D-43B3-A4C3-D4294817EC6C}
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}
24 doc/EventAI.txt
View
@@ -64,7 +64,7 @@ Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_E
# Internal Name Event Param Usage (Param1, Param2, Param3, Param4) Description
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-0 EVENT_T_TIMER InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4), EXPIRES ONLY IN COMBAT.
+0 EVENT_T_TIMER_IN_COMBAT InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4), EXPIRES ONLY IN COMBAT.
1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4), EXPIRES ONLY OUT OF COMBAT BUT NOT DURING EVADE.
2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when the NPC's HP% is between (Param1) and (Param2). Will repeat between every (Param3) and (Param4) If Event Conditions Are Still Met.
3 EVENT_T_MANA ManaMax%, ManaMin%, RepeatMin, RepeatMax Expires when the NPC's Mana% is between (Param1) and (Param2). Will repeat between every (Param3) and (Param4) If Event Conditions Are Still Met.
@@ -91,6 +91,7 @@ Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_E
26 EVENT_T_SUMMONED_JUST_DESPAWN CreatureId, RepeatMin, RepeatMax Expires before creature with entry = (Param1) is despawn (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
27 EVENT_T_MISSING_AURA SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a creature not has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
28 EVENT_T_TARGET_MISSING_AURA SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a target unit not has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
+29 EVENT_T_TIMER_GENERIC InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4).
=========================================
Action Types
@@ -162,7 +163,7 @@ BOTH - This event can trigger both in and out of combat.
Events that do not have lables on them are events that are directly involved with the in and out of combat state.
------------------
-0 = EVENT_T_TIMER:
+0 = EVENT_T_TIMER_IN_COMBAT:
------------------
Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
@@ -180,7 +181,7 @@ Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Event Ex
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
-OUT OF COMBAT ONLY - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
+OUT OF COMBAT ONLY (Not while evading) - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
This is commonly used for events that occur and repeat outside of combat like random NPC Say or Random Emotes.
---------------
@@ -428,6 +429,23 @@ Parameter 2: Amount - This is the amount or less of SpellID's auras at creature
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+---------------------------------
+28 = EVENT_T_TARGET_MISSING_AURA:
+---------------------------------
+Parameter 1: SpellId - This is the SpellID That the Aura Check will look for to be missing
+Parameter 2: Amount - This is the amount or less of SpellID's auras at creature required for event expire.
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+---------------------------
+29 = EVENT_T_TIMER_GENERIC:
+---------------------------
+Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
+Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+IN COMBAT and OUT OF COMBAT - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
=========================================
48 sql/mangos.sql
View
@@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0',
- `required_12148_02_mangos_mangos_string` bit(1) default NULL
+ `required_12189_01_mangos_creature_template_spells` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
--
@@ -1386,13 +1386,37 @@ CREATE TABLE `creature_template_addon` (
--
-- Dumping data for table `creature_template_addon`
--
-
LOCK TABLES `creature_template_addon` WRITE;
/*!40000 ALTER TABLE `creature_template_addon` DISABLE KEYS */;
/*!40000 ALTER TABLE `creature_template_addon` ENABLE KEYS */;
UNLOCK TABLES;
--
+-- Table structure for table `creature_template_spells`
+--
+DROP TABLE IF EXISTS `creature_template_spells`;
+CREATE TABLE `creature_template_spells` (
+ `entry` mediumint(8) unsigned NOT NULL,
+ `spell1` mediumint(8) unsigned NOT NULL,
+ `spell2` mediumint(8) unsigned NOT NULL default '0',
+ `spell3` mediumint(8) unsigned NOT NULL default '0',
+ `spell4` mediumint(8) unsigned NOT NULL default '0',
+ `spell5` mediumint(8) unsigned NOT NULL default '0',
+ `spell6` mediumint(8) unsigned NOT NULL default '0',
+ `spell7` mediumint(8) unsigned NOT NULL default '0',
+ `spell8` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System (Spells used by creature)';
+
+--
+-- Dumping data for table `creature_template_spells`
+--
+LOCK TABLES `creature_template_spells` WRITE;
+/*!40000 ALTER TABLE `creature_template_spells` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_template_spells` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
-- Table structure for table `db_script_string`
--
@@ -18867,6 +18891,26 @@ LOCK TABLES `transports` WRITE;
UNLOCK TABLES;
--
+-- Table structure for table `vehicle_accessory`
+--
+DROP TABLE IF EXISTS vehicle_accessory;
+CREATE TABLE `vehicle_accessory` (
+ `vehicle_entry` int(10) UNSIGNED NOT NULL COMMENT 'entry of the npc who has some accessory as vehicle',
+ `seat` mediumint(8) UNSIGNED NOT NULL COMMENT 'onto which seat shall the passenger be boarded',
+ `accessory_entry` int(10) UNSIGNED NOT NULL COMMENT 'entry of the passenger that is to be boarded',
+ `comment` varchar(255) NOT NULL,
+ PRIMARY KEY (`vehicle_entry`, `seat`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Vehicle Accessory (passengers that are auto-boarded onto a vehicle)';
+
+--
+-- Dumping data for table `vehicle_accessory`
+--
+LOCK TABLES `vehicle_accessory` WRITE;
+/*!40000 ALTER TABLE `vehicle_accessory` DISABLE KEYS */;
+/*!40000 ALTER TABLE `vehicle_accessory` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
-- Table structure for table `world_template`
--
13 sql/updates/12188_01_mangos_vehicle_accessory.sql
View
@@ -0,0 +1,13 @@
+ALTER TABLE db_version CHANGE COLUMN required_12148_02_mangos_mangos_string required_12188_01_mangos_vehicle_accessory bit;
+
+--
+-- Table structure for table `vehicle_accessory`
+--
+DROP TABLE IF EXISTS vehicle_accessory;
+CREATE TABLE `vehicle_accessory` (
+ `vehicle_entry` int(10) UNSIGNED NOT NULL COMMENT 'entry of the npc who has some accessory as vehicle',
+ `seat` mediumint(8) UNSIGNED NOT NULL COMMENT 'onto which seat shall the passenger be boarded',
+ `accessory_entry` int(10) UNSIGNED NOT NULL COMMENT 'entry of the passenger that is to be boarded',
+ `comment` varchar(255) NOT NULL,
+ PRIMARY KEY (`vehicle_entry`, `seat`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Vehicle Accessory (passengers that are auto-boarded onto a vehicle)';
23 sql/updates/12189_01_mangos_creature_template_spells.sql
View
@@ -0,0 +1,23 @@
+ALTER TABLE db_version CHANGE COLUMN required_12188_01_mangos_vehicle_accessory required_12189_01_mangos_creature_template_spells bit;
+
+--
+-- Table structure for table `creature_template_spells`
+--
+DROP TABLE IF EXISTS `creature_template_spells`;
+CREATE TABLE `creature_template_spells` (
+ `entry` mediumint(8) unsigned NOT NULL,
+ `spell1` mediumint(8) unsigned NOT NULL,
+ `spell2` mediumint(8) unsigned NOT NULL default '0',
+ `spell3` mediumint(8) unsigned NOT NULL default '0',
+ `spell4` mediumint(8) unsigned NOT NULL default '0',
+ `spell5` mediumint(8) unsigned NOT NULL default '0',
+ `spell6` mediumint(8) unsigned NOT NULL default '0',
+ `spell7` mediumint(8) unsigned NOT NULL default '0',
+ `spell8` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System (Spells used by creature)';
+
+--
+-- Dumping data for table `creature_template_spells`
+--
+INSERT INTO creature_template_spells (entry, spell1, spell2, spell3, spell4) SELECT entry, spell1, spell2, spell3, spell4 FROM creature_template WHERE spell1!=0;
4 src/game/AuctionHouseBot/AuctionHouseBot.cpp
View
@@ -956,8 +956,8 @@ bool AuctionBotSeller::Initialize()
uint32 itemsAdded = 0;
- BarGoLink bar(sItemStorage.MaxEntry);
- for (uint32 itemID = 0; itemID < sItemStorage.MaxEntry; ++itemID)
+ BarGoLink bar(sItemStorage.GetMaxEntry());
+ for (uint32 itemID = 0; itemID < sItemStorage.GetMaxEntry(); ++itemID)
{
ItemPrototype const* prototype = sObjectMgr.GetItemPrototype(itemID);
2  src/game/BattleGround/BattleGroundAV.cpp
View
@@ -116,7 +116,7 @@ void BattleGroundAV::HandleQuestComplete(uint32 questid, Player* player)
case BG_AV_QUEST_H_SCRAPS2:
m_Team_QuestStatus[teamIdx][0] += 20;
reputation = 1;
- if (m_Team_QuestStatus[teamIdx][0] == 500 || m_Team_QuestStatus[teamIdx][0] == 1000 || m_Team_QuestStatus[teamIdx][0] == 1500) //25,50,75 turn ins
+ if (m_Team_QuestStatus[teamIdx][0] == 500 || m_Team_QuestStatus[teamIdx][0] == 1000 || m_Team_QuestStatus[teamIdx][0] == 1500) // 25,50,75 turn ins
{
DEBUG_LOG("BattleGroundAV: Quest %i completed starting with unit upgrading..", questid);
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i)
81 src/game/Creature.cpp
View
@@ -23,6 +23,7 @@
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ObjectGuid.h"
+#include "SQLStorages.h"
#include "SpellMgr.h"
#include "QuestDef.h"
#include "GossipDef.h"
@@ -178,7 +179,7 @@ Creature::Creature(CreatureSubtype subtype) : Unit(),
m_CreatureSpellCooldowns.clear();
m_CreatureCategoryCooldowns.clear();
- SetWalk(true);
+ SetWalk(true, true);
}
Creature::~Creature()
@@ -327,7 +328,7 @@ bool Creature::InitEntry(uint32 Entry, CreatureData const* data /*=NULL*/, GameE
UpdateSpeed(MOVE_WALK, false);
UpdateSpeed(MOVE_RUN, false);
- SetLevitate(CanFly());
+ SetLevitate(cinfo->InhabitType & INHABIT_AIR);
// checked at loading
m_defaultMovementType = MovementGeneratorType(cinfo->MovementType);
@@ -392,10 +393,15 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData* data /*=
SetPvP(false);
}
- for (int i = 0; i < CREATURE_MAX_SPELLS; ++i)
- m_spells[i] = GetCreatureInfo()->spells[i];
+ // Try difficulty dependend version before falling back to base entry
+ CreatureTemplateSpells const* templateSpells = sCreatureTemplateSpellsStorage.LookupEntry<CreatureTemplateSpells>(GetCreatureInfo()->Entry);
+ if (!templateSpells)
+ templateSpells = sCreatureTemplateSpellsStorage.LookupEntry<CreatureTemplateSpells>(GetEntry());
+ if (templateSpells)
+ for (int i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ m_spells[i] = templateSpells->spells[i];
- SetVehicleId(GetCreatureInfo()->vehicleId);
+ SetVehicleId(GetCreatureInfo()->vehicleId, 0);
// if eventData set then event active and need apply spell_start
if (eventData)
@@ -943,31 +949,27 @@ void Creature::PrepareBodyLootState()
{
loot.clear();
- // only dead
- if (!isAlive())
+ // if have normal loot then prepare it access
+ if (!lootForBody)
{
- // if have normal loot then prepare it access
- if (!lootForBody)
+ // have normal loot
+ if (GetCreatureInfo()->maxgold > 0 || GetCreatureInfo()->lootid ||
+ // ... or can have skinning after
+ (GetCreatureInfo()->SkinLootId && sWorld.getConfig(CONFIG_BOOL_CORPSE_EMPTY_LOOT_SHOW)))
{
- // have normal loot
- if (GetCreatureInfo()->maxgold > 0 || GetCreatureInfo()->lootid ||
- // ... or can have skinning after
- (GetCreatureInfo()->SkinLootId && sWorld.getConfig(CONFIG_BOOL_CORPSE_EMPTY_LOOT_SHOW)))
- {
- SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- return;
- }
+ SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ return;
}
+ }
- lootForBody = true; // pass this loot mode
+ lootForBody = true; // pass this loot mode
- // if not have normal loot allow skinning if need
- if (!lootForSkin && GetCreatureInfo()->SkinLootId)
- {
- RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
- return;
- }
+ // if not have normal loot allow skinning if need
+ if (!lootForSkin && GetCreatureInfo()->SkinLootId)
+ {
+ RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
+ return;
}
RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
@@ -1529,7 +1531,7 @@ void Creature::SetDeathState(DeathState s)
SetHealth(GetMaxHealth());
SetLootRecipient(NULL);
- SetWalk(true);
+ SetWalk(true, true);
if (GetTemporaryFactionFlags() & TEMPFACTION_RESTORE_RESPAWN)
ClearTemporaryFaction();
@@ -1589,20 +1591,20 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn)
SetHealth(0); // just for nice GM-mode view
}
-bool Creature::IsImmuneToSpell(SpellEntry const* spellInfo)
+bool Creature::IsImmuneToSpell(SpellEntry const* spellInfo, bool castOnSelf)
{
if (!spellInfo)
return false;
- if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))
+ if (!castOnSelf && GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))
return true;
- return Unit::IsImmuneToSpell(spellInfo);
+ return Unit::IsImmuneToSpell(spellInfo, castOnSelf);
}
-bool Creature::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const
+bool Creature::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index, bool castOnSelf) const
{
- if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->EffectMechanic[index] - 1)))
+ if (!castOnSelf && GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->EffectMechanic[index] - 1)))
return true;
// Taunt immunity special flag check
@@ -1619,7 +1621,7 @@ bool Creature::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectInd
return true;
}
- return Unit::IsImmuneToSpellEffect(spellInfo, index);
+ return Unit::IsImmuneToSpellEffect(spellInfo, index, castOnSelf);
}
SpellEntry const* Creature::ReachWithSpellAttack(Unit* pVictim)
@@ -2523,12 +2525,25 @@ bool Creature::HasStaticDBSpawnData() const
return sObjectMgr.GetCreatureData(GetGUIDLow()) != NULL;
}
-void Creature::SetWalk(bool enable)
+void Creature::SetWalk(bool enable, bool asDefault)
{
+ if (asDefault)
+ {
+ if (enable)
+ clearUnitState(UNIT_STAT_RUNNING);
+ else
+ addUnitState(UNIT_STAT_RUNNING);
+ }
+
+ // Nothing changed?
+ if (enable == m_movementInfo.HasMovementFlag(MOVEFLAG_WALK_MODE))
+ return;
+
if (enable)
m_movementInfo.AddMovementFlag(MOVEFLAG_WALK_MODE);
else
m_movementInfo.RemoveMovementFlag(MOVEFLAG_WALK_MODE);
+
WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_WALK_MODE : SMSG_SPLINE_MOVE_SET_RUN_MODE, 9);
data << GetPackGUID();
SendMessageToSet(&data, true);
22 src/game/Creature.h
View
@@ -121,15 +121,14 @@ struct CreatureInfo
int32 resistance4;
int32 resistance5;
int32 resistance6;
- uint32 spells[CREATURE_MAX_SPELLS];
uint32 PetSpellDataId;
uint32 mingold;
uint32 maxgold;
char const* AIName;
uint32 MovementType;
uint32 InhabitType;
- float unk16;
- float unk17;
+ float healthModifier;
+ float powerModifier;
bool RacialLeader;
uint32 questItems[6];
uint32 movementId;
@@ -177,6 +176,12 @@ struct CreatureInfo
}
};
+struct CreatureTemplateSpells
+{
+ uint32 entry;
+ uint32 spells[CREATURE_MAX_SPELLS];
+};
+
struct EquipmentInfo
{
uint32 entry;
@@ -496,7 +501,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
bool CanWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; }
bool CanSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; }
- bool CanFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; }
+ bool CanFly() const { return (GetCreatureInfo()->InhabitType & INHABIT_AIR) || (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE1_FLAG_UNK_2); }
bool IsTrainerOf(Player* player, bool msg) const;
bool CanInteractWithBattleMaster(Player* player, bool msg) const;
@@ -505,10 +510,9 @@ class MANGOS_DLL_SPEC Creature : public Unit
bool IsOutOfThreatArea(Unit* pVictim) const;
void FillGuidsListFromThreatList(GuidVector& guids, uint32 maxamount = 0);
- bool IsImmuneToSpell(SpellEntry const* spellInfo) override;
- // redefine Unit::IsImmuneToSpell
- bool IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const override;
- // redefine Unit::IsImmuneToSpellEffect
+ bool IsImmuneToSpell(SpellEntry const* spellInfo, bool castOnSelf) override;
+ bool IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index, bool castOnSelf) const override;
+
bool IsElite() const
{
if (IsPet())
@@ -536,7 +540,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
CreatureAI* AI() { return i_AI; }
- void SetWalk(bool enable);
+ void SetWalk(bool enable, bool asDefault = true);
void SetLevitate(bool enable);
void SetRoot(bool enable) override;
void SetWaterWalk(bool enable) override;
35 src/game/CreatureEventAI.cpp
View
@@ -124,14 +124,8 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
m_InvinceabilityHpLevel = 0;
- // Handle Spawned Events
- if (!m_bEmptyList)
- {
- for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
- if (SpawnedEventConditionsCheck((*i).Event))
- ProcessEvent(*i);
- }
- Reset();
+ // Handle Spawned Events, also calls Reset()
+ JustRespawned();
}
bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pActionInvoker)
@@ -148,7 +142,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
// Check event conditions based on the event type, also reset events
switch (event.event_type)
{
- case EVENT_T_TIMER:
+ case EVENT_T_TIMER_IN_COMBAT:
if (!m_creature->isInCombat())
return false;
@@ -162,6 +156,10 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
// Repeat Timers
pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax);
break;
+ case EVENT_T_TIMER_GENERIC:
+ // Repeat Timers
+ pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax);
+ break;
case EVENT_T_HP:
{
if (!m_creature->isInCombat() || !m_creature->GetMaxHealth())
@@ -869,17 +867,25 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
}
}
-void CreatureEventAI::JustRespawned()
+void CreatureEventAI::JustRespawned() // NOTE that this is called from the AI's constructor as well
{
Reset();
if (m_bEmptyList)
return;
- // Handle Spawned Events
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
- if (SpawnedEventConditionsCheck((*i).Event))
+ {
+ // Reset generic timer
+ if (i->Event.event_type == EVENT_T_TIMER_GENERIC)
+ {
+ if (i->UpdateRepeatTimer(m_creature, i->Event.timer.initialMin, i->Event.timer.initialMax))
+ i->Enabled = true;
+ }
+ // Handle Spawned Events
+ else if (SpawnedEventConditionsCheck((*i).Event))
ProcessEvent(*i);
+ }
}
void CreatureEventAI::Reset()
@@ -1036,7 +1042,7 @@ void CreatureEventAI::EnterCombat(Unit* enemy)
ProcessEvent(*i, enemy);
break;
// Reset all in combat timers
- case EVENT_T_TIMER:
+ case EVENT_T_TIMER_IN_COMBAT:
if ((*i).UpdateRepeatTimer(m_creature, event.timer.initialMin, event.timer.initialMax))
(*i).Enabled = true;
break;
@@ -1177,9 +1183,10 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
switch ((*i).Event.event_type)
{
case EVENT_T_TIMER_OOC:
+ case EVENT_T_TIMER_GENERIC:
ProcessEvent(*i);
break;
- case EVENT_T_TIMER:
+ case EVENT_T_TIMER_IN_COMBAT:
case EVENT_T_MANA:
case EVENT_T_HP:
case EVENT_T_TARGET_HP:
6 src/game/CreatureEventAI.h
View
@@ -33,7 +33,7 @@ class WorldObject;
enum EventAI_Type
{
- EVENT_T_TIMER = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax
+ EVENT_T_TIMER_IN_COMBAT = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax
EVENT_T_TIMER_OOC = 1, // InitialMin, InitialMax, RepeatMin, RepeatMax
EVENT_T_HP = 2, // HPMax%, HPMin%, RepeatMin, RepeatMax
EVENT_T_MANA = 3, // ManaMax%,ManaMin% RepeatMin, RepeatMax
@@ -62,6 +62,7 @@ enum EventAI_Type
EVENT_T_SUMMONED_JUST_DESPAWN = 26, // CreatureId, RepeatMin, RepeatMax
EVENT_T_MISSING_AURA = 27, // Param1 = SpellID, Param2 = Number of time stacked expected, Param3/4 Repeat Min/Max
EVENT_T_TARGET_MISSING_AURA = 28, // Param1 = SpellID, Param2 = Number of time stacked expected, Param3/4 Repeat Min/Max
+ EVENT_T_TIMER_GENERIC = 29, // InitialMin, InitialMax, RepeatMin, RepeatMax
EVENT_T_END,
};
@@ -419,8 +420,9 @@ struct CreatureEventAI_Event
union
{
- // EVENT_T_TIMER = 0
+ // EVENT_T_TIMER_IN_COMBAT = 0
// EVENT_T_TIMER_OOC = 1
+ // EVENT_T_TIMER_GENERIC = 29
struct
{
uint32 initialMin;
5 src/game/CreatureEventAIMgr.cpp
View
@@ -311,8 +311,9 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
// Individual event checks
switch (temp.event_type)
{
- case EVENT_T_TIMER:
+ case EVENT_T_TIMER_IN_COMBAT:
case EVENT_T_TIMER_OOC:
+ case EVENT_T_TIMER_GENERIC:
if (temp.timer.initialMax < temp.timer.initialMin)
sLog.outErrorDb("CreatureEventAI: Creature %u are using timed event(%u) with param2 < param1 (InitialMax < InitialMin). Event will never repeat.", temp.creature_id, i);
if (temp.timer.repeatMax < temp.timer.repeatMin)
@@ -832,7 +833,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
delete result;
// post check
- for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
{
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
{
23 src/game/DBCEnums.h
View
@@ -468,12 +468,35 @@ enum VehicleFlags
VEHICLE_FLAG_NO_STRAFE = 0x00000001, // Sets MOVEFLAG2_NO_STRAFE
VEHICLE_FLAG_NO_JUMPING = 0x00000002, // Sets MOVEFLAG2_NO_JUMPING
VEHICLE_FLAG_FULLSPEEDTURNING = 0x00000004, // Sets MOVEFLAG2_FULLSPEEDTURNING
+ VEHICLE_FLAG_UNK1 = 0x00000008,
VEHICLE_FLAG_ALLOW_PITCHING = 0x00000010, // Sets MOVEFLAG2_ALLOW_PITCHING
VEHICLE_FLAG_FULLSPEEDPITCHING = 0x00000020, // Sets MOVEFLAG2_FULLSPEEDPITCHING
VEHICLE_FLAG_CUSTOM_PITCH = 0x00000040, // If set use pitchMin and pitchMax from DBC, otherwise pitchMin = -pi/2, pitchMax = pi/2
+ VEHICLE_FLAG_UNK2 = 0x00000080,
+ VEHICLE_FLAG_UNK3 = 0x00000100,
+ VEHICLE_FLAG_UNK4 = 0x00000200, // Vehicle is accessory?
VEHICLE_FLAG_ADJUST_AIM_ANGLE = 0x00000400, // Lua_IsVehicleAimAngleAdjustable
VEHICLE_FLAG_ADJUST_AIM_POWER = 0x00000800, // Lua_IsVehicleAimPowerAdjustable
+ VEHICLE_FLAG_UNK5 = 0x00001000,
+ VEHICLE_FLAG_UNK6 = 0x00002000,
+ VEHICLE_FLAG_UNK7 = 0x00004000,
+ VEHICLE_FLAG_UNK8 = 0x00008000,
+ VEHICLE_FLAG_UNK9 = 0x00010000,
+ VEHICLE_FLAG_UNK10 = 0x00020000,
+ VEHICLE_FLAG_UNK11 = 0x00040000,
+ VEHICLE_FLAG_UNK12 = 0x00080000,
+ VEHICLE_FLAG_UNK13 = 0x00100000,
+ VEHICLE_FLAG_UNK14 = 0x00200000,
VEHICLE_FLAG_DISABLE_SWITCH = 0x00400000, // Can't change seats, VEHICLE_ID = 335 chopper
+ VEHICLE_FLAG_UNK15 = 0x00800000,
+ VEHICLE_FLAG_UNK16 = 0x01000000,
+ VEHICLE_FLAG_UNK17 = 0x02000000,
+ VEHICLE_FLAG_UNK18 = 0x04000000,
+ VEHICLE_FLAG_UNK19 = 0x08000000,
+ VEHICLE_FLAG_UNK20 = 0x10000000, // Vehicle not dismissed after eject passenger?
+ VEHICLE_FLAG_UNK21 = 0x20000000,
+ VEHICLE_FLAG_UNK22 = 0x40000000,
+ VEHICLE_FLAG_UNK23 = 0x80000000,
};
enum VehicleSeatFlags
4 src/game/DBCStores.cpp
View
@@ -639,6 +639,10 @@ void LoadDBCStores(const std::string& dataPath)
// old continent node (+ nodes virtually at old continents, check explicitly to avoid loading map files for zone info)
if (node->map_id < 2 || i == 82 || i == 83 || i == 93 || i == 94)
sOldContinentsNodesMask[field] |= submask;
+
+ // Hack DK node at Ebon Hold (unclear if bad dbc data or we need to revisit our checks in ObjectMgr::GetNearestTaxiNode )
+ if (i == 315)
+ (const_cast<TaxiNodesEntry*>(node))->MountCreatureID[1] = node->MountCreatureID[0];
}
}
2  src/game/DuelHandler.cpp
View
@@ -75,5 +75,5 @@ void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket)
ObjectGuid guid;
recvPacket >> guid;
- GetPlayer()->DuelComplete(DUEL_INTERUPTED);
+ GetPlayer()->DuelComplete(DUEL_INTERRUPTED);
}
6 src/game/FleeingMovementGenerator.cpp
View
@@ -35,7 +35,7 @@ void FleeingMovementGenerator<T>::_setTargetLocation(T& owner)
return;
// ignore in case other no reaction state
- if (owner.hasUnitState(UNIT_STAT_CAN_NOT_REACT & ~UNIT_STAT_FLEEING))
+ if (owner.hasUnitState((UNIT_STAT_CAN_NOT_REACT | UNIT_STAT_NOT_MOVE) & ~UNIT_STAT_FLEEING))
return;
float x, y, z;
@@ -155,7 +155,7 @@ bool FleeingMovementGenerator<T>::Update(T& owner, const uint32& time_diff)
return false;
// ignore in case other no reaction state
- if (owner.hasUnitState(UNIT_STAT_CAN_NOT_REACT & ~UNIT_STAT_FLEEING))
+ if (owner.hasUnitState((UNIT_STAT_CAN_NOT_REACT | UNIT_STAT_NOT_MOVE) & ~UNIT_STAT_FLEEING))
{
owner.clearUnitState(UNIT_STAT_FLEEING_MOVE);
return true;
@@ -200,7 +200,7 @@ bool TimedFleeingMovementGenerator::Update(Unit& owner, const uint32& time_diff)
return false;
// ignore in case other no reaction state
- if (owner.hasUnitState(UNIT_STAT_CAN_NOT_REACT & ~UNIT_STAT_FLEEING))
+ if (owner.hasUnitState((UNIT_STAT_CAN_NOT_REACT | UNIT_STAT_NOT_MOVE) & ~UNIT_STAT_FLEEING))
{
owner.clearUnitState(UNIT_STAT_FLEEING_MOVE);
return true;
2  src/game/GridNotifiersImpl.h
View
@@ -156,7 +156,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
SpellEffectIndex eff_index = i_dynobject.GetEffIndex();
// Check target immune to spell or aura
- if (target->IsImmuneToSpell(spellInfo) || target->IsImmuneToSpellEffect(spellInfo, eff_index))
+ if (target->IsImmuneToSpell(spellInfo, false) || target->IsImmuneToSpellEffect(spellInfo, eff_index, false))
return;
// Apply PersistentAreaAura on target
2  src/game/HomeMovementGenerator.cpp
View
@@ -68,7 +68,7 @@ void HomeMovementGenerator<Creature>::Finalize(Creature& owner)
if (owner.GetTemporaryFactionFlags() & TEMPFACTION_RESTORE_REACH_HOME)
owner.ClearTemporaryFaction();
- owner.SetWalk(true);
+ owner.SetWalk(!owner.hasUnitState(UNIT_STAT_RUNNING_STATE) && !owner.IsLevitating(), false);
owner.LoadCreatureAddon(true);
owner.AI()->JustReachedHome();
}
14 src/game/Level3.cpp
View
@@ -2678,7 +2678,7 @@ bool ChatHandler::HandleAddItemSetCommand(char* args)
DETAIL_LOG(GetMangosString(LANG_ADDITEMSET), itemsetId);
bool found = false;
- for (uint32 id = 0; id < sItemStorage.MaxEntry; ++id)
+ for (uint32 id = 0; id < sItemStorage.GetMaxEntry(); ++id)
{
ItemPrototype const* pProto = sItemStorage.LookupEntry<ItemPrototype>(id);
if (!pProto)
@@ -3127,7 +3127,7 @@ bool ChatHandler::HandleLookupItemCommand(char* args)
uint32 counter = 0;
// Search in `item_template`
- for (uint32 id = 0; id < sItemStorage.MaxEntry; ++id)
+ for (uint32 id = 0; id < sItemStorage.GetMaxEntry(); ++id)
{
ItemPrototype const* pProto = sItemStorage.LookupEntry<ItemPrototype >(id);
if (!pProto)
@@ -3485,7 +3485,7 @@ bool ChatHandler::HandleLookupCreatureCommand(char* args)
uint32 counter = 0;
- for (uint32 id = 0; id < sCreatureStorage.MaxEntry; ++id)
+ for (uint32 id = 0; id < sCreatureStorage.GetMaxEntry(); ++id)
{
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo> (id);
if (!cInfo)
@@ -3532,7 +3532,7 @@ bool ChatHandler::HandleLookupObjectCommand(char* args)
uint32 counter = 0;
- for (uint32 id = 0; id < sGOStorage.MaxEntry; ++id)
+ for (uint32 id = 0; id < sGOStorage.GetMaxEntry(); ++id)
{
GameObjectInfo const* gInfo = sGOStorage.LookupEntry<GameObjectInfo>(id);
if (!gInfo)
@@ -4719,7 +4719,7 @@ bool ChatHandler::HandleChangeWeatherCommand(char* args)
if (!ExtractUInt32(&args, type))
return false;
- //0 to 3, 0: fine, 1: rain, 2: snow, 3: sand
+ // 0 to 3, 0: fine, 1: rain, 2: snow, 3: sand
if (type > 3)
return false;
@@ -4727,7 +4727,7 @@ bool ChatHandler::HandleChangeWeatherCommand(char* args)
if (!ExtractFloat(&args, grade))
return false;
- //0 to 1, sending -1 is instand good weather
+ // 0 to 1, sending -1 is instand good weather
if (grade < 0.0f || grade > 1.0f)
return false;
@@ -5304,7 +5304,7 @@ bool ChatHandler::HandleQuestAddCommand(char* args)
}
// check item starting quest (it can work incorrectly if added without item in inventory)
- for (uint32 id = 0; id < sItemStorage.MaxEntry; ++id)
+ for (uint32 id = 0; id < sItemStorage.GetMaxEntry(); ++id)
{
ItemPrototype const* pProto = sItemStorage.LookupEntry<ItemPrototype>(id);
if (!pProto)
6 src/game/LootHandler.cpp
View
@@ -486,13 +486,11 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
if (group->GetLooterGuid() == player->GetObjectGuid())
group->UpdateLooterGuid(pCreature);
- if (loot->isLooted())
+ if (loot->isLooted() && !pCreature->isAlive())
{
// for example skinning after normal loot
pCreature->PrepareBodyLootState();
-
- if (!pCreature->isAlive())
- pCreature->AllLootRemovedFromCorpse();
+ pCreature->AllLootRemovedFromCorpse();
}
break;
}
18 src/game/LootMgr.cpp
View
@@ -366,7 +366,7 @@ LootItem::LootItem(uint32 itemid_, uint32 count_, uint32 randomSuffix_, int32 ra
bool LootItem::AllowedForPlayer(Player const* player) const
{
// DB conditions check
- if (conditionId && !sObjectMgr.IsPlayerMeetToNEWCondition(player, conditionId))
+ if (conditionId && !sObjectMgr.IsPlayerMeetToCondition(player, conditionId))
return false;
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(itemid);
@@ -1122,7 +1122,7 @@ void LoadLootTemplates_Creature()
LootTemplates_Creature.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
- for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
{
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
{
@@ -1152,7 +1152,7 @@ void LoadLootTemplates_Disenchant()
LootTemplates_Disenchant.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
- for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sItemStorage.GetMaxEntry(); ++i)
{
if (ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i))
{
@@ -1197,7 +1197,7 @@ void LoadLootTemplates_Gameobject()
LootTemplates_Gameobject.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
- for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sGOStorage.GetMaxEntry(); ++i)
{
if (GameObjectInfo const* gInfo = sGOStorage.LookupEntry<GameObjectInfo>(i))
{
@@ -1223,7 +1223,7 @@ void LoadLootTemplates_Item()
LootTemplates_Item.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
- for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sItemStorage.GetMaxEntry(); ++i)
{
if (ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i))
{
@@ -1248,7 +1248,7 @@ void LoadLootTemplates_Milling()
LootTemplates_Milling.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
- for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sItemStorage.GetMaxEntry(); ++i)
{
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i);
if (!proto)
@@ -1273,7 +1273,7 @@ void LoadLootTemplates_Pickpocketing()
LootTemplates_Pickpocketing.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
- for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
{
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
{
@@ -1299,7 +1299,7 @@ void LoadLootTemplates_Prospecting()
LootTemplates_Prospecting.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
- for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sItemStorage.GetMaxEntry(); ++i)
{
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i);
if (!proto)
@@ -1339,7 +1339,7 @@ void LoadLootTemplates_Skinning()
LootTemplates_Skinning.LoadAndCollectLootIds(ids_set);
// remove real entries and check existence loot
- for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
{
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
{
1  src/game/Map.h
View
@@ -189,6 +189,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
// NOTE: this duplicate of Instanceable(), but Instanceable() can be changed when BG also will be instanceable
bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); }
bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); }
+ bool IsNonRaidDungeon() const { return i_mapEntry && i_mapEntry->IsNonRaidDungeon(); }
bool IsRaidOrHeroicDungeon() const { return IsRaid() || GetDifficulty() > DUNGEON_DIFFICULTY_NORMAL; }
bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); }
bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
10 src/game/MiscHandler.cpp
View
@@ -297,10 +297,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recv_data*/)
if ((GetPlayer()->GetPositionZ() < height + 0.1f) && !(GetPlayer()->IsInWater()))
GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);
- WorldPacket data(SMSG_FORCE_MOVE_ROOT, (8 + 4)); // guess size
- data << GetPlayer()->GetPackGUID();
- data << (uint32)2;
- SendPacket(&data);
+ GetPlayer()->SetRoot(true);
GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
@@ -329,10 +326,7 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket& /*recv_data*/)
if (GetPlayer()->CanFreeMove())
{
//!we can move again
- data.Initialize(SMSG_FORCE_MOVE_UNROOT, 8); // guess size
- data << GetPlayer()->GetPackGUID();
- data << uint32(0);
- SendPacket(&data);
+ GetPlayer()->SetRoot(false);
//! Stand Up
GetPlayer()->SetStandState(UNIT_STAND_STATE_STAND);
6 src/game/MotionMaster.cpp
View
@@ -473,12 +473,6 @@ bool MotionMaster::GetDestination(float& x, float& y, float& z)
return true;
}
-void MotionMaster::UpdateFinalDistanceToTarget(float fDistance)
-{
- if (!empty())
- top()->UpdateFinalDistance(fDistance);
-}
-
void MotionMaster::MoveJump(float x, float y, float z, float horizontalSpeed, float max_height, uint32 id)
{
Movement::MoveSplineInit init(*m_owner);
3  src/game/MotionMaster.h
View
@@ -115,9 +115,6 @@ class MANGOS_DLL_SPEC MotionMaster : private std::stack<MovementGenerator*>
void propagateSpeedChange();
- // will only work in MMgens where we have a target (TARGETED_MOTION_TYPE)
- void UpdateFinalDistanceToTarget(float fDistance);
-
bool GetDestination(float& x, float& y, float& z);
private:
void Mutate(MovementGenerator* m); // use Move* functions instead
2  src/game/MoveMap.h
View
@@ -33,7 +33,7 @@ inline void* dtCustomAlloc(int size, dtAllocHint /*hint*/)
inline void dtCustomFree(void* ptr)
{
- delete[] (unsigned char*)ptr;
+ delete[](unsigned char*)ptr;
}
// move map related classes
2  src/game/MovementGenerator.h
View
@@ -49,8 +49,6 @@ class MANGOS_DLL_SPEC MovementGenerator
virtual void unitSpeedChanged() { }
- virtual void UpdateFinalDistance(float /*fDistance*/) { }
-
// used by Evade code for select point to evade with expected restart default movement
virtual bool GetResetPosition(Unit&, float& /*x*/, float& /*y*/, float& /*z*/) { return false; }
7 src/game/MovementHandler.cpp
View
@@ -252,8 +252,11 @@ void WorldSession::HandleMoveTeleportAckOpcode(WorldPacket& recv_data)
void WorldSession::HandleMovementOpcodes(WorldPacket& recv_data)
{
uint32 opcode = recv_data.GetOpcode();
- DEBUG_LOG("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode);
- recv_data.hexlike();
+ if (!sLog.HasLogFilter(LOG_FILTER_PLAYER_MOVES))
+ {
+ DEBUG_LOG("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode);
+ recv_data.hexlike();
+ }
Unit* mover = _player->GetMover();
Player* plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL;
2  src/game/NPCHandler.cpp
View
@@ -294,7 +294,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recv_data)
SendPlaySpellVisual(guid, 0xB3); // visual effect on trainer
- WorldPacket data(SMSG_PLAY_SPELL_IMPACT, 8+4); // visual effect on player
+ WorldPacket data(SMSG_PLAY_SPELL_IMPACT, 8 + 4); // visual effect on player
data << _player->GetObjectGuid();
data << uint32(0x016A); // index from SpellVisualKit.dbc
SendPacket(&data);
2  src/game/Object.h
View
@@ -355,8 +355,6 @@ class MANGOS_DLL_SPEC Object
uint16 GetValuesCount() const { return m_valuesCount; }
- void InitValues() { _InitValues(); }
-
virtual bool HasQuest(uint32 /* quest_id */) const { return false; }
virtual bool HasInvolvedQuest(uint32 /* quest_id */) const { return false; }
258 src/game/ObjectMgr.cpp
View
@@ -148,8 +148,6 @@ ObjectMgr::ObjectMgr() :
m_FirstTemporaryCreatureGuid(1),
m_FirstTemporaryGameObjectGuid(1)
{
- // Only zero condition left, others will be added while loading DB tables
- mConditions.resize(1);
}
ObjectMgr::~ObjectMgr()
@@ -440,7 +438,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
sLog.outString(">> Loaded " SIZEFMTD " points_of_interest locale strings", mPointOfInterestLocaleMap.size());
}
-struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
+struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader, SQLStorage>
{
template<class D>
void convert_from_str(uint32 /*field_pos*/, char const* src, D& dst)
@@ -454,14 +452,14 @@ void ObjectMgr::LoadCreatureTemplates()
SQLCreatureLoader loader;
loader.Load(sCreatureStorage);
- sLog.outString(">> Loaded %u creature definitions", sCreatureStorage.RecordCount);
+ sLog.outString(">> Loaded %u creature definitions", sCreatureStorage.GetRecordCount());
sLog.outString();
std::set<uint32> difficultyEntries[MAX_DIFFICULTY - 1]; // already loaded difficulty 1 value in creatures
std::set<uint32> hasDifficultyEntries[MAX_DIFFICULTY - 1]; // already loaded creatures with difficulty 1 values
// check data correctness
- for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
{
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i);
if (!cInfo)
@@ -665,15 +663,6 @@ void ObjectMgr::LoadCreatureTemplates()
sLog.outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u)", cInfo->Entry, cInfo->PetSpellDataId);
}
- for (int j = 0; j < CREATURE_MAX_SPELLS; ++j)
- {
- if (cInfo->spells[j] && !sSpellStore.LookupEntry(cInfo->spells[j]))
- {
- sLog.outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0", cInfo->Entry, j + 1, cInfo->spells[j]);
- const_cast<CreatureInfo*>(cInfo)->spells[j] = 0;
- }
- }
-
if (cInfo->MovementType >= MAX_DB_MOTION_TYPE)
{
sLog.outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignore and set to IDLE.", cInfo->Entry, cInfo->MovementType);
@@ -776,11 +765,11 @@ void ObjectMgr::LoadCreatureAddons(SQLStorage& creatureaddons, char const* entry
{
creatureaddons.Load();
- sLog.outString(">> Loaded %u %s", creatureaddons.RecordCount, comment);
+ sLog.outString(">> Loaded %u %s", creatureaddons.GetRecordCount(), comment);
sLog.outString();
// check data correctness and convert 'auras'
- for (uint32 i = 1; i < creatureaddons.MaxEntry; ++i)
+ for (uint32 i = 1; i < creatureaddons.GetMaxEntry(); ++i)
{
CreatureDataAddon const* addon = creatureaddons.LookupEntry<CreatureDataAddon>(i);
if (!addon)
@@ -813,7 +802,7 @@ void ObjectMgr::LoadCreatureAddons()
LoadCreatureAddons(sCreatureInfoAddonStorage, "Entry", "creature template addons");
// check entry ids
- for (uint32 i = 1; i < sCreatureInfoAddonStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureInfoAddonStorage.GetMaxEntry(); ++i)
if (CreatureDataAddon const* addon = sCreatureInfoAddonStorage.LookupEntry<CreatureDataAddon>(i))
if (!sCreatureStorage.LookupEntry<CreatureInfo>(addon->guidOrEntry))
sLog.outErrorDb("Creature (Entry: %u) does not exist but has a record in `%s`", addon->guidOrEntry, sCreatureInfoAddonStorage.GetTableName());
@@ -821,7 +810,7 @@ void ObjectMgr::LoadCreatureAddons()
LoadCreatureAddons(sCreatureDataAddonStorage, "GUID", "creature addons");
// check entry ids
- for (uint32 i = 1; i < sCreatureDataAddonStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureDataAddonStorage.GetMaxEntry(); ++i)
if (CreatureDataAddon const* addon = sCreatureDataAddonStorage.LookupEntry<CreatureDataAddon>(i))
if (mCreatureDataMap.find(addon->guidOrEntry) == mCreatureDataMap.end())
sLog.outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`", addon->guidOrEntry);
@@ -831,7 +820,7 @@ void ObjectMgr::LoadEquipmentTemplates()
{
sEquipmentStorage.Load();
- for (uint32 i = 0; i < sEquipmentStorage.MaxEntry; ++i)
+ for (uint32 i = 0; i < sEquipmentStorage.GetMaxEntry(); ++i)
{
EquipmentInfo const* eqInfo = sEquipmentStorage.LookupEntry<EquipmentInfo>(i);
@@ -868,7 +857,7 @@ void ObjectMgr::LoadEquipmentTemplates()
}
}
- sLog.outString(">> Loaded %u equipment template", sEquipmentStorage.RecordCount);
+ sLog.outString(">> Loaded %u equipment template", sEquipmentStorage.GetRecordCount());
sLog.outString();
}
@@ -933,7 +922,7 @@ void ObjectMgr::LoadCreatureModelInfo()
sCreatureModelStorage.Load();
// post processing
- for (uint32 i = 1; i < sCreatureModelStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureModelStorage.GetMaxEntry(); ++i)
{
CreatureModelInfo const* minfo = sCreatureModelStorage.LookupEntry<CreatureModelInfo>(i);
if (!minfo)
@@ -1035,7 +1024,7 @@ void ObjectMgr::LoadCreatureModelInfo()
}
- sLog.outString(">> Loaded %u creature model based info", sCreatureModelStorage.RecordCount);
+ sLog.outString(">> Loaded %u creature model based info", sCreatureModelStorage.GetRecordCount());
sLog.outString();
}
@@ -1187,7 +1176,7 @@ void ObjectMgr::LoadCreatures()
// build single time for check creature data
std::set<uint32> difficultyCreatures[MAX_DIFFICULTY - 1];
- for (uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i)
+ for (uint32 i = 0; i < sCreatureStorage.GetMaxEntry(); ++i)
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1; ++diff)
if (cInfo->DifficultyEntry[diff])
@@ -1546,10 +1535,10 @@ void ObjectMgr::LoadGameObjectAddon()
{
sGameObjectDataAddonStorage.Load();
- sLog.outString(">> Loaded %u gameobject addons", sGameObjectDataAddonStorage.RecordCount);
+ sLog.outString(">> Loaded %u gameobject addons", sGameObjectDataAddonStorage.GetRecordCount());
sLog.outString();
- for (uint32 i = 1; i < sGameObjectDataAddonStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sGameObjectDataAddonStorage.GetMaxEntry(); ++i)
{
GameObjectDataAddon const* addon = sGameObjectDataAddonStorage.LookupEntry<GameObjectDataAddon>(i);
if (!addon)
@@ -1769,7 +1758,7 @@ void ObjectMgr::LoadItemLocales()
sLog.outString(">> Loaded " SIZEFMTD " Item locale strings", mItemLocaleMap.size());
}
-struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader>
+struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader, SQLStorage>
{
template<class D>
void convert_from_str(uint32 /*field_pos*/, char const* src, D& dst)
@@ -1782,11 +1771,11 @@ void ObjectMgr::LoadItemPrototypes()
{
SQLItemLoader loader;
loader.Load(sItemStorage);
- sLog.outString(">> Loaded %u item prototypes", sItemStorage.RecordCount);
+ sLog.outString(">> Loaded %u item prototypes", sItemStorage.GetRecordCount());
sLog.outString();
// check data correctness
- for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sItemStorage.GetMaxEntry(); ++i)
{
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype >(i);
ItemEntry const* dbcitem = sItemStore.LookupEntry(i);
@@ -4470,13 +4459,11 @@ void ObjectMgr::LoadQuestLocales()
void ObjectMgr::LoadPageTexts()
{
- sPageTextStore.Free(); // for reload case
-
sPageTextStore.Load();
- sLog.outString(">> Loaded %u page texts", sPageTextStore.RecordCount);
+ sLog.outString(">> Loaded %u page texts", sPageTextStore.GetRecordCount());
sLog.outString();
- for (uint32 i = 1; i < sPageTextStore.MaxEntry; ++i)
+ for (uint32 i = 1; i < sPageTextStore.GetMaxEntry(); ++i)
{
// check data correctness
PageText const* page = sPageTextStore.LookupEntry<PageText>(i);
@@ -4645,7 +4632,7 @@ void ObjectMgr::LoadInstanceEncounters()
sLog.outString(">> Loaded " SIZEFMTD " Instance Encounters", m_DungeonEncounters.size());
}
-struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader>
+struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader, SQLStorage>
{
template<class D>
void convert_from_str(uint32 /*field_pos*/, char const* src, D& dst)
@@ -4659,7 +4646,7 @@ void ObjectMgr::LoadInstanceTemplate()
SQLInstanceLoader loader;
loader.Load(sInstanceTemplate);
- for (uint32 i = 0; i < sInstanceTemplate.MaxEntry; ++i)
+ for (uint32 i = 0; i < sInstanceTemplate.GetMaxEntry(); ++i)
{
InstanceTemplate const* temp = GetInstanceTemplate(i);
if (!temp)
@@ -4702,11 +4689,11 @@ void ObjectMgr::LoadInstanceTemplate()
}
}
- sLog.outString(">> Loaded %u Instance Template definitions", sInstanceTemplate.RecordCount);
+ sLog.outString(">> Loaded %u Instance Template definitions", sInstanceTemplate.GetRecordCount());
sLog.outString();
}
-struct SQLWorldLoader : public SQLStorageLoaderBase<SQLWorldLoader>
+struct SQLWorldLoader : public SQLStorageLoaderBase<SQLWorldLoader, SQLStorage>
{
template<class D>
void convert_from_str(uint32 /*field_pos*/, char const* src, D& dst)
@@ -4720,7 +4707,7 @@ void ObjectMgr::LoadWorldTemplate()
SQLWorldLoader loader;
loader.Load(sWorldTemplate, false);
- for (uint32 i = 0; i < sWorldTemplate.MaxEntry; ++i)
+ for (uint32 i = 0; i < sWorldTemplate.GetMaxEntry(); ++i)
{
WorldTemplate const* temp = GetWorldTemplate(i);
if (!temp)
@@ -4742,16 +4729,16 @@ void ObjectMgr::LoadWorldTemplate()
}
}
- sLog.outString(">> Loaded %u World Template definitions", sWorldTemplate.RecordCount);
+ sLog.outString(">> Loaded %u World Template definitions", sWorldTemplate.GetRecordCount());
sLog.outString();
}
void ObjectMgr::LoadConditions()
{
SQLWorldLoader loader;
- loader.Load(sConditionStorage, false);
+ loader.Load(sConditionStorage);
- for (uint32 i = 0; i < sConditionStorage.MaxEntry; ++i)
+ for (uint32 i = 0; i < sConditionStorage.GetMaxEntry(); ++i)
{
const PlayerCondition* condition = sConditionStorage.LookupEntry<PlayerCondition>(i);
if (!condition)
@@ -4765,7 +4752,7 @@ void ObjectMgr::LoadConditions()
}
}
- sLog.outString(">> Loaded %u Condition definitions", sConditionStorage.RecordCount);
+ sLog.outString(">> Loaded %u Condition definitions", sConditionStorage.GetRecordCount());
sLog.outString();
}
@@ -5927,7 +5914,7 @@ void ObjectMgr::LoadGameObjectLocales()
sLog.outString(">> Loaded " SIZEFMTD " gameobject locale strings", mGameObjectLocaleMap.size());
}
-struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
+struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader, SQLStorage>
{
template<class D>
void convert_from_str(uint32 /*field_pos*/, char const* src, D& dst)
@@ -6018,12 +6005,9 @@ void ObjectMgr::LoadGameobjectInfo()
loader.Load(sGOStorage);
// some checks
- for (uint32 id = 1; id < sGOStorage.MaxEntry; ++id)
+ for (SQLStorageBase::SQLSIterator<GameObjectInfo> itr = sGOStorage.getDataBegin<GameObjectInfo>(); itr < sGOStorage.getDataEnd<GameObjectInfo>(); ++itr)
{
- GameObjectInfo const* goInfo = sGOStorage.LookupEntry<GameObjectInfo>(id);
- if (!goInfo)
- continue;
-
+ GameObjectInfo const* goInfo = itr.getValue();
if (goInfo->size <= 0.0f) // prevent use too small scales
{
@@ -6036,14 +6020,14 @@ void ObjectMgr::LoadGameobjectInfo()
switch (goInfo->type)
{
- case GAMEOBJECT_TYPE_DOOR: //0
+ case GAMEOBJECT_TYPE_DOOR: // 0
{
if (goInfo->door.lockId)
CheckGOLockId(goInfo, goInfo->door.lockId, 1);
CheckGONoDamageImmuneId(goInfo, goInfo->door.noDamageImmune, 3);
break;
}
- case GAMEOBJECT_TYPE_BUTTON: //1
+ case GAMEOBJECT_TYPE_BUTTON: // 1
{
if (goInfo->button.lockId)
CheckGOLockId(goInfo, goInfo->button.lockId, 1);
@@ -6052,14 +6036,14 @@ void ObjectMgr::LoadGameobjectInfo()
CheckGONoDamageImmuneId(goInfo, goInfo->button.noDamageImmune, 4);
break;
}
- case GAMEOBJECT_TYPE_QUESTGIVER: //2
+ case GAMEOBJECT_TYPE_QUESTGIVER: // 2
{
if (goInfo->questgiver.lockId)
CheckGOLockId(goInfo, goInfo->questgiver.lockId, 0);
CheckGONoDamageImmuneId(goInfo, goInfo->questgiver.noDamageImmune, 5);
break;
}
- case GAMEOBJECT_TYPE_CHEST: //3
+ case GAMEOBJECT_TYPE_CHEST: // 3
{
if (goInfo->chest.lockId)
CheckGOLockId(goInfo, goInfo->chest.lockId, 0);
@@ -6070,7 +6054,7 @@ void ObjectMgr::LoadGameobjectInfo()
CheckGOLinkedTrapId(goInfo, goInfo->chest.linkedTrapId, 7);
break;
}
- case GAMEOBJECT_TYPE_TRAP: //6
+ case GAMEOBJECT_TYPE_TRAP: // 6
{
if (goInfo->trap.lockId)
CheckGOLockId(goInfo, goInfo->trap.lockId, 0);
@@ -6080,23 +6064,23 @@ void ObjectMgr::LoadGameobjectInfo()
*/
break;
}
- case GAMEOBJECT_TYPE_CHAIR: //7
+ case GAMEOBJECT_TYPE_CHAIR: // 7
CheckAndFixGOChairHeightId(goInfo, goInfo->chair.height, 1);
break;
- case GAMEOBJECT_TYPE_SPELL_FOCUS: //8
+ case GAMEOBJECT_TYPE_SPELL_FOCUS: // 8
{
if (goInfo->spellFocus.focusId)
{
if (!sSpellFocusObjectStore.LookupEntry(goInfo->spellFocus.focusId))
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.",
- id, goInfo->type, goInfo->spellFocus.focusId, goInfo->spellFocus.focusId);
+ goInfo->id, goInfo->type, goInfo->spellFocus.focusId, goInfo->spellFocus.focusId);
}
if (goInfo->spellFocus.linkedTrapId) // linked trap
CheckGOLinkedTrapId(goInfo, goInfo->spellFocus.linkedTrapId, 2);
break;
}
- case GAMEOBJECT_TYPE_GOOBER: //10
+ case GAMEOBJECT_TYPE_GOOBER: // 10
{
if (goInfo->goober.lockId)
CheckGOLockId(goInfo, goInfo->goober.lockId, 0);
@@ -6107,7 +6091,7 @@ void ObjectMgr::LoadGameobjectInfo()
{
if (!sPageTextStore.LookupEntry<PageText>(goInfo->goober.pageId))
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.",
- id, goInfo->type, goInfo->goober.pageId, goInfo->goober.pageId);
+ goInfo->id, goInfo->type, goInfo->goober.pageId, goInfo->goober.pageId);
}
/* disable check for while, too many nonexistent spells
if (goInfo->goober.spellId) // spell
@@ -6118,29 +6102,29 @@ void ObjectMgr::LoadGameobjectInfo()
CheckGOLinkedTrapId(goInfo, goInfo->goober.linkedTrapId, 12);
break;
}
- case GAMEOBJECT_TYPE_AREADAMAGE: //12
+ case GAMEOBJECT_TYPE_AREADAMAGE: // 12
{
if (goInfo->areadamage.lockId)
CheckGOLockId(goInfo, goInfo->areadamage.lockId, 0);
break;
}
- case GAMEOBJECT_TYPE_CAMERA: //13
+ case GAMEOBJECT_TYPE_CAMERA: // 13
{
if (goInfo->camera.lockId)
CheckGOLockId(goInfo, goInfo->camera.lockId, 0);
break;
}
- case GAMEOBJECT_TYPE_MO_TRANSPORT: //15
+ case GAMEOBJECT_TYPE_MO_TRANSPORT: // 15
{
if (goInfo->moTransport.taxiPathId)
{
if (goInfo->moTransport.taxiPathId >= sTaxiPathNodesByPath.size() || sTaxiPathNodesByPath[goInfo->moTransport.taxiPathId].empty())
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.",
- id, goInfo->type, goInfo->moTransport.taxiPathId, goInfo->moTransport.taxiPathId);
+ goInfo->id, goInfo->type, goInfo->moTransport.taxiPathId, goInfo->moTransport.taxiPathId);
}
break;
}
- case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18
+ case GAMEOBJECT_TYPE_SUMMONING_RITUAL: // 18
{
/* disable check for while, too many nonexistent spells
// always must have spell
@@ -6148,44 +6132,44 @@ void ObjectMgr::LoadGameobjectInfo()
*/
break;
}
- case GAMEOBJECT_TYPE_SPELLCASTER: //22
+ case GAMEOBJECT_TYPE_SPELLCASTER: // 22
{
// always must have spell
CheckGOSpellId(goInfo, goInfo->spellcaster.spellId, 0);
break;
}
- case GAMEOBJECT_TYPE_FLAGSTAND: //24
+ case GAMEOBJECT_TYPE_FLAGSTAND: // 24
{
if (goInfo->flagstand.lockId)
CheckGOLockId(goInfo, goInfo->flagstand.lockId, 0);
CheckGONoDamageImmuneId(goInfo, goInfo->flagstand.noDamageImmune, 5);
break;
}
- case GAMEOBJECT_TYPE_FISHINGHOLE: //25
+ case GAMEOBJECT_TYPE_FISHINGHOLE: // 25
{
if (goInfo->fishinghole.lockId)
CheckGOLockId(goInfo, goInfo->fishinghole.lockId, 4);
break;
}
- case GAMEOBJECT_TYPE_FLAGDROP: //26
+ case GAMEOBJECT_TYPE_FLAGDROP: // 26
{
if (goInfo->flagdrop.lockId)
CheckGOLockId(goInfo, goInfo->flagdrop.lockId, 0);
CheckGONoDamageImmuneId(goInfo, goInfo->flagdrop.noDamageImmune, 3);
break;
}
- case GAMEOBJECT_TYPE_CAPTURE_POINT: //29
+ case GAMEOBJECT_TYPE_CAPTURE_POINT: // 29
{
CheckAndFixGOCaptureMinTime(goInfo, goInfo->capturePoint.minTime, 16);
break;
}
- case GAMEOBJECT_TYPE_BARBER_CHAIR: //32
+ case GAMEOBJECT_TYPE_BARBER_CHAIR: // 32
CheckAndFixGOChairHeightId(goInfo, goInfo->barberChair.chairheight, 0);
break;
}
}
- sLog.outString(">> Loaded %u game object templates", sGOStorage.RecordCount);
+ sLog.outString(">> Loaded %u game object templates", sGOStorage.GetRecordCount());
sLog.outString();
}
@@ -6858,7 +6842,7 @@ void ObjectMgr::LoadNPCSpellClickSpells()
static char* SERVER_SIDE_SPELL = "MaNGOS server-side spell";
-struct SQLSpellLoader : public SQLStorageLoaderBase<SQLSpellLoader>
+struct SQLSpellLoader : public SQLStorageLoaderBase<SQLSpellLoader, SQLHashStorage>
{
template<class S, class D>
void default_fill(uint32 field_pos, S src, D& dst)
@@ -6888,10 +6872,10 @@ void ObjectMgr::LoadSpellTemplate()
SQLSpellLoader loader;
loader.Load(sSpellTemplate);
- sLog.outString(">> Loaded %u spell definitions", sSpellTemplate.RecordCount);
+ sLog.outString(">> Loaded %u spell definitions", sSpellTemplate.GetRecordCount());
sLog.outString();
- for (uint32 i = 1; i < sSpellTemplate.MaxEntry; ++i)
+ for (uint32 i = 1; i < sSpellTemplate.GetMaxEntry(); ++i)
{
// check data correctness
SpellEntry const* spellEntry = sSpellTemplate.LookupEntry<SpellEntry>(i);
@@ -7336,7 +7320,7 @@ void ObjectMgr::LoadGameObjectForQuests()
{
mGameObjectForQuestSet.clear(); // need for reload case
- if (!sGOStorage.MaxEntry)
+ if (!sGOStorage.GetMaxEntry())
{
BarGoLink bar(1);
bar.step();
@@ -7345,11 +7329,11 @@ void ObjectMgr::LoadGameObjectForQuests()
return;
}
- BarGoLink bar(sGOStorage.MaxEntry - 1);
+ BarGoLink bar(sGOStorage.GetMaxEntry() - 1);
uint32 count = 0;
// collect GO entries for GO that must activated
- for (uint32 go_entry = 1; go_entry < sGOStorage.MaxEntry; ++go_entry)
+ for (uint32 go_entry = 1; go_entry < sGOStorage.GetMaxEntry(); ++go_entry)
{
bar.step();
GameObjectInfo const* goInfo = GetGameObjectInfo(go_entry);
@@ -7605,30 +7589,8 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
sLog.outString(">> Loaded %u areas for fishing base skill level", count);
}
-// Searches for the same condition already in Conditions store
-// Returns Id if found, else adds it to Conditions and returns Id
-uint16 ObjectMgr::GetConditionId(ConditionType condition, uint32 value1, uint32 value2)
-{
- PlayerCondition lc = PlayerCondition(0, condition, value1, value2);
- for (uint16 i = 0; i < mConditions.size(); ++i)
- {
- if (lc == mConditions[i])
- return i;
- }
-
- mConditions.push_back(lc);
-
- if (mConditions.size() > 0xFFFF)
- {
- sLog.outError("Conditions store overflow! Current and later loaded conditions will ignored!");
- return 0;
- }
-
- return mConditions.size() - 1;
-}
-
// Check if a player meets condition conditionId
-bool ObjectMgr::IsPlayerMeetToNEWCondition(Player const* pPlayer, uint16 conditionId) const
+bool ObjectMgr::IsPlayerMeetToCondition(Player const* pPlayer, uint16 conditionId) const
{
if (!pPlayer)
return false; // player not present, return false
@@ -8638,7 +8600,7 @@ void ObjectMgr::LoadTrainerTemplates()
for (CacheTrainerSpellMap::const_iterator tItr = m_mCacheTrainerTemplateSpellMap.begin(); tItr != m_mCacheTrainerTemplateSpellMap.end(); ++tItr)
trainer_ids.insert(tItr->first);
- for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
{
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
{
@@ -8720,7 +8682,7 @@ void ObjectMgr::LoadVendorTemplates()
for (CacheVendorItemMap::const_iterator vItr = m_mCacheVendorTemplateItemMap.begin(); vItr != m_mCacheVendorTemplateItemMap.end(); ++vItr)
vendor_ids.insert(vItr->first);
- for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
{
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
{
@@ -8795,8 +8757,8 @@ void ObjectMgr::LoadGossipMenu(std::set<uint32>& gossipScriptSet)
m_mGossipMenusMap.clear();
// 0 1 2
QueryResult* result = WorldDatabase.Query("SELECT entry, text_id, script_id, "
- // 3 4 5 6 7 8 9
- "cond_1, cond_1_val_1, cond_1_val_2, cond_2, cond_2_val_1, cond_2_val_2, condition_id FROM gossip_menu");
+ // 3
+ "condition_id FROM gossip_menu");
if (!result)
{
@@ -8825,14 +8787,7 @@ void ObjectMgr::LoadGossipMenu(std::set<uint32>& gossipScriptSet)
gMenu.text_id = fields[1].GetUInt32();
gMenu.script_id = fields[2].GetUInt32();
- ConditionType cond_1 = (ConditionType)fields[3].GetUInt32();
- uint32 cond_1_val_1 = fields[4].GetUInt32();
- uint32 cond_1_val_2 = fields[5].GetUInt32();
- ConditionType cond_2 = (ConditionType)fields[6].GetUInt32();
- uint32 cond_2_val_1 = fields[7].GetUInt32();
- uint32 cond_2_val_2 = fields[8].GetUInt32();
-
- gMenu.conditionId = fields[9].GetUInt16();
+ gMenu.conditionId = fields[3].GetUInt16();
if (!GetGossipText(gMenu.text_id))
{
@@ -8853,21 +8808,6 @@ void ObjectMgr::LoadGossipMenu(std::set<uint32>& gossipScriptSet)
gossipScriptSet.erase(gMenu.script_id);
}
- if (!PlayerCondition::IsValid(0, cond_1, cond_1_val_1, cond_1_val_2))
- {
- sLog.outErrorDb("Table gossip_menu entry %u, invalid condition 1 for id %u", gMenu.entry, gMenu.text_id);
- continue;
- }
-
- if (!PlayerCondition::IsValid(0, cond_2, cond_2_val_1, cond_2_val_2))
- {
- sLog.outErrorDb("Table gossip_menu entry %u, invalid condition 2 for id %u", gMenu.entry, gMenu.text_id);
- continue;
- }
-
- gMenu.cond_1 = GetConditionId(cond_1, cond_1_val_1, cond_1_val_2);
- gMenu.cond_2 = GetConditionId(cond_2, cond_2_val_1, cond_2_val_2);
-
if (gMenu.conditionId)
{
const PlayerCondition* condition = sConditionStorage.LookupEntry<PlayerCondition>(gMenu.conditionId);
@@ -8890,13 +8830,13 @@ void ObjectMgr::LoadGossipMenu(std::set<uint32>& gossipScriptSet)
sLog.outString(">> Loaded %u gossip_menu entries", count);
// post loading tests
- for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i)
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
if (cInfo->GossipMenuId)
if (m_mGossipMenusMap.find(cInfo->GossipMenuId) == m_mGossipMenusMap.end())
sLog.outErrorDb("Creature (Entry: %u) has gossip_menu_id = %u for nonexistent menu", cInfo->Entry, cInfo->GossipMenuId);
- for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i)
+ for (uint32 i = 1; i < sGOStorage.GetMaxEntry(); ++i)
if (GameObjectInfo const* gInfo = sGOStorage.LookupEntry<GameObjectInfo>(i))
if (uint32 menuid = gInfo->GetGossipMenuId())
if (m_mGossipMenusMap.find(menuid) == m_mGossipMenusMap.end())
@@ -8910,9 +8850,7 @@ void ObjectMgr::LoadGossipMenuItems(std::set<uint32>& gossipScriptSet)
QueryResult* result = WorldDatabase.Query(
"SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, "
"action_menu_id, action_poi_id, action_script_id, box_coded, box_money, box_text, "
- "cond_1, cond_1_val_1, cond_1_val_2, "
- "cond_2, cond_2_val_1, cond_2_val_2, "
- "cond_3, cond_3_val_1, cond_3_val_2, condition_id "
+ "condition_id "
"FROM gossip_menu_option");
if (!result)