Core/Misc: Partial merge of 3.3.5-dbedit:

- Added SmartEnum.h for enum iteration, stringification, and more, courtesy of krabicezpapundeklu/smart_enum
- Moved a bunch of enums in SharedDefines.h to the new system
- Miscellaneous utility methods ported

Core/Util: Redesign SmartEnum to properly work for large
 enums (>64 entries) and play nice with IDEs (PR #22768)

(cherry picked from commit 338e8ba0fe)
(cherry picked from commit f7ca0877a3)
(cherry picked from commit 207093475a)
(cherry picked from commit ee68cf3392)
(cherry picked from commit c16d461e16)
(cherry picked from commit f6b0d99e2c)
(cherry picked from commit bc1f456125)
This commit is contained in:
Treeston
2018-10-26 14:43:22 +02:00
committed by Shauren
parent df2f6ad219
commit c977087d58
13 changed files with 2629 additions and 294 deletions

1
.gitignore vendored
View File

@@ -22,3 +22,4 @@ nbproject/*
.vscode
cmake-build-*/
.vs
*.user

View File

@@ -0,0 +1,154 @@
from re import compile, MULTILINE
from os import walk, getcwd
notice = ('''/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU 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/>.
*/
''')
if not getcwd().endswith('src'):
print('Run this from the src directory!')
print('(Invoke as \'python ../contrib/enumutils_describe.py\')')
exit(1)
EnumPattern = compile(r'//\s*EnumUtils: DESCRIBE THIS\s+enum\s+([0-9A-Za-z]+)[^\n]*\s*{([^}]+)};')
EnumValuesPattern = compile(r'\s+.+?(,|$)[^\n]*')
EnumValueNamePattern = compile(r'^\s*([a-zA-Z0-9_]+)', flags=MULTILINE)
EnumValueSkipLinePattern = compile(r'^\s*//')
EnumValueCommentPattern = compile(r'//,?[ \t]*([^\n]+)$')
CommentMatchFormat = compile(r'^(((TITLE +(.+?))|(DESCRIPTION +(.+?))) *){1,2}$')
CommentSkipFormat = compile(r'^SKIP *$')
def strescape(str):
res = ''
for char in str:
if char in ('\\', '"') or not (32 <= ord(char) < 127):
res += ('\\%03o' % ord(char))
else:
res += char
return '"' + res + '"'
def processFile(path, filename):
input = open('%s/%s.h' % (path, filename),'r')
if input is None:
print('Failed to open %s.h' % filename)
return
file = input.read()
enums = []
for enum in EnumPattern.finditer(file):
name = enum.group(1)
values = []
for value in EnumValuesPattern.finditer(enum.group(2)):
valueData = value.group(0)
valueNameMatch = EnumValueNamePattern.search(valueData)
if valueNameMatch is None:
if EnumValueSkipLinePattern.search(valueData) is None:
print('Name of value not found: %s' % repr(valueData))
continue
valueName = valueNameMatch.group(1)
valueCommentMatch = EnumValueCommentPattern.search(valueData)
valueComment = None
if valueCommentMatch:
valueComment = valueCommentMatch.group(1)
valueTitle = None
valueDescription = None
if valueComment is not None:
if CommentSkipFormat.match(valueComment) is not None:
continue
commentMatch = CommentMatchFormat.match(valueComment)
if commentMatch is not None:
valueTitle = commentMatch.group(4)
valueDescription = commentMatch.group(6)
else:
valueDescription = valueComment
if valueTitle is None:
valueTitle = valueName
if valueDescription is None:
valueDescription = ''
values.append((valueName, valueTitle, valueDescription))
enums.append((name, values))
print('%s.h: Enum %s parsed with %d values' % (filename, name, len(values)))
if not enums:
return
print('Done parsing %s.h (in %s)\n' % (filename, path))
output = open('%s/enuminfo_%s.cpp' % (path, filename), 'w')
if output is None:
print('Failed to create enuminfo_%s.cpp' % filename)
return
# write output file
output.write(notice)
output.write('#include "%s.h"\n' % filename)
output.write('#include "Define.h"\n')
output.write('#include "SmartEnum.h"\n')
output.write('#include <stdexcept>\n')
output.write('\n')
output.write('namespace Trinity\n')
output.write('{\n')
output.write('namespace Impl\n')
output.write('{\n')
for name, values in enums:
tag = ('data for enum \'%s\' in \'%s.h\' auto-generated' % (name, filename))
output.write('\n')
output.write('/*' + ('*'*(len(tag)+2)) + '*\\\n')
output.write('|* ' + tag + ' *|\n')
output.write('\\*' + ('*'*(len(tag)+2)) + '*/\n')
output.write('template <>\n')
output.write('TC_API_EXPORT EnumText EnumUtils<%s>::ToString(%s value)\n' % (name, name))
output.write('{\n')
output.write(' switch (value)\n')
output.write(' {\n')
for label, title, description in values:
output.write(' case %s: return { %s, %s, %s };\n' % (label, strescape(label), strescape(title), strescape(description)))
output.write(' default: throw std::out_of_range("value");\n')
output.write(' }\n')
output.write('}\n')
output.write('\n')
output.write('template <>\n');
output.write('TC_API_EXPORT size_t EnumUtils<%s>::Count() { return %d; }\n' % (name, len(values)))
output.write('\n')
output.write('template <>\n');
output.write('TC_API_EXPORT %s EnumUtils<%s>::FromIndex(size_t index)\n' % (name, name))
output.write('{\n')
output.write(' switch (index)\n')
output.write(' {\n')
for i in range(len(values)):
output.write(' case %d: return %s;\n' % (i, values[i][0]))
output.write(' default: throw std::out_of_range("index");\n')
output.write(' }\n')
output.write('}\n')
output.write('}\n')
output.write('}\n')
FilenamePattern = compile(r'^(.+)\.h$')
for root, dirs, files in walk('.'):
for n in files:
nameMatch = FilenamePattern.match(n)
if nameMatch is not None:
processFile(root, nameMatch.group(1))

View File

@@ -10,7 +10,7 @@
add_subdirectory(threads)
if(SERVERS OR TOOLS)
if (SERVERS OR TOOLS)
add_subdirectory(boost)
add_subdirectory(process)
add_subdirectory(zlib)
@@ -24,7 +24,7 @@ if(SERVERS OR TOOLS)
add_subdirectory(jemalloc)
endif()
if(SERVERS)
if (SERVERS)
add_subdirectory(mysql)
add_subdirectory(readline)
add_subdirectory(gsoap)
@@ -33,6 +33,6 @@ if(SERVERS)
add_subdirectory(protobuf)
endif()
if(TOOLS)
if (TOOLS)
add_subdirectory(CascLib)
endif()

View File

@@ -0,0 +1,53 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU 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 TRINITY_FUZZYFIND_H
#define TRINITY_FUZZYFIND_H
namespace Trinity
{
namespace Containers
{
template <typename Container, typename NeedleContainer, typename ContainsOperator = bool(std::string const&, std::string const&), typename T = void>
auto FuzzyFindIn(Container const& container, NeedleContainer const& needles, ContainsOperator const& contains = StringContainsStringI, int(*bonus)(decltype((*std::begin(std::declval<Container>())))) = nullptr)
{
using IteratorResult = decltype((*std::begin(container)));
using MappedType = std::conditional_t<advstd::is_reference_v<IteratorResult>, std::reference_wrapper<std::remove_reference_t<IteratorResult>>, IteratorResult>;
std::multimap<size_t, MappedType, std::greater<size_t>> results;
for (auto outerIt = std::begin(container), outerEnd = std::end(container); outerIt != outerEnd; ++outerIt)
{
size_t count = 0;
for (auto innerIt = std::begin(needles), innerEnd = std::end(needles); innerIt != innerEnd; ++innerIt)
if (contains(*outerIt, *innerIt))
++count;
if (!count)
continue;
if (bonus)
count += bonus(*outerIt);
results.emplace(count, *outerIt);
}
return results;
}
}
}
#endif

View File

@@ -0,0 +1,116 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU 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 TRINITY_SMARTENUM_H
#define TRINITY_SMARTENUM_H
#include "IteratorPair.h"
#include <iterator>
struct EnumText
{
EnumText(char const* c, char const* t, char const* d) : Constant(c), Title(t), Description(d) {}
// Enum constant of the value
char const* const Constant;
// Human-readable title of the value
char const* const Title;
// Human-readable description of the value
char const* const Description;
};
namespace Trinity
{
namespace Impl
{
template <typename Enum>
struct EnumUtils
{
static size_t Count();
static EnumText ToString(Enum value);
static Enum FromIndex(size_t index);
};
}
}
class EnumUtils
{
public:
template <typename Enum>
static size_t Count() { return Trinity::Impl::EnumUtils<Enum>::Count(); }
template <typename Enum>
static EnumText ToString(Enum value) { return Trinity::Impl::EnumUtils<Enum>::ToString(value); }
template <typename Enum>
static Enum FromIndex(size_t index) { return Trinity::Impl::EnumUtils<Enum>::FromIndex(index); }
template <typename Enum>
class Iterator
{
public:
using iterator_category = std::random_access_iterator_tag;
using value_type = Enum;
using pointer = Enum*;
using reference = Enum&;
using difference_type = std::ptrdiff_t;
Iterator() : _index(EnumUtils::Count<Enum>()) {}
explicit Iterator(size_t index) : _index(index) { }
bool operator==(const Iterator& other) const { return other._index == _index; }
bool operator!=(const Iterator& other) const { return !operator==(other); }
difference_type operator-(Iterator const& other) const { return _index - other._index; }
bool operator<(const Iterator& other) const { return _index < other._index; }
bool operator<=(const Iterator& other) const { return _index <= other._index; }
bool operator>(const Iterator& other) const { return _index > other._index; }
bool operator>=(const Iterator& other) const { return _index >= other._index; }
value_type operator[](difference_type d) const { return FromIndex<Enum>(_index + d); }
value_type operator*() const { return operator[](0); }
Iterator& operator+=(difference_type d) { _index += d; return *this; }
Iterator& operator++() { return operator+=(1); }
Iterator operator++(int) { Iterator i = *this; operator++(); return i; }
Iterator operator+(difference_type d) const { Iterator i = *this; i += d; return i; }
Iterator& operator-=(difference_type d) { _index -= d; return *this; }
Iterator& operator--() { return operator-=(1); }
Iterator operator--(int) { Iterator i = *this; operator--(); return i; }
Iterator operator-(difference_type d) const { Iterator i = *this; i -= d; return i; }
private:
difference_type _index;
};
template <typename Enum>
static Iterator<Enum> Begin() { return Iterator<Enum>(0); }
template <typename Enum>
static Iterator<Enum> End() { return Iterator<Enum>(); }
template <typename Enum>
static Trinity::IteratorPair<Iterator<Enum>> Iterate() { return { Begin<Enum>(), End<Enum>() }; }
template <typename Enum>
static char const* ToConstant(Enum value) { return ToString(value).Constant; }
template <typename Enum>
static char const* ToTitle(Enum value) { return ToString(value).Title; }
template <typename Enum>
static char const* ToDescription(Enum value) { return ToString(value).Description; }
};
#endif

View File

@@ -22,6 +22,7 @@
#include "Errors.h"
#include <array>
#include <string>
#include <utility>
#include <vector>
#include "advstd.h"
@@ -351,6 +352,11 @@ TC_COMMON_API bool StringToBool(std::string const& str);
TC_COMMON_API float DegToRad(float degrees);
TC_COMMON_API bool StringContainsStringI(std::string const& haystack, std::string const& needle);
template <typename T>
inline bool ValueContainsStringI(std::pair<T, std::string> const& haystack, std::string const& needle)
{
return StringContainsStringI(haystack.second, needle);
}
// simple class for not-modifyable list
template <typename T>

View File

@@ -18,6 +18,7 @@
#ifndef CreatureData_h__
#define CreatureData_h__
#include "Common.h"
#include "DBCEnums.h"
#include "Optional.h"
#include "SharedDefines.h"
@@ -255,6 +256,7 @@ enum CreatureDifficultyFlags7
CREATURE_DIFFICULTYFLAGS_7_UNK1 = 0x00000008
};
// EnumUtils: DESCRIBE THIS
enum CreatureFlagsExtra : uint32
{
CREATURE_FLAG_EXTRA_INSTANCE_BIND = 0x00000001, // creature kill bind instance with killer and killer's group
@@ -293,9 +295,9 @@ enum CreatureFlagsExtra : uint32
// Masks
CREATURE_FLAG_EXTRA_UNUSED = (CREATURE_FLAG_EXTRA_UNUSED_13 | CREATURE_FLAG_EXTRA_UNUSED_16 | CREATURE_FLAG_EXTRA_UNUSED_22 |
CREATURE_FLAG_EXTRA_UNUSED_23 | CREATURE_FLAG_EXTRA_UNUSED_24 | CREATURE_FLAG_EXTRA_UNUSED_25 |
CREATURE_FLAG_EXTRA_UNUSED_26 | CREATURE_FLAG_EXTRA_UNUSED_27 | CREATURE_FLAG_EXTRA_UNUSED_31),
CREATURE_FLAG_EXTRA_UNUSED_26 | CREATURE_FLAG_EXTRA_UNUSED_27 | CREATURE_FLAG_EXTRA_UNUSED_31), // SKIP
CREATURE_FLAG_EXTRA_DB_ALLOWED = (0xFFFFFFFF & ~(CREATURE_FLAG_EXTRA_UNUSED | CREATURE_FLAG_EXTRA_DUNGEON_BOSS))
CREATURE_FLAG_EXTRA_DB_ALLOWED = (0xFFFFFFFF & ~(CREATURE_FLAG_EXTRA_UNUSED | CREATURE_FLAG_EXTRA_DUNGEON_BOSS)) // SKIP
};
enum class CreatureGroundMovementType : uint8

View File

@@ -0,0 +1,116 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU 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 "CreatureData.h"
#include "Define.h"
#include "SmartEnum.h"
#include <stdexcept>
namespace Trinity
{
namespace Impl
{
/*************************************************************************\
|* data for enum 'CreatureFlagsExtra' in 'CreatureData.h' auto-generated *|
\*************************************************************************/
template <>
TC_API_EXPORT EnumText EnumUtils<CreatureFlagsExtra>::ToString(CreatureFlagsExtra value)
{
switch (value)
{
case CREATURE_FLAG_EXTRA_INSTANCE_BIND: return { "CREATURE_FLAG_EXTRA_INSTANCE_BIND", "CREATURE_FLAG_EXTRA_INSTANCE_BIND", "creature kill bind instance with killer and killer's group" };
case CREATURE_FLAG_EXTRA_CIVILIAN: return { "CREATURE_FLAG_EXTRA_CIVILIAN", "CREATURE_FLAG_EXTRA_CIVILIAN", "not aggro (ignore faction/reputation hostility)" };
case CREATURE_FLAG_EXTRA_NO_PARRY: return { "CREATURE_FLAG_EXTRA_NO_PARRY", "CREATURE_FLAG_EXTRA_NO_PARRY", "creature can't parry" };
case CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN: return { "CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN", "CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN", "creature can't counter-attack at parry" };
case CREATURE_FLAG_EXTRA_NO_BLOCK: return { "CREATURE_FLAG_EXTRA_NO_BLOCK", "CREATURE_FLAG_EXTRA_NO_BLOCK", "creature can't block" };
case CREATURE_FLAG_EXTRA_NO_CRUSH: return { "CREATURE_FLAG_EXTRA_NO_CRUSH", "CREATURE_FLAG_EXTRA_NO_CRUSH", "creature can't do crush attacks" };
case CREATURE_FLAG_EXTRA_NO_XP_AT_KILL: return { "CREATURE_FLAG_EXTRA_NO_XP_AT_KILL", "CREATURE_FLAG_EXTRA_NO_XP_AT_KILL", "creature kill not provide XP" };
case CREATURE_FLAG_EXTRA_TRIGGER: return { "CREATURE_FLAG_EXTRA_TRIGGER", "CREATURE_FLAG_EXTRA_TRIGGER", "trigger creature" };
case CREATURE_FLAG_EXTRA_NO_TAUNT: return { "CREATURE_FLAG_EXTRA_NO_TAUNT", "CREATURE_FLAG_EXTRA_NO_TAUNT", "creature is immune to taunt auras and effect attack me" };
case CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE: return { "CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE", "CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE", "creature won't update movement flags" };
case CREATURE_FLAG_EXTRA_GHOST_VISIBILITY: return { "CREATURE_FLAG_EXTRA_GHOST_VISIBILITY", "CREATURE_FLAG_EXTRA_GHOST_VISIBILITY", "creature will be only visible for dead players" };
case CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK: return { "CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK", "CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK", "creature will use offhand attacks" };
case CREATURE_FLAG_EXTRA_NO_SELL_VENDOR: return { "CREATURE_FLAG_EXTRA_NO_SELL_VENDOR", "CREATURE_FLAG_EXTRA_NO_SELL_VENDOR", "players can't sell items to this vendor" };
case CREATURE_FLAG_EXTRA_UNUSED_13: return { "CREATURE_FLAG_EXTRA_UNUSED_13", "CREATURE_FLAG_EXTRA_UNUSED_13", "" };
case CREATURE_FLAG_EXTRA_WORLDEVENT: return { "CREATURE_FLAG_EXTRA_WORLDEVENT", "CREATURE_FLAG_EXTRA_WORLDEVENT", "custom flag for world event creatures (left room for merging)" };
case CREATURE_FLAG_EXTRA_GUARD: return { "CREATURE_FLAG_EXTRA_GUARD", "CREATURE_FLAG_EXTRA_GUARD", "Creature is guard" };
case CREATURE_FLAG_EXTRA_UNUSED_16: return { "CREATURE_FLAG_EXTRA_UNUSED_16", "CREATURE_FLAG_EXTRA_UNUSED_16", "" };
case CREATURE_FLAG_EXTRA_NO_CRIT: return { "CREATURE_FLAG_EXTRA_NO_CRIT", "CREATURE_FLAG_EXTRA_NO_CRIT", "creature can't do critical strikes" };
case CREATURE_FLAG_EXTRA_NO_SKILLGAIN: return { "CREATURE_FLAG_EXTRA_NO_SKILLGAIN", "CREATURE_FLAG_EXTRA_NO_SKILLGAIN", "creature won't increase weapon skills" };
case CREATURE_FLAG_EXTRA_TAUNT_DIMINISH: return { "CREATURE_FLAG_EXTRA_TAUNT_DIMINISH", "CREATURE_FLAG_EXTRA_TAUNT_DIMINISH", "Taunt is a subject to diminishing returns on this creautre" };
case CREATURE_FLAG_EXTRA_ALL_DIMINISH: return { "CREATURE_FLAG_EXTRA_ALL_DIMINISH", "CREATURE_FLAG_EXTRA_ALL_DIMINISH", "creature is subject to all diminishing returns as player are" };
case CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ: return { "CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ", "CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ", "creature does not need to take player damage for kill credit" };
case CREATURE_FLAG_EXTRA_UNUSED_22: return { "CREATURE_FLAG_EXTRA_UNUSED_22", "CREATURE_FLAG_EXTRA_UNUSED_22", "" };
case CREATURE_FLAG_EXTRA_UNUSED_23: return { "CREATURE_FLAG_EXTRA_UNUSED_23", "CREATURE_FLAG_EXTRA_UNUSED_23", "" };
case CREATURE_FLAG_EXTRA_UNUSED_24: return { "CREATURE_FLAG_EXTRA_UNUSED_24", "CREATURE_FLAG_EXTRA_UNUSED_24", "" };
case CREATURE_FLAG_EXTRA_UNUSED_25: return { "CREATURE_FLAG_EXTRA_UNUSED_25", "CREATURE_FLAG_EXTRA_UNUSED_25", "" };
case CREATURE_FLAG_EXTRA_UNUSED_26: return { "CREATURE_FLAG_EXTRA_UNUSED_26", "CREATURE_FLAG_EXTRA_UNUSED_26", "" };
case CREATURE_FLAG_EXTRA_UNUSED_27: return { "CREATURE_FLAG_EXTRA_UNUSED_27", "CREATURE_FLAG_EXTRA_UNUSED_27", "" };
case CREATURE_FLAG_EXTRA_DUNGEON_BOSS: return { "CREATURE_FLAG_EXTRA_DUNGEON_BOSS", "CREATURE_FLAG_EXTRA_DUNGEON_BOSS", "creature is a dungeon boss (SET DYNAMICALLY, DO NOT ADD IN DB)" };
case CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING: return { "CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING", "CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING", "creature ignore pathfinding" };
case CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK: return { "CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK", "CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK", "creature is immune to knockback effects" };
case CREATURE_FLAG_EXTRA_UNUSED_31: return { "CREATURE_FLAG_EXTRA_UNUSED_31", "CREATURE_FLAG_EXTRA_UNUSED_31", "" };
default: throw std::out_of_range("value");
}
}
template <>
TC_API_EXPORT size_t EnumUtils<CreatureFlagsExtra>::Count() { return 32; }
template <>
TC_API_EXPORT CreatureFlagsExtra EnumUtils<CreatureFlagsExtra>::FromIndex(size_t index)
{
switch (index)
{
case 0: return CREATURE_FLAG_EXTRA_INSTANCE_BIND;
case 1: return CREATURE_FLAG_EXTRA_CIVILIAN;
case 2: return CREATURE_FLAG_EXTRA_NO_PARRY;
case 3: return CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN;
case 4: return CREATURE_FLAG_EXTRA_NO_BLOCK;
case 5: return CREATURE_FLAG_EXTRA_NO_CRUSH;
case 6: return CREATURE_FLAG_EXTRA_NO_XP_AT_KILL;
case 7: return CREATURE_FLAG_EXTRA_TRIGGER;
case 8: return CREATURE_FLAG_EXTRA_NO_TAUNT;
case 9: return CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE;
case 10: return CREATURE_FLAG_EXTRA_GHOST_VISIBILITY;
case 11: return CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK;
case 12: return CREATURE_FLAG_EXTRA_NO_SELL_VENDOR;
case 13: return CREATURE_FLAG_EXTRA_UNUSED_13;
case 14: return CREATURE_FLAG_EXTRA_WORLDEVENT;
case 15: return CREATURE_FLAG_EXTRA_GUARD;
case 16: return CREATURE_FLAG_EXTRA_UNUSED_16;
case 17: return CREATURE_FLAG_EXTRA_NO_CRIT;
case 18: return CREATURE_FLAG_EXTRA_NO_SKILLGAIN;
case 19: return CREATURE_FLAG_EXTRA_TAUNT_DIMINISH;
case 20: return CREATURE_FLAG_EXTRA_ALL_DIMINISH;
case 21: return CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ;
case 22: return CREATURE_FLAG_EXTRA_UNUSED_22;
case 23: return CREATURE_FLAG_EXTRA_UNUSED_23;
case 24: return CREATURE_FLAG_EXTRA_UNUSED_24;
case 25: return CREATURE_FLAG_EXTRA_UNUSED_25;
case 26: return CREATURE_FLAG_EXTRA_UNUSED_26;
case 27: return CREATURE_FLAG_EXTRA_UNUSED_27;
case 28: return CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
case 29: return CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING;
case 30: return CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK;
case 31: return CREATURE_FLAG_EXTRA_UNUSED_31;
default: throw std::out_of_range("index");
}
}
}
}

View File

@@ -114,6 +114,7 @@ enum UnitMoveType
#define MAX_MOVE_TYPE 9
// Value masks for UNIT_FIELD_FLAGS
// EnumUtils: DESCRIBE THIS
enum UnitFlags : uint32
{
UNIT_FLAG_SERVER_CONTROLLED = 0x00000001, // set only when unit movement is controlled by server - by SPLINE/MONSTER_MOVE packets, together with UNIT_FLAG_STUNNED; only set to units controlled by client; client function CGUnit_C::IsClientControlled returns false when set for owner
@@ -148,10 +149,10 @@ enum UnitFlags : uint32
UNIT_FLAG_UNK_29 = 0x20000000, // used in Feing Death spell
UNIT_FLAG_SHEATHE = 0x40000000,
UNIT_FLAG_UNK_31 = 0x80000000,
MAX_UNIT_FLAGS = 32
};
// Value masks for UNIT_FIELD_FLAGS_2
// EnumUtils: DESCRIBE THIS
enum UnitFlags2 : uint32
{
UNIT_FLAG2_FEIGN_DEATH = 0x00000001,
@@ -174,68 +175,69 @@ enum UnitFlags2 : uint32
UNIT_FLAG2_PLAY_DEATH_ANIM = 0x00020000, // Plays special death animation upon death
UNIT_FLAG2_ALLOW_CHEAT_SPELLS = 0x00040000, // Allows casting spells with AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL
UNIT_FLAG2_NO_ACTIONS = 0x00800000,
MAX_UNIT_FLAGS_2 = 19
};
// Value masks for UNIT_FIELD_FLAGS_3
// EnumUtils: DESCRIBE THIS
enum UnitFlags3 : uint32
{
UNIT_FLAG3_UNK1 = 0x00000001,
MAX_UNIT_FLAGS_3 = 1
};
/// Non Player Character flags
// EnumUtils: DESCRIBE THIS
enum NPCFlags : uint32
{
UNIT_NPC_FLAG_NONE = 0x00000000,
UNIT_NPC_FLAG_GOSSIP = 0x00000001, // 100%
UNIT_NPC_FLAG_QUESTGIVER = 0x00000002, // 100%
UNIT_NPC_FLAG_GOSSIP = 0x00000001, // TITLE has gossip menu DESCRIPTION 100%
UNIT_NPC_FLAG_QUESTGIVER = 0x00000002, // TITLE is quest giver DESCRIPTION 100%
UNIT_NPC_FLAG_UNK1 = 0x00000004,
UNIT_NPC_FLAG_UNK2 = 0x00000008,
UNIT_NPC_FLAG_TRAINER = 0x00000010, // 100%
UNIT_NPC_FLAG_TRAINER_CLASS = 0x00000020, // 100%
UNIT_NPC_FLAG_TRAINER_PROFESSION = 0x00000040, // 100%
UNIT_NPC_FLAG_VENDOR = 0x00000080, // 100%
UNIT_NPC_FLAG_VENDOR_AMMO = 0x00000100, // 100%, general goods vendor
UNIT_NPC_FLAG_VENDOR_FOOD = 0x00000200, // 100%
UNIT_NPC_FLAG_VENDOR_POISON = 0x00000400, // guessed
UNIT_NPC_FLAG_VENDOR_REAGENT = 0x00000800, // 100%
UNIT_NPC_FLAG_REPAIR = 0x00001000, // 100%
UNIT_NPC_FLAG_FLIGHTMASTER = 0x00002000, // 100%
UNIT_NPC_FLAG_SPIRITHEALER = 0x00004000, // guessed
UNIT_NPC_FLAG_SPIRITGUIDE = 0x00008000, // guessed
UNIT_NPC_FLAG_INNKEEPER = 0x00010000, // 100%
UNIT_NPC_FLAG_BANKER = 0x00020000, // 100%
UNIT_NPC_FLAG_PETITIONER = 0x00040000, // 100% 0xC0000 = guild petitions, 0x40000 = arena team petitions
UNIT_NPC_FLAG_TABARDDESIGNER = 0x00080000, // 100%
UNIT_NPC_FLAG_BATTLEMASTER = 0x00100000, // 100%
UNIT_NPC_FLAG_AUCTIONEER = 0x00200000, // 100%
UNIT_NPC_FLAG_STABLEMASTER = 0x00400000, // 100%
UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, //
UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, //
UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set
UNIT_NPC_FLAG_MAILBOX = 0x04000000, // mailbox
UNIT_NPC_FLAG_ARTIFACT_POWER_RESPEC = 0x08000000, // artifact powers reset
UNIT_NPC_FLAG_TRANSMOGRIFIER = 0x10000000, // transmogrification
UNIT_NPC_FLAG_VAULTKEEPER = 0x20000000, // void storage
UNIT_NPC_FLAG_WILD_BATTLE_PET = 0x40000000, // Pet that player can fight (Battle Pet)
UNIT_NPC_FLAG_BLACK_MARKET = 0x80000000 // black market
UNIT_NPC_FLAG_TRAINER = 0x00000010, // TITLE is trainer DESCRIPTION 100%
UNIT_NPC_FLAG_TRAINER_CLASS = 0x00000020, // TITLE is class trainer DESCRIPTION 100%
UNIT_NPC_FLAG_TRAINER_PROFESSION = 0x00000040, // TITLE is profession trainer DESCRIPTION 100%
UNIT_NPC_FLAG_VENDOR = 0x00000080, // TITLE is vendor (generic) DESCRIPTION 100%
UNIT_NPC_FLAG_VENDOR_AMMO = 0x00000100, // TITLE is vendor (ammo) DESCRIPTION 100%, general goods vendor
UNIT_NPC_FLAG_VENDOR_FOOD = 0x00000200, // TITLE is vendor (food) DESCRIPTION 100%
UNIT_NPC_FLAG_VENDOR_POISON = 0x00000400, // TITLE is vendor (poison) DESCRIPTION guessed
UNIT_NPC_FLAG_VENDOR_REAGENT = 0x00000800, // TITLE is vendor (reagents) DESCRIPTION 100%
UNIT_NPC_FLAG_REPAIR = 0x00001000, // TITLE can repair DESCRIPTION 100%
UNIT_NPC_FLAG_FLIGHTMASTER = 0x00002000, // TITLE is flight master DESCRIPTION 100%
UNIT_NPC_FLAG_SPIRITHEALER = 0x00004000, // TITLE is spirit healer DESCRIPTION guessed
UNIT_NPC_FLAG_SPIRITGUIDE = 0x00008000, // TITLE is spirit guide DESCRIPTION guessed
UNIT_NPC_FLAG_INNKEEPER = 0x00010000, // TITLE is innkeeper
UNIT_NPC_FLAG_BANKER = 0x00020000, // TITLE is banker DESCRIPTION 100%
UNIT_NPC_FLAG_PETITIONER = 0x00040000, // TITLE handles guild/arena petitions DESCRIPTION 100% 0xC0000 = guild petitions, 0x40000 = arena team petitions
UNIT_NPC_FLAG_TABARDDESIGNER = 0x00080000, // TITLE is guild tabard designer DESCRIPTION 100%
UNIT_NPC_FLAG_BATTLEMASTER = 0x00100000, // TITLE is battlemaster DESCRIPTION 100%
UNIT_NPC_FLAG_AUCTIONEER = 0x00200000, // TITLE is auctioneer DESCRIPTION 100%
UNIT_NPC_FLAG_STABLEMASTER = 0x00400000, // TITLE is stable master DESCRIPTION 100%
UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // TITLE is guild banker DESCRIPTION
UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // TITLE has spell click enabled
UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // TITLE is player vehicle DESCRIPTION players with mounts that have vehicle data should have it set
UNIT_NPC_FLAG_MAILBOX = 0x04000000, // TITLE is mailbox
UNIT_NPC_FLAG_ARTIFACT_POWER_RESPEC = 0x08000000, // TITLE can reset artifact powers
UNIT_NPC_FLAG_TRANSMOGRIFIER = 0x10000000, // TITLE transmogrification
UNIT_NPC_FLAG_VAULTKEEPER = 0x20000000, // TITLE is void storage
UNIT_NPC_FLAG_WILD_BATTLE_PET = 0x40000000, // TITLE is wild battle pet DESCRIPTION Pet that player can fight (Battle Pet)
UNIT_NPC_FLAG_BLACK_MARKET = 0x80000000 // TITLE is black market
};
// EnumUtils: DESCRIBE THIS
enum NPCFlags2 : uint32
{
UNIT_NPC_FLAG_2_NONE = 0x0000,
UNIT_NPC_FLAG_2_ITEM_UPGRADE_MASTER = 0x0001,
UNIT_NPC_FLAG_2_GARRISON_ARCHITECT = 0x0002,
UNIT_NPC_FLAG_2_STEERING = 0x0004,
UNIT_NPC_FLAG_2_SHIPMENT_CRAFTER = 0x0010,
UNIT_NPC_FLAG_2_GARRISON_MISSION_NPC = 0x0020,
UNIT_NPC_FLAG_2_TRADESKILL_NPC = 0x0040,
UNIT_NPC_FLAG_2_BLACK_MARKET_VIEW = 0x0080,
UNIT_NPC_FLAG_2_GARRISON_TALENT_NPC = 0x0200,
UNIT_NPC_FLAG_2_CONTRIBUTION_COLLECTOR = 0x0400,
UNIT_NPC_FLAG_2_AZERITE_RESPEC = 0x4000,
UNIT_NPC_FLAG_2_ISLANDS_QUEUE = 0x8000,
UNIT_NPC_FLAG_2_ITEM_UPGRADE_MASTER = 0x0001, // TITLE is item upgrade
UNIT_NPC_FLAG_2_GARRISON_ARCHITECT = 0x0002, // TITLE is garrison architect DESCRIPTION garrison building placement UI
UNIT_NPC_FLAG_2_STEERING = 0x0004, // TITLE is avoiding obstacles DESCRIPTION clientside pathfinding
UNIT_NPC_FLAG_2_SHIPMENT_CRAFTER = 0x0010, // TITLE is shipment crafter DESCRIPTION garrison work orders
UNIT_NPC_FLAG_2_GARRISON_MISSION_NPC = 0x0020, // TITLE is garrison mission
UNIT_NPC_FLAG_2_TRADESKILL_NPC = 0x0040, // TITLE is tradeskill DESCRIPTION crafting at npc
UNIT_NPC_FLAG_2_BLACK_MARKET_VIEW = 0x0080, // TITLE is black market view DESCRIPTION only allows viewing black market auctions, no bidding
UNIT_NPC_FLAG_2_GARRISON_TALENT_NPC = 0x0200, // TITLE is garrrison talent
UNIT_NPC_FLAG_2_CONTRIBUTION_COLLECTOR = 0x0400, // TITLE is contribution collector
UNIT_NPC_FLAG_2_AZERITE_RESPEC = 0x4000, // TITLE is azerite respec
UNIT_NPC_FLAG_2_ISLANDS_QUEUE = 0x8000, // TITLE is islands queue
};
enum MovementFlags : uint32

View File

@@ -0,0 +1,344 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU 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 "UnitDefines.h"
#include "Define.h"
#include "SmartEnum.h"
#include <stdexcept>
namespace Trinity
{
namespace Impl
{
/***************************************************************\
|* data for enum 'UnitFlags' in 'UnitDefines.h' auto-generated *|
\***************************************************************/
template <>
TC_API_EXPORT EnumText EnumUtils<UnitFlags>::ToString(UnitFlags value)
{
switch (value)
{
case UNIT_FLAG_SERVER_CONTROLLED: return { "UNIT_FLAG_SERVER_CONTROLLED", "UNIT_FLAG_SERVER_CONTROLLED", "set only when unit movement is controlled by server - by SPLINE/MONSTER_MOVE packets, together with UNIT_FLAG_STUNNED; only set to units controlled by client; client function CGUnit_C::IsClientControlled returns false when set for owner" };
case UNIT_FLAG_NON_ATTACKABLE: return { "UNIT_FLAG_NON_ATTACKABLE", "UNIT_FLAG_NON_ATTACKABLE", "not attackable" };
case UNIT_FLAG_REMOVE_CLIENT_CONTROL: return { "UNIT_FLAG_REMOVE_CLIENT_CONTROL", "UNIT_FLAG_REMOVE_CLIENT_CONTROL", "This is a legacy flag used to disable movement player's movement while controlling other units, SMSG_CLIENT_CONTROL replaces this functionality clientside now. CONFUSED and FLEEING flags have the same effect on client movement asDISABLE_MOVE_CONTROL in addition to preventing spell casts/autoattack (they all allow climbing steeper hills and emotes while moving)" };
case UNIT_FLAG_PLAYER_CONTROLLED: return { "UNIT_FLAG_PLAYER_CONTROLLED", "UNIT_FLAG_PLAYER_CONTROLLED", "controlled by player, use _IMMUNE_TO_PC instead of _IMMUNE_TO_NPC" };
case UNIT_FLAG_RENAME: return { "UNIT_FLAG_RENAME", "UNIT_FLAG_RENAME", "" };
case UNIT_FLAG_PREPARATION: return { "UNIT_FLAG_PREPARATION", "UNIT_FLAG_PREPARATION", "don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP" };
case UNIT_FLAG_UNK_6: return { "UNIT_FLAG_UNK_6", "UNIT_FLAG_UNK_6", "" };
case UNIT_FLAG_NOT_ATTACKABLE_1: return { "UNIT_FLAG_NOT_ATTACKABLE_1", "UNIT_FLAG_NOT_ATTACKABLE_1", "?? (UNIT_FLAG_PLAYER_CONTROLLED | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE" };
case UNIT_FLAG_IMMUNE_TO_PC: return { "UNIT_FLAG_IMMUNE_TO_PC", "UNIT_FLAG_IMMUNE_TO_PC", "disables combat/assistance with PlayerCharacters (PC) - see Unit::IsValidAttackTarget, Unit::IsValidAssistTarget" };
case UNIT_FLAG_IMMUNE_TO_NPC: return { "UNIT_FLAG_IMMUNE_TO_NPC", "UNIT_FLAG_IMMUNE_TO_NPC", "disables combat/assistance with NonPlayerCharacters (NPC) - see Unit::IsValidAttackTarget, Unit::IsValidAssistTarget" };
case UNIT_FLAG_LOOTING: return { "UNIT_FLAG_LOOTING", "UNIT_FLAG_LOOTING", "loot animation" };
case UNIT_FLAG_PET_IN_COMBAT: return { "UNIT_FLAG_PET_IN_COMBAT", "UNIT_FLAG_PET_IN_COMBAT", "on player pets: whether the pet is chasing a target to attack || on other units: whether any of the unit's minions is in combat" };
case UNIT_FLAG_PVP: return { "UNIT_FLAG_PVP", "UNIT_FLAG_PVP", "changed in 3.0.3" };
case UNIT_FLAG_SILENCED: return { "UNIT_FLAG_SILENCED", "UNIT_FLAG_SILENCED", "silenced, 2.1.1" };
case UNIT_FLAG_CANNOT_SWIM: return { "UNIT_FLAG_CANNOT_SWIM", "UNIT_FLAG_CANNOT_SWIM", "2.0.8" };
case UNIT_FLAG_UNK_15: return { "UNIT_FLAG_UNK_15", "UNIT_FLAG_UNK_15", "" };
case UNIT_FLAG_NON_ATTACKABLE_2: return { "UNIT_FLAG_NON_ATTACKABLE_2", "UNIT_FLAG_NON_ATTACKABLE_2", "removes attackable icon, if on yourself, cannot assist self but can cast TARGET_SELF spells - added by SPELL_AURA_MOD_UNATTACKABLE" };
case UNIT_FLAG_PACIFIED: return { "UNIT_FLAG_PACIFIED", "UNIT_FLAG_PACIFIED", "3.0.3 ok" };
case UNIT_FLAG_STUNNED: return { "UNIT_FLAG_STUNNED", "UNIT_FLAG_STUNNED", "3.0.3 ok" };
case UNIT_FLAG_IN_COMBAT: return { "UNIT_FLAG_IN_COMBAT", "UNIT_FLAG_IN_COMBAT", "" };
case UNIT_FLAG_TAXI_FLIGHT: return { "UNIT_FLAG_TAXI_FLIGHT", "UNIT_FLAG_TAXI_FLIGHT", "disable casting at client side spell not allowed by taxi flight (mounted?), probably used with 0x4 flag" };
case UNIT_FLAG_DISARMED: return { "UNIT_FLAG_DISARMED", "UNIT_FLAG_DISARMED", "3.0.3, disable melee spells casting..., \042Required melee weapon\042 added to melee spells tooltip." };
case UNIT_FLAG_CONFUSED: return { "UNIT_FLAG_CONFUSED", "UNIT_FLAG_CONFUSED", "" };
case UNIT_FLAG_FLEEING: return { "UNIT_FLAG_FLEEING", "UNIT_FLAG_FLEEING", "" };
case UNIT_FLAG_POSSESSED: return { "UNIT_FLAG_POSSESSED", "UNIT_FLAG_POSSESSED", "under direct client control by a player (possess or vehicle)" };
case UNIT_FLAG_NOT_SELECTABLE: return { "UNIT_FLAG_NOT_SELECTABLE", "UNIT_FLAG_NOT_SELECTABLE", "" };
case UNIT_FLAG_SKINNABLE: return { "UNIT_FLAG_SKINNABLE", "UNIT_FLAG_SKINNABLE", "" };
case UNIT_FLAG_MOUNT: return { "UNIT_FLAG_MOUNT", "UNIT_FLAG_MOUNT", "" };
case UNIT_FLAG_UNK_28: return { "UNIT_FLAG_UNK_28", "UNIT_FLAG_UNK_28", "" };
case UNIT_FLAG_UNK_29: return { "UNIT_FLAG_UNK_29", "UNIT_FLAG_UNK_29", "used in Feing Death spell" };
case UNIT_FLAG_SHEATHE: return { "UNIT_FLAG_SHEATHE", "UNIT_FLAG_SHEATHE", "" };
case UNIT_FLAG_UNK_31: return { "UNIT_FLAG_UNK_31", "UNIT_FLAG_UNK_31", "" };
default: throw std::out_of_range("value");
}
}
template <>
TC_API_EXPORT size_t EnumUtils<UnitFlags>::Count() { return 32; }
template <>
TC_API_EXPORT UnitFlags EnumUtils<UnitFlags>::FromIndex(size_t index)
{
switch (index)
{
case 0: return UNIT_FLAG_SERVER_CONTROLLED;
case 1: return UNIT_FLAG_NON_ATTACKABLE;
case 2: return UNIT_FLAG_REMOVE_CLIENT_CONTROL;
case 3: return UNIT_FLAG_PLAYER_CONTROLLED;
case 4: return UNIT_FLAG_RENAME;
case 5: return UNIT_FLAG_PREPARATION;
case 6: return UNIT_FLAG_UNK_6;
case 7: return UNIT_FLAG_NOT_ATTACKABLE_1;
case 8: return UNIT_FLAG_IMMUNE_TO_PC;
case 9: return UNIT_FLAG_IMMUNE_TO_NPC;
case 10: return UNIT_FLAG_LOOTING;
case 11: return UNIT_FLAG_PET_IN_COMBAT;
case 12: return UNIT_FLAG_PVP;
case 13: return UNIT_FLAG_SILENCED;
case 14: return UNIT_FLAG_CANNOT_SWIM;
case 15: return UNIT_FLAG_UNK_15;
case 16: return UNIT_FLAG_NON_ATTACKABLE_2;
case 17: return UNIT_FLAG_PACIFIED;
case 18: return UNIT_FLAG_STUNNED;
case 19: return UNIT_FLAG_IN_COMBAT;
case 20: return UNIT_FLAG_TAXI_FLIGHT;
case 21: return UNIT_FLAG_DISARMED;
case 22: return UNIT_FLAG_CONFUSED;
case 23: return UNIT_FLAG_FLEEING;
case 24: return UNIT_FLAG_POSSESSED;
case 25: return UNIT_FLAG_NOT_SELECTABLE;
case 26: return UNIT_FLAG_SKINNABLE;
case 27: return UNIT_FLAG_MOUNT;
case 28: return UNIT_FLAG_UNK_28;
case 29: return UNIT_FLAG_UNK_29;
case 30: return UNIT_FLAG_SHEATHE;
case 31: return UNIT_FLAG_UNK_31;
default: throw std::out_of_range("index");
}
}
/****************************************************************\
|* data for enum 'UnitFlags2' in 'UnitDefines.h' auto-generated *|
\****************************************************************/
template <>
TC_API_EXPORT EnumText EnumUtils<UnitFlags2>::ToString(UnitFlags2 value)
{
switch (value)
{
case UNIT_FLAG2_FEIGN_DEATH: return { "UNIT_FLAG2_FEIGN_DEATH", "UNIT_FLAG2_FEIGN_DEATH", "" };
case UNIT_FLAG2_UNK1: return { "UNIT_FLAG2_UNK1", "UNIT_FLAG2_UNK1", "Hide unit model (show only player equip)" };
case UNIT_FLAG2_IGNORE_REPUTATION: return { "UNIT_FLAG2_IGNORE_REPUTATION", "UNIT_FLAG2_IGNORE_REPUTATION", "" };
case UNIT_FLAG2_COMPREHEND_LANG: return { "UNIT_FLAG2_COMPREHEND_LANG", "UNIT_FLAG2_COMPREHEND_LANG", "" };
case UNIT_FLAG2_MIRROR_IMAGE: return { "UNIT_FLAG2_MIRROR_IMAGE", "UNIT_FLAG2_MIRROR_IMAGE", "" };
case UNIT_FLAG2_INSTANTLY_APPEAR_MODEL: return { "UNIT_FLAG2_INSTANTLY_APPEAR_MODEL", "UNIT_FLAG2_INSTANTLY_APPEAR_MODEL", "Unit model instantly appears when summoned (does not fade in)" };
case UNIT_FLAG2_FORCE_MOVEMENT: return { "UNIT_FLAG2_FORCE_MOVEMENT", "UNIT_FLAG2_FORCE_MOVEMENT", "" };
case UNIT_FLAG2_DISARM_OFFHAND: return { "UNIT_FLAG2_DISARM_OFFHAND", "UNIT_FLAG2_DISARM_OFFHAND", "" };
case UNIT_FLAG2_DISABLE_PRED_STATS: return { "UNIT_FLAG2_DISABLE_PRED_STATS", "UNIT_FLAG2_DISABLE_PRED_STATS", "Player has disabled predicted stats (Used by raid frames)" };
case UNIT_FLAG2_ALLOW_CHANGING_TALENTS: return { "UNIT_FLAG2_ALLOW_CHANGING_TALENTS", "UNIT_FLAG2_ALLOW_CHANGING_TALENTS", "Allows changing talents outside rest area" };
case UNIT_FLAG2_DISARM_RANGED: return { "UNIT_FLAG2_DISARM_RANGED", "UNIT_FLAG2_DISARM_RANGED", "this does not disable ranged weapon display (maybe additional flag needed?)" };
case UNIT_FLAG2_REGENERATE_POWER: return { "UNIT_FLAG2_REGENERATE_POWER", "UNIT_FLAG2_REGENERATE_POWER", "" };
case UNIT_FLAG2_RESTRICT_PARTY_INTERACTION: return { "UNIT_FLAG2_RESTRICT_PARTY_INTERACTION", "UNIT_FLAG2_RESTRICT_PARTY_INTERACTION", "Restrict interaction to party or raid" };
case UNIT_FLAG2_PREVENT_SPELL_CLICK: return { "UNIT_FLAG2_PREVENT_SPELL_CLICK", "UNIT_FLAG2_PREVENT_SPELL_CLICK", "Prevent spellclick" };
case UNIT_FLAG2_ALLOW_ENEMY_INTERACT: return { "UNIT_FLAG2_ALLOW_ENEMY_INTERACT", "UNIT_FLAG2_ALLOW_ENEMY_INTERACT", "" };
case UNIT_FLAG2_DISABLE_TURN: return { "UNIT_FLAG2_DISABLE_TURN", "UNIT_FLAG2_DISABLE_TURN", "" };
case UNIT_FLAG2_UNK2: return { "UNIT_FLAG2_UNK2", "UNIT_FLAG2_UNK2", "" };
case UNIT_FLAG2_PLAY_DEATH_ANIM: return { "UNIT_FLAG2_PLAY_DEATH_ANIM", "UNIT_FLAG2_PLAY_DEATH_ANIM", "Plays special death animation upon death" };
case UNIT_FLAG2_ALLOW_CHEAT_SPELLS: return { "UNIT_FLAG2_ALLOW_CHEAT_SPELLS", "UNIT_FLAG2_ALLOW_CHEAT_SPELLS", "Allows casting spells with AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL" };
case UNIT_FLAG2_NO_ACTIONS: return { "UNIT_FLAG2_NO_ACTIONS", "UNIT_FLAG2_NO_ACTIONS", "" };
default: throw std::out_of_range("value");
}
}
template <>
TC_API_EXPORT size_t EnumUtils<UnitFlags2>::Count() { return 20; }
template <>
TC_API_EXPORT UnitFlags2 EnumUtils<UnitFlags2>::FromIndex(size_t index)
{
switch (index)
{
case 0: return UNIT_FLAG2_FEIGN_DEATH;
case 1: return UNIT_FLAG2_UNK1;
case 2: return UNIT_FLAG2_IGNORE_REPUTATION;
case 3: return UNIT_FLAG2_COMPREHEND_LANG;
case 4: return UNIT_FLAG2_MIRROR_IMAGE;
case 5: return UNIT_FLAG2_INSTANTLY_APPEAR_MODEL;
case 6: return UNIT_FLAG2_FORCE_MOVEMENT;
case 7: return UNIT_FLAG2_DISARM_OFFHAND;
case 8: return UNIT_FLAG2_DISABLE_PRED_STATS;
case 9: return UNIT_FLAG2_ALLOW_CHANGING_TALENTS;
case 10: return UNIT_FLAG2_DISARM_RANGED;
case 11: return UNIT_FLAG2_REGENERATE_POWER;
case 12: return UNIT_FLAG2_RESTRICT_PARTY_INTERACTION;
case 13: return UNIT_FLAG2_PREVENT_SPELL_CLICK;
case 14: return UNIT_FLAG2_ALLOW_ENEMY_INTERACT;
case 15: return UNIT_FLAG2_DISABLE_TURN;
case 16: return UNIT_FLAG2_UNK2;
case 17: return UNIT_FLAG2_PLAY_DEATH_ANIM;
case 18: return UNIT_FLAG2_ALLOW_CHEAT_SPELLS;
case 19: return UNIT_FLAG2_NO_ACTIONS;
default: throw std::out_of_range("index");
}
}
/****************************************************************\
|* data for enum 'UnitFlags3' in 'UnitDefines.h' auto-generated *|
\****************************************************************/
template <>
TC_API_EXPORT EnumText EnumUtils<UnitFlags3>::ToString(UnitFlags3 value)
{
switch (value)
{
case UNIT_FLAG3_UNK1: return { "UNIT_FLAG3_UNK1", "UNIT_FLAG3_UNK1", "" };
default: throw std::out_of_range("value");
}
}
template <>
TC_API_EXPORT size_t EnumUtils<UnitFlags3>::Count() { return 1; }
template <>
TC_API_EXPORT UnitFlags3 EnumUtils<UnitFlags3>::FromIndex(size_t index)
{
switch (index)
{
case 0: return UNIT_FLAG3_UNK1;
default: throw std::out_of_range("index");
}
}
/**************************************************************\
|* data for enum 'NPCFlags' in 'UnitDefines.h' auto-generated *|
\**************************************************************/
template <>
TC_API_EXPORT EnumText EnumUtils<NPCFlags>::ToString(NPCFlags value)
{
switch (value)
{
case UNIT_NPC_FLAG_NONE: return { "UNIT_NPC_FLAG_NONE", "UNIT_NPC_FLAG_NONE", "" };
case UNIT_NPC_FLAG_GOSSIP: return { "UNIT_NPC_FLAG_GOSSIP", "has gossip menu", "100%" };
case UNIT_NPC_FLAG_QUESTGIVER: return { "UNIT_NPC_FLAG_QUESTGIVER", "is quest giver", "100%" };
case UNIT_NPC_FLAG_UNK1: return { "UNIT_NPC_FLAG_UNK1", "UNIT_NPC_FLAG_UNK1", "" };
case UNIT_NPC_FLAG_UNK2: return { "UNIT_NPC_FLAG_UNK2", "UNIT_NPC_FLAG_UNK2", "" };
case UNIT_NPC_FLAG_TRAINER: return { "UNIT_NPC_FLAG_TRAINER", "is trainer", "100%" };
case UNIT_NPC_FLAG_TRAINER_CLASS: return { "UNIT_NPC_FLAG_TRAINER_CLASS", "is class trainer", "100%" };
case UNIT_NPC_FLAG_TRAINER_PROFESSION: return { "UNIT_NPC_FLAG_TRAINER_PROFESSION", "is profession trainer", "100%" };
case UNIT_NPC_FLAG_VENDOR: return { "UNIT_NPC_FLAG_VENDOR", "is vendor (generic)", "100%" };
case UNIT_NPC_FLAG_VENDOR_AMMO: return { "UNIT_NPC_FLAG_VENDOR_AMMO", "is vendor (ammo)", "100%, general goods vendor" };
case UNIT_NPC_FLAG_VENDOR_FOOD: return { "UNIT_NPC_FLAG_VENDOR_FOOD", "is vendor (food)", "100%" };
case UNIT_NPC_FLAG_VENDOR_POISON: return { "UNIT_NPC_FLAG_VENDOR_POISON", "is vendor (poison)", "guessed" };
case UNIT_NPC_FLAG_VENDOR_REAGENT: return { "UNIT_NPC_FLAG_VENDOR_REAGENT", "is vendor (reagents)", "100%" };
case UNIT_NPC_FLAG_REPAIR: return { "UNIT_NPC_FLAG_REPAIR", "can repair", "100%" };
case UNIT_NPC_FLAG_FLIGHTMASTER: return { "UNIT_NPC_FLAG_FLIGHTMASTER", "is flight master", "100%" };
case UNIT_NPC_FLAG_SPIRITHEALER: return { "UNIT_NPC_FLAG_SPIRITHEALER", "is spirit healer", "guessed" };
case UNIT_NPC_FLAG_SPIRITGUIDE: return { "UNIT_NPC_FLAG_SPIRITGUIDE", "is spirit guide", "guessed" };
case UNIT_NPC_FLAG_INNKEEPER: return { "UNIT_NPC_FLAG_INNKEEPER", "is innkeeper", "" };
case UNIT_NPC_FLAG_BANKER: return { "UNIT_NPC_FLAG_BANKER", "is banker", "100%" };
case UNIT_NPC_FLAG_PETITIONER: return { "UNIT_NPC_FLAG_PETITIONER", "handles guild/arena petitions", "100% 0xC0000 = guild petitions, 0x40000 = arena team petitions" };
case UNIT_NPC_FLAG_TABARDDESIGNER: return { "UNIT_NPC_FLAG_TABARDDESIGNER", "is guild tabard designer", "100%" };
case UNIT_NPC_FLAG_BATTLEMASTER: return { "UNIT_NPC_FLAG_BATTLEMASTER", "is battlemaster", "100%" };
case UNIT_NPC_FLAG_AUCTIONEER: return { "UNIT_NPC_FLAG_AUCTIONEER", "is auctioneer", "100%" };
case UNIT_NPC_FLAG_STABLEMASTER: return { "UNIT_NPC_FLAG_STABLEMASTER", "is stable master", "100%" };
case UNIT_NPC_FLAG_GUILD_BANKER: return { "UNIT_NPC_FLAG_GUILD_BANKER", "is guild banker DESCRIPTION", "" };
case UNIT_NPC_FLAG_SPELLCLICK: return { "UNIT_NPC_FLAG_SPELLCLICK", "has spell click enabled", "" };
case UNIT_NPC_FLAG_PLAYER_VEHICLE: return { "UNIT_NPC_FLAG_PLAYER_VEHICLE", "is player vehicle", "players with mounts that have vehicle data should have it set" };
case UNIT_NPC_FLAG_MAILBOX: return { "UNIT_NPC_FLAG_MAILBOX", "is mailbox", "" };
case UNIT_NPC_FLAG_ARTIFACT_POWER_RESPEC: return { "UNIT_NPC_FLAG_ARTIFACT_POWER_RESPEC", "can reset artifact powers", "" };
case UNIT_NPC_FLAG_TRANSMOGRIFIER: return { "UNIT_NPC_FLAG_TRANSMOGRIFIER", "transmogrification", "" };
case UNIT_NPC_FLAG_VAULTKEEPER: return { "UNIT_NPC_FLAG_VAULTKEEPER", "is void storage", "" };
case UNIT_NPC_FLAG_WILD_BATTLE_PET: return { "UNIT_NPC_FLAG_WILD_BATTLE_PET", "is wild battle pet", "Pet that player can fight (Battle Pet)" };
case UNIT_NPC_FLAG_BLACK_MARKET: return { "UNIT_NPC_FLAG_BLACK_MARKET", "is black market", "" };
default: throw std::out_of_range("value");
}
}
template <>
TC_API_EXPORT size_t EnumUtils<NPCFlags>::Count() { return 33; }
template <>
TC_API_EXPORT NPCFlags EnumUtils<NPCFlags>::FromIndex(size_t index)
{
switch (index)
{
case 0: return UNIT_NPC_FLAG_NONE;
case 1: return UNIT_NPC_FLAG_GOSSIP;
case 2: return UNIT_NPC_FLAG_QUESTGIVER;
case 3: return UNIT_NPC_FLAG_UNK1;
case 4: return UNIT_NPC_FLAG_UNK2;
case 5: return UNIT_NPC_FLAG_TRAINER;
case 6: return UNIT_NPC_FLAG_TRAINER_CLASS;
case 7: return UNIT_NPC_FLAG_TRAINER_PROFESSION;
case 8: return UNIT_NPC_FLAG_VENDOR;
case 9: return UNIT_NPC_FLAG_VENDOR_AMMO;
case 10: return UNIT_NPC_FLAG_VENDOR_FOOD;
case 11: return UNIT_NPC_FLAG_VENDOR_POISON;
case 12: return UNIT_NPC_FLAG_VENDOR_REAGENT;
case 13: return UNIT_NPC_FLAG_REPAIR;
case 14: return UNIT_NPC_FLAG_FLIGHTMASTER;
case 15: return UNIT_NPC_FLAG_SPIRITHEALER;
case 16: return UNIT_NPC_FLAG_SPIRITGUIDE;
case 17: return UNIT_NPC_FLAG_INNKEEPER;
case 18: return UNIT_NPC_FLAG_BANKER;
case 19: return UNIT_NPC_FLAG_PETITIONER;
case 20: return UNIT_NPC_FLAG_TABARDDESIGNER;
case 21: return UNIT_NPC_FLAG_BATTLEMASTER;
case 22: return UNIT_NPC_FLAG_AUCTIONEER;
case 23: return UNIT_NPC_FLAG_STABLEMASTER;
case 24: return UNIT_NPC_FLAG_GUILD_BANKER;
case 25: return UNIT_NPC_FLAG_SPELLCLICK;
case 26: return UNIT_NPC_FLAG_PLAYER_VEHICLE;
case 27: return UNIT_NPC_FLAG_MAILBOX;
case 28: return UNIT_NPC_FLAG_ARTIFACT_POWER_RESPEC;
case 29: return UNIT_NPC_FLAG_TRANSMOGRIFIER;
case 30: return UNIT_NPC_FLAG_VAULTKEEPER;
case 31: return UNIT_NPC_FLAG_WILD_BATTLE_PET;
case 32: return UNIT_NPC_FLAG_BLACK_MARKET;
default: throw std::out_of_range("index");
}
}
/***************************************************************\
|* data for enum 'NPCFlags2' in 'UnitDefines.h' auto-generated *|
\***************************************************************/
template <>
TC_API_EXPORT EnumText EnumUtils<NPCFlags2>::ToString(NPCFlags2 value)
{
switch (value)
{
case UNIT_NPC_FLAG_2_NONE: return { "UNIT_NPC_FLAG_2_NONE", "UNIT_NPC_FLAG_2_NONE", "" };
case UNIT_NPC_FLAG_2_ITEM_UPGRADE_MASTER: return { "UNIT_NPC_FLAG_2_ITEM_UPGRADE_MASTER", "is item upgrade", "" };
case UNIT_NPC_FLAG_2_GARRISON_ARCHITECT: return { "UNIT_NPC_FLAG_2_GARRISON_ARCHITECT", "is garrison architect", "garrison building placement UI" };
case UNIT_NPC_FLAG_2_STEERING: return { "UNIT_NPC_FLAG_2_STEERING", "is avoiding obstacles", "clientside pathfinding" };
case UNIT_NPC_FLAG_2_SHIPMENT_CRAFTER: return { "UNIT_NPC_FLAG_2_SHIPMENT_CRAFTER", "is shipment crafter", "garrison work orders" };
case UNIT_NPC_FLAG_2_GARRISON_MISSION_NPC: return { "UNIT_NPC_FLAG_2_GARRISON_MISSION_NPC", "is garrison mission", "" };
case UNIT_NPC_FLAG_2_TRADESKILL_NPC: return { "UNIT_NPC_FLAG_2_TRADESKILL_NPC", "is tradeskill", "crafting at npc" };
case UNIT_NPC_FLAG_2_BLACK_MARKET_VIEW: return { "UNIT_NPC_FLAG_2_BLACK_MARKET_VIEW", "is black market view", "only allows viewing black market auctions, no bidding" };
case UNIT_NPC_FLAG_2_GARRISON_TALENT_NPC: return { "UNIT_NPC_FLAG_2_GARRISON_TALENT_NPC", "is garrrison talent", "" };
case UNIT_NPC_FLAG_2_CONTRIBUTION_COLLECTOR: return { "UNIT_NPC_FLAG_2_CONTRIBUTION_COLLECTOR", "is contribution collector", "" };
case UNIT_NPC_FLAG_2_AZERITE_RESPEC: return { "UNIT_NPC_FLAG_2_AZERITE_RESPEC", "is azerite respec", "" };
case UNIT_NPC_FLAG_2_ISLANDS_QUEUE: return { "UNIT_NPC_FLAG_2_ISLANDS_QUEUE", "is islands queue", "" };
default: throw std::out_of_range("value");
}
}
template <>
TC_API_EXPORT size_t EnumUtils<NPCFlags2>::Count() { return 12; }
template <>
TC_API_EXPORT NPCFlags2 EnumUtils<NPCFlags2>::FromIndex(size_t index)
{
switch (index)
{
case 0: return UNIT_NPC_FLAG_2_NONE;
case 1: return UNIT_NPC_FLAG_2_ITEM_UPGRADE_MASTER;
case 2: return UNIT_NPC_FLAG_2_GARRISON_ARCHITECT;
case 3: return UNIT_NPC_FLAG_2_STEERING;
case 4: return UNIT_NPC_FLAG_2_SHIPMENT_CRAFTER;
case 5: return UNIT_NPC_FLAG_2_GARRISON_MISSION_NPC;
case 6: return UNIT_NPC_FLAG_2_TRADESKILL_NPC;
case 7: return UNIT_NPC_FLAG_2_BLACK_MARKET_VIEW;
case 8: return UNIT_NPC_FLAG_2_GARRISON_TALENT_NPC;
case 9: return UNIT_NPC_FLAG_2_CONTRIBUTION_COLLECTOR;
case 10: return UNIT_NPC_FLAG_2_AZERITE_RESPEC;
case 11: return UNIT_NPC_FLAG_2_ISLANDS_QUEUE;
default: throw std::out_of_range("index");
}
}
}
}

View File

@@ -20,6 +20,7 @@
#include "Define.h"
#include "DetourNavMesh.h"
#include "SmartEnum.h"
float const GROUND_HEIGHT_TOLERANCE = 0.05f; // Extra tolerance to z position to check if it is in air or on ground.
@@ -260,44 +261,46 @@ enum Stats : uint16
#define MAX_STATS 4
// EnumUtils: DESCRIBE THIS
enum Powers : int8
{
POWER_MANA = 0,
POWER_RAGE = 1,
POWER_FOCUS = 2,
POWER_ENERGY = 3,
POWER_COMBO_POINTS = 4,
POWER_RUNES = 5,
POWER_RUNIC_POWER = 6,
POWER_SOUL_SHARDS = 7,
POWER_LUNAR_POWER = 8,
POWER_HOLY_POWER = 9,
POWER_ALTERNATE_POWER = 10, // Used in some quests
POWER_MAELSTROM = 11,
POWER_CHI = 12,
POWER_INSANITY = 13,
POWER_BURNING_EMBERS = 14,
POWER_DEMONIC_FURY = 15,
POWER_ARCANE_CHARGES = 16,
POWER_FURY = 17,
POWER_PAIN = 18,
MAX_POWERS = 19,
POWER_ALL = 127, // default for class?
POWER_HEALTH = -2 // (-2 as signed value)
POWER_HEALTH = -2, // TITLE Health
POWER_MANA = 0, // TITLE Mana
POWER_RAGE = 1, // TITLE Rage
POWER_FOCUS = 2, // TITLE Focus
POWER_ENERGY = 3, // TITLE Energy
POWER_COMBO_POINTS = 4, // TITLE Combo Points
POWER_RUNES = 5, // TITLE Runes
POWER_RUNIC_POWER = 6, // TITLE Runic Power
POWER_SOUL_SHARDS = 7, // TITLE Soul Shards
POWER_LUNAR_POWER = 8, // TITLE Lunar Power
POWER_HOLY_POWER = 9, // TITLE Holy Power
POWER_ALTERNATE_POWER = 10, // TITLE Alternate
POWER_MAELSTROM = 11, // TITLE Maelstrom
POWER_CHI = 12, // TITLE Chi
POWER_INSANITY = 13, // TITLE Insanity
POWER_BURNING_EMBERS = 14, // TITLE Burning Embers (Obsolete)
POWER_DEMONIC_FURY = 15, // TITLE Demonic Fury (Obsolete)
POWER_ARCANE_CHARGES = 16, // TITLE Arcane Charges
POWER_FURY = 17, // TITLE Fury
POWER_PAIN = 18, // TITLE Pain
MAX_POWERS = 19, // SKIP
POWER_ALL = 127 // SKIP
};
#define MAX_POWERS_PER_CLASS 7
// EnumUtils: DESCRIBE THIS
enum SpellSchools : uint16
{
SPELL_SCHOOL_NORMAL = 0,
SPELL_SCHOOL_HOLY = 1,
SPELL_SCHOOL_FIRE = 2,
SPELL_SCHOOL_NATURE = 3,
SPELL_SCHOOL_FROST = 4,
SPELL_SCHOOL_SHADOW = 5,
SPELL_SCHOOL_ARCANE = 6,
MAX_SPELL_SCHOOL = 7
SPELL_SCHOOL_NORMAL = 0, // TITLE Physical
SPELL_SCHOOL_HOLY = 1, // TITLE Holy
SPELL_SCHOOL_FIRE = 2, // TITLE Fire
SPELL_SCHOOL_NATURE = 3, // TITLE Nature
SPELL_SCHOOL_FROST = 4, // TITLE Frost
SPELL_SCHOOL_SHADOW = 5, // TITLE Shadow
SPELL_SCHOOL_ARCANE = 6, // TITLE Arcane
MAX_SPELL_SCHOOL = 7 // SKIP
};
enum SpellSchoolMask : uint32
@@ -324,11 +327,16 @@ enum SpellSchoolMask : uint32
SPELL_SCHOOL_MASK_ALL = (SPELL_SCHOOL_MASK_NORMAL | SPELL_SCHOOL_MASK_MAGIC)
};
constexpr SpellSchoolMask GetMaskForSchool(SpellSchools school)
{
return SpellSchoolMask(1 << school);
}
inline SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
{
for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
if (mask & (1 << i))
return SpellSchools(i);
for (SpellSchools school : EnumUtils::Iterate<SpellSchools>())
if (mask & GetMaskForSchool(school))
return school;
return SPELL_SCHOOL_NORMAL;
}
@@ -386,6 +394,7 @@ uint32 constexpr QuestDifficultyColors[MAX_QUEST_DIFFICULTY] =
// Spell Attributes definitions
// ***********************************
// EnumUtils: DESCRIBE THIS
enum SpellAttr0
{
SPELL_ATTR0_UNK0 = 0x00000001, // 0
@@ -422,6 +431,7 @@ enum SpellAttr0
SPELL_ATTR0_CANT_CANCEL = 0x80000000 // 31 positive aura can't be canceled
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr1
{
SPELL_ATTR1_DISMISS_PET = 0x00000001, // 0 for spells without this flag client doesn't allow to summon pet if caster has a pet
@@ -458,6 +468,7 @@ enum SpellAttr1
SPELL_ATTR1_UNK31 = 0x80000000 // 31
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr2
{
SPELL_ATTR2_CAN_TARGET_DEAD = 0x00000001, // 0 can target dead unit or corpse
@@ -494,6 +505,7 @@ enum SpellAttr2
SPELL_ATTR2_FOOD_BUFF = 0x80000000 // 31 Food or Drink Buff (like Well Fed)
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr3
{
SPELL_ATTR3_UNK0 = 0x00000001, // 0
@@ -530,6 +542,7 @@ enum SpellAttr3
SPELL_ATTR3_UNK31 = 0x80000000 // 31
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr4
{
SPELL_ATTR4_IGNORE_RESISTANCES = 0x00000001, // 0 spells with this attribute will completely ignore the target's resistance (these spells can't be resisted)
@@ -566,6 +579,7 @@ enum SpellAttr4
SPELL_ATTR4_UNK31 = 0x80000000 // 31 Polymorph (chicken) 228 and Sonic Boom (38052, 38488)
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr5
{
SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING = 0x00000001, // 0 available casting channel spell when moving
@@ -602,6 +616,7 @@ enum SpellAttr5
SPELL_ATTR5_UNK31 = 0x80000000 // 31 Forces all nearby enemies to focus attacks caster
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr6
{
SPELL_ATTR6_DONT_DISPLAY_COOLDOWN = 0x00000001, // 0 client doesn't display cooldown in tooltip for these spells
@@ -638,6 +653,7 @@ enum SpellAttr6
SPELL_ATTR6_IGNORE_CATEGORY_COOLDOWN_MODS = 0x80000000 // 31 Spells with this attribute skip applying modifiers to category cooldowns
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr7
{
SPELL_ATTR7_UNK0 = 0x00000001, // 0 Shaman's new spells (Call of the ...), Feign Death.
@@ -674,6 +690,7 @@ enum SpellAttr7
SPELL_ATTR7_CLIENT_INDICATOR = 0x80000000
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr8
{
SPELL_ATTR8_CANT_MISS = 0x00000001, // 0
@@ -710,6 +727,7 @@ enum SpellAttr8
SPELL_ATTR8_ATTACK_IGNORE_IMMUNE_TO_PC_FLAG = 0x80000000 // 31 Do not check UNIT_FLAG_IMMUNE_TO_PC in IsValidAttackTarget
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr9
{
SPELL_ATTR9_UNK0 = 0x00000001, // 0
@@ -746,6 +764,7 @@ enum SpellAttr9
SPELL_ATTR9_UNK31 = 0x80000000 // 31
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr10
{
SPELL_ATTR10_UNK0 = 0x00000001, // 0
@@ -782,6 +801,7 @@ enum SpellAttr10
SPELL_ATTR10_UNK31 = 0x80000000 // 31
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr11
{
SPELL_ATTR11_UNK0 = 0x00000001, // 0
@@ -818,6 +838,7 @@ enum SpellAttr11
SPELL_ATTR11_UNK31 = 0x80000000 // 31
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr12
{
SPELL_ATTR12_UNK0 = 0x00000001, // 0
@@ -854,6 +875,7 @@ enum SpellAttr12
SPELL_ATTR12_UNK31 = 0x80000000 // 31
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr13
{
SPELL_ATTR13_UNK0 = 0x00000001, // 0
@@ -890,6 +912,7 @@ enum SpellAttr13
SPELL_ATTR13_UNK31 = 0x80000000 // 31
};
// EnumUtils: DESCRIBE THIS
enum SpellAttr14
{
SPELL_ATTR14_UNK0 = 0x00000001, // 0
@@ -2388,6 +2411,7 @@ enum AuraStateType
(1<<(AURA_STATE_RAID_ENCOUNTER_2-1))|(1<<(AURA_STATE_ROGUE_POISONED-1)))
// Spell mechanics
// EnumUtils: DESCRIBE THIS
enum Mechanics : uint32
{
MECHANIC_NONE = 0,
@@ -2423,7 +2447,7 @@ enum Mechanics : uint32
MECHANIC_SAPPED = 30,
MECHANIC_ENRAGED = 31,
MECHANIC_WOUNDED = 32,
MAX_MECHANIC = 33
MAX_MECHANIC = 33 // SKIP
};
// Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967ca6)
@@ -2653,19 +2677,22 @@ enum SpellHitType
SPELL_HIT_TYPE_NO_ATTACKER = 0x80, // does the same as SPELL_ATTR4_COMBAT_LOG_NO_CASTER
};
// EnumUtils: DESCRIBE THIS
enum SpellDmgClass
{
SPELL_DAMAGE_CLASS_NONE = 0,
SPELL_DAMAGE_CLASS_MAGIC = 1,
SPELL_DAMAGE_CLASS_MELEE = 2,
SPELL_DAMAGE_CLASS_RANGED = 3
SPELL_DAMAGE_CLASS_NONE = 0, // TITLE None
SPELL_DAMAGE_CLASS_MAGIC = 1, // TITLE Magic
SPELL_DAMAGE_CLASS_MELEE = 2, // TITLE Melee
SPELL_DAMAGE_CLASS_RANGED = 3 // TITLE Ranged
};
// EnumUtils: DESCRIBE THIS
enum SpellPreventionType
{
SPELL_PREVENTION_TYPE_SILENCE = 1,
SPELL_PREVENTION_TYPE_PACIFY = 2,
SPELL_PREVENTION_TYPE_NO_ACTIONS = 4
SPELL_PREVENTION_TYPE_NONE = 0, // TITLE None
SPELL_PREVENTION_TYPE_SILENCE = 1, // TITLE Silence
SPELL_PREVENTION_TYPE_PACIFY = 2, // TITLE Pacify
SPELL_PREVENTION_TYPE_NO_ACTIONS = 4 // TITLE No actions
};
enum GameobjectTypes : uint8
@@ -5095,7 +5122,7 @@ enum QuestSort
QUEST_SORT_LEGENDARY_CRAFTING = 596
};
inline uint8 ClassByQuestSort(int32 QuestSort)
constexpr uint8 ClassByQuestSort(int32 QuestSort)
{
switch (QuestSort)
{
@@ -5452,7 +5479,7 @@ enum SkillType
SKILL_PET_CAMEL = 2807
};
inline SkillType SkillByLockType(LockType locktype)
constexpr SkillType SkillByLockType(LockType locktype)
{
switch (locktype)
{
@@ -5483,7 +5510,7 @@ inline SkillType SkillByLockType(LockType locktype)
return SKILL_NONE;
}
inline uint32 SkillByQuestSort(int32 QuestSort)
constexpr uint32 SkillByQuestSort(int32 QuestSort)
{
switch (QuestSort)
{
@@ -6112,26 +6139,27 @@ enum MailResponseResult
MAIL_ERR_ITEM_HAS_EXPIRED = 21
};
// EnumUtils: DESCRIBE THIS
enum SpellFamilyNames : uint8
{
SPELLFAMILY_GENERIC = 0,
SPELLFAMILY_EVENTS = 1, // events, holidays
SPELLFAMILY_GENERIC = 0, // TITLE Generic
SPELLFAMILY_UNK1 = 1, // TITLE Unk1 (events, holidays, ...)
// 2 - unused
SPELLFAMILY_MAGE = 3,
SPELLFAMILY_WARRIOR = 4,
SPELLFAMILY_WARLOCK = 5,
SPELLFAMILY_PRIEST = 6,
SPELLFAMILY_DRUID = 7,
SPELLFAMILY_ROGUE = 8,
SPELLFAMILY_HUNTER = 9,
SPELLFAMILY_PALADIN = 10,
SPELLFAMILY_SHAMAN = 11,
SPELLFAMILY_UNK12 = 12, // 2 spells (silence resistance)
SPELLFAMILY_POTION = 13,
SPELLFAMILY_MAGE = 3, // TITLE Mage
SPELLFAMILY_WARRIOR = 4, // TITLE Warrior
SPELLFAMILY_WARLOCK = 5, // TITLE Warlock
SPELLFAMILY_PRIEST = 6, // TITLE Priest
SPELLFAMILY_DRUID = 7, // TITLE Druid
SPELLFAMILY_ROGUE = 8, // TITLE Rogue
SPELLFAMILY_HUNTER = 9, // TITLE Hunter
SPELLFAMILY_PALADIN = 10, // TITLE Paladin
SPELLFAMILY_SHAMAN = 11, // TITLE Shaman
SPELLFAMILY_UNK2 = 12, // TITLE Unk2 (Silence resistance?)
SPELLFAMILY_POTION = 13, // TITLE Potion
// 14 - unused
SPELLFAMILY_DEATHKNIGHT = 15,
SPELLFAMILY_DEATHKNIGHT = 15, // TITLE Death Knight
// 16 - unused
SPELLFAMILY_PET = 17,
SPELLFAMILY_PET = 17, // TITLE Pet
SPELLFAMILY_TOTEMS = 50,
SPELLFAMILY_MONK = 53,
SPELLFAMILY_WARLOCK_PET = 57,

File diff suppressed because it is too large Load Diff

View File

@@ -41,180 +41,13 @@ EndScriptData */
#include "PhasingHandler.h"
#include "Player.h"
#include "RBAC.h"
#include "SmartEnum.h"
#include "Transport.h"
#include "World.h"
#include "WorldSession.h"
#include <boost/core/demangle.hpp>
#include <typeinfo>
template<typename E, typename T = char const*>
struct EnumName
{
E Value;
T Name;
};
#define CREATE_NAMED_ENUM(VALUE) { VALUE, STRINGIZE(VALUE) }
EnumName<NPCFlags, int32> const npcFlagTexts[] =
{
{ UNIT_NPC_FLAG_AUCTIONEER, LANG_NPCINFO_AUCTIONEER },
{ UNIT_NPC_FLAG_BANKER, LANG_NPCINFO_BANKER },
{ UNIT_NPC_FLAG_BATTLEMASTER, LANG_NPCINFO_BATTLEMASTER },
{ UNIT_NPC_FLAG_FLIGHTMASTER, LANG_NPCINFO_FLIGHTMASTER },
{ UNIT_NPC_FLAG_GOSSIP, LANG_NPCINFO_GOSSIP },
{ UNIT_NPC_FLAG_GUILD_BANKER, LANG_NPCINFO_GUILD_BANKER },
{ UNIT_NPC_FLAG_INNKEEPER, LANG_NPCINFO_INNKEEPER },
{ UNIT_NPC_FLAG_PETITIONER, LANG_NPCINFO_PETITIONER },
{ UNIT_NPC_FLAG_PLAYER_VEHICLE, LANG_NPCINFO_PLAYER_VEHICLE },
{ UNIT_NPC_FLAG_QUESTGIVER, LANG_NPCINFO_QUESTGIVER },
{ UNIT_NPC_FLAG_REPAIR, LANG_NPCINFO_REPAIR },
{ UNIT_NPC_FLAG_SPELLCLICK, LANG_NPCINFO_SPELLCLICK },
{ UNIT_NPC_FLAG_SPIRITGUIDE, LANG_NPCINFO_SPIRITGUIDE },
{ UNIT_NPC_FLAG_SPIRITHEALER, LANG_NPCINFO_SPIRITHEALER },
{ UNIT_NPC_FLAG_STABLEMASTER, LANG_NPCINFO_STABLEMASTER },
{ UNIT_NPC_FLAG_TABARDDESIGNER, LANG_NPCINFO_TABARDDESIGNER },
{ UNIT_NPC_FLAG_TRAINER, LANG_NPCINFO_TRAINER },
{ UNIT_NPC_FLAG_TRAINER_CLASS, LANG_NPCINFO_TRAINER_CLASS },
{ UNIT_NPC_FLAG_TRAINER_PROFESSION, LANG_NPCINFO_TRAINER_PROFESSION },
{ UNIT_NPC_FLAG_VENDOR, LANG_NPCINFO_VENDOR },
{ UNIT_NPC_FLAG_VENDOR_AMMO, LANG_NPCINFO_VENDOR_AMMO },
{ UNIT_NPC_FLAG_VENDOR_FOOD, LANG_NPCINFO_VENDOR_FOOD },
{ UNIT_NPC_FLAG_VENDOR_POISON, LANG_NPCINFO_VENDOR_POISON },
{ UNIT_NPC_FLAG_VENDOR_REAGENT, LANG_NPCINFO_VENDOR_REAGENT }
};
uint32 const NPCFLAG_COUNT = std::extent<decltype(npcFlagTexts)>::value;
EnumName<Mechanics> const mechanicImmunes[MAX_MECHANIC] =
{
CREATE_NAMED_ENUM(MECHANIC_NONE),
CREATE_NAMED_ENUM(MECHANIC_CHARM),
CREATE_NAMED_ENUM(MECHANIC_DISORIENTED),
CREATE_NAMED_ENUM(MECHANIC_DISARM),
CREATE_NAMED_ENUM(MECHANIC_DISTRACT),
CREATE_NAMED_ENUM(MECHANIC_FEAR),
CREATE_NAMED_ENUM(MECHANIC_GRIP),
CREATE_NAMED_ENUM(MECHANIC_ROOT),
CREATE_NAMED_ENUM(MECHANIC_SLOW_ATTACK),
CREATE_NAMED_ENUM(MECHANIC_SILENCE),
CREATE_NAMED_ENUM(MECHANIC_SLEEP),
CREATE_NAMED_ENUM(MECHANIC_SNARE),
CREATE_NAMED_ENUM(MECHANIC_STUN),
CREATE_NAMED_ENUM(MECHANIC_FREEZE),
CREATE_NAMED_ENUM(MECHANIC_KNOCKOUT),
CREATE_NAMED_ENUM(MECHANIC_BLEED),
CREATE_NAMED_ENUM(MECHANIC_BANDAGE),
CREATE_NAMED_ENUM(MECHANIC_POLYMORPH),
CREATE_NAMED_ENUM(MECHANIC_BANISH),
CREATE_NAMED_ENUM(MECHANIC_SHIELD),
CREATE_NAMED_ENUM(MECHANIC_SHACKLE),
CREATE_NAMED_ENUM(MECHANIC_MOUNT),
CREATE_NAMED_ENUM(MECHANIC_INFECTED),
CREATE_NAMED_ENUM(MECHANIC_TURN),
CREATE_NAMED_ENUM(MECHANIC_HORROR),
CREATE_NAMED_ENUM(MECHANIC_INVULNERABILITY),
CREATE_NAMED_ENUM(MECHANIC_INTERRUPT),
CREATE_NAMED_ENUM(MECHANIC_DAZE),
CREATE_NAMED_ENUM(MECHANIC_DISCOVERY),
CREATE_NAMED_ENUM(MECHANIC_IMMUNE_SHIELD),
CREATE_NAMED_ENUM(MECHANIC_SAPPED),
CREATE_NAMED_ENUM(MECHANIC_ENRAGED),
CREATE_NAMED_ENUM(MECHANIC_WOUNDED)
};
EnumName<UnitFlags> const unitFlags[MAX_UNIT_FLAGS] =
{
CREATE_NAMED_ENUM(UNIT_FLAG_SERVER_CONTROLLED),
CREATE_NAMED_ENUM(UNIT_FLAG_NON_ATTACKABLE),
CREATE_NAMED_ENUM(UNIT_FLAG_REMOVE_CLIENT_CONTROL),
CREATE_NAMED_ENUM(UNIT_FLAG_PLAYER_CONTROLLED),
CREATE_NAMED_ENUM(UNIT_FLAG_RENAME),
CREATE_NAMED_ENUM(UNIT_FLAG_PREPARATION),
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_6),
CREATE_NAMED_ENUM(UNIT_FLAG_NOT_ATTACKABLE_1),
CREATE_NAMED_ENUM(UNIT_FLAG_IMMUNE_TO_PC),
CREATE_NAMED_ENUM(UNIT_FLAG_IMMUNE_TO_NPC),
CREATE_NAMED_ENUM(UNIT_FLAG_LOOTING),
CREATE_NAMED_ENUM(UNIT_FLAG_PET_IN_COMBAT),
CREATE_NAMED_ENUM(UNIT_FLAG_PVP),
CREATE_NAMED_ENUM(UNIT_FLAG_SILENCED),
CREATE_NAMED_ENUM(UNIT_FLAG_CANNOT_SWIM),
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_15),
CREATE_NAMED_ENUM(UNIT_FLAG_NON_ATTACKABLE_2),
CREATE_NAMED_ENUM(UNIT_FLAG_PACIFIED),
CREATE_NAMED_ENUM(UNIT_FLAG_STUNNED),
CREATE_NAMED_ENUM(UNIT_FLAG_IN_COMBAT),
CREATE_NAMED_ENUM(UNIT_FLAG_TAXI_FLIGHT),
CREATE_NAMED_ENUM(UNIT_FLAG_DISARMED),
CREATE_NAMED_ENUM(UNIT_FLAG_CONFUSED),
CREATE_NAMED_ENUM(UNIT_FLAG_FLEEING),
CREATE_NAMED_ENUM(UNIT_FLAG_POSSESSED),
CREATE_NAMED_ENUM(UNIT_FLAG_NOT_SELECTABLE),
CREATE_NAMED_ENUM(UNIT_FLAG_SKINNABLE),
CREATE_NAMED_ENUM(UNIT_FLAG_MOUNT),
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_28),
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_29),
CREATE_NAMED_ENUM(UNIT_FLAG_SHEATHE),
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_31)
};
EnumName<UnitFlags2> const unitFlags2[MAX_UNIT_FLAGS_2] =
{
CREATE_NAMED_ENUM(UNIT_FLAG2_FEIGN_DEATH),
CREATE_NAMED_ENUM(UNIT_FLAG2_UNK1),
CREATE_NAMED_ENUM(UNIT_FLAG2_IGNORE_REPUTATION),
CREATE_NAMED_ENUM(UNIT_FLAG2_COMPREHEND_LANG),
CREATE_NAMED_ENUM(UNIT_FLAG2_MIRROR_IMAGE),
CREATE_NAMED_ENUM(UNIT_FLAG2_INSTANTLY_APPEAR_MODEL),
CREATE_NAMED_ENUM(UNIT_FLAG2_FORCE_MOVEMENT),
CREATE_NAMED_ENUM(UNIT_FLAG2_DISARM_OFFHAND),
CREATE_NAMED_ENUM(UNIT_FLAG2_DISABLE_PRED_STATS),
CREATE_NAMED_ENUM(UNIT_FLAG2_DISARM_RANGED),
CREATE_NAMED_ENUM(UNIT_FLAG2_REGENERATE_POWER),
CREATE_NAMED_ENUM(UNIT_FLAG2_RESTRICT_PARTY_INTERACTION),
CREATE_NAMED_ENUM(UNIT_FLAG2_PREVENT_SPELL_CLICK),
CREATE_NAMED_ENUM(UNIT_FLAG2_ALLOW_ENEMY_INTERACT),
CREATE_NAMED_ENUM(UNIT_FLAG2_DISABLE_TURN),
CREATE_NAMED_ENUM(UNIT_FLAG2_UNK2),
CREATE_NAMED_ENUM(UNIT_FLAG2_PLAY_DEATH_ANIM),
CREATE_NAMED_ENUM(UNIT_FLAG2_ALLOW_CHEAT_SPELLS),
CREATE_NAMED_ENUM(UNIT_FLAG2_NO_ACTIONS)
};
EnumName<UnitFlags3> const unitFlags3[MAX_UNIT_FLAGS_3] =
{
CREATE_NAMED_ENUM(UNIT_FLAG3_UNK1)
};
EnumName<CreatureFlagsExtra> const flagsExtra[] =
{
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_INSTANCE_BIND),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_CIVILIAN),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_PARRY),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_BLOCK),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_CRUSH),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_XP_AT_KILL),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_TRIGGER),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_TAUNT),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_SELL_VENDOR),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_WORLDEVENT),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_GUARD),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_CRIT),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_SKILLGAIN),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_TAUNT_DIMINISH),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_ALL_DIMINISH),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_DUNGEON_BOSS),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK),
CREATE_NAMED_ENUM(CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK)
};
uint32 const FLAGS_EXTRA_COUNT = std::extent<decltype(flagsExtra)>::value;
bool HandleNpcSpawnGroup(ChatHandler* handler, char const* args)
{
if (!*args)
@@ -849,19 +682,19 @@ public:
handler->PSendSysMessage(LANG_NPCINFO_MOVEMENT_DATA, target->GetMovementTemplate().ToString().c_str());
handler->PSendSysMessage(LANG_NPCINFO_UNIT_FIELD_FLAGS, *target->m_unitData->Flags);
for (uint8 i = 0; i < MAX_UNIT_FLAGS; ++i)
if (target->HasUnitFlag(unitFlags[i].Value))
handler->PSendSysMessage("%s (0x%X)", unitFlags[i].Name, unitFlags[i].Value);
for (UnitFlags flag : EnumUtils::Iterate<UnitFlags>())
if (target->HasUnitFlag(flag))
handler->PSendSysMessage("%s (0x%X)", EnumUtils::ToTitle(flag), flag);
handler->PSendSysMessage(LANG_NPCINFO_UNIT_FIELD_FLAGS_2, *target->m_unitData->Flags2);
for (uint8 i = 0; i < MAX_UNIT_FLAGS_2; ++i)
if (target->HasUnitFlag2(unitFlags2[i].Value))
handler->PSendSysMessage("%s (0x%X)", unitFlags2[i].Name, unitFlags2[i].Value);
for (UnitFlags2 flag : EnumUtils::Iterate<UnitFlags2>())
if (target->HasUnitFlag2(flag))
handler->PSendSysMessage("%s (0x%X)", EnumUtils::ToTitle(flag), flag);
handler->PSendSysMessage(LANG_NPCINFO_UNIT_FIELD_FLAGS_3, *target->m_unitData->Flags3);
for (uint8 i = 0; i < MAX_UNIT_FLAGS_3; ++i)
if (target->HasUnitFlag3(unitFlags3[i].Value))
handler->PSendSysMessage("%s (0x%X)", unitFlags3[i].Name, unitFlags3[i].Value);
for (UnitFlags3 flag : EnumUtils::Iterate<UnitFlags3>())
if (target->HasUnitFlag3(flag))
handler->PSendSysMessage("%s (0x%X)", EnumUtils::ToTitle(flag), flag);
handler->PSendSysMessage(LANG_NPCINFO_DYNAMIC_FLAGS, target->GetDynamicFlags());
handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str());
@@ -881,19 +714,23 @@ public:
if (CreatureAI const* ai = target->AI())
handler->PSendSysMessage(LANG_OBJECTINFO_AITYPE, boost::core::demangle(typeid(*ai).name()).c_str());
handler->PSendSysMessage(LANG_NPCINFO_FLAGS_EXTRA, cInfo->flags_extra);
for (uint8 i = 0; i < FLAGS_EXTRA_COUNT; ++i)
if (cInfo->flags_extra & flagsExtra[i].Value)
handler->PSendSysMessage("%s (0x%X)", flagsExtra[i].Name, flagsExtra[i].Value);
for (CreatureFlagsExtra flag : EnumUtils::Iterate<CreatureFlagsExtra>())
if (cInfo->flags_extra & flag)
handler->PSendSysMessage("%s (0x%X)", EnumUtils::ToTitle(flag), flag);
handler->PSendSysMessage(LANG_NPCINFO_NPC_FLAGS, target->m_unitData->NpcFlags[0]);
for (uint8 i = 0; i < NPCFLAG_COUNT; i++)
if (npcflags & npcFlagTexts[i].Value)
handler->PSendSysMessage(npcFlagTexts[i].Name, npcFlagTexts[i].Value);
for (NPCFlags flag : EnumUtils::Iterate<NPCFlags>())
if (target->HasNpcFlag(flag))
handler->PSendSysMessage("* %s (0x%X)", EnumUtils::ToTitle(flag), flag);
for (NPCFlags2 flag : EnumUtils::Iterate<NPCFlags2>())
if (target->HasNpcFlag2(flag))
handler->PSendSysMessage("* %s (0x%X)", EnumUtils::ToTitle(flag), flag);
handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, mechanicImmuneMask);
for (uint8 i = 1; i < MAX_MECHANIC; ++i)
if (mechanicImmuneMask & (1 << (mechanicImmunes[i].Value - 1)))
handler->PSendSysMessage("%s (0x%X)", mechanicImmunes[i].Name, mechanicImmunes[i].Value);
for (Mechanics m : EnumUtils::Iterate<Mechanics>())
if (m && (mechanicImmuneMask & (1 << (m - 1))))
handler->PSendSysMessage("%s (0x%X)", EnumUtils::ToTitle(m), m);
return true;
}