diff options
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/Entities/Creature/CreatureData.h | 5 | ||||
| -rw-r--r-- | src/server/game/Entities/Creature/enuminfo_CreatureData.cpp | 108 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/UnitDefines.h | 55 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp | 184 |
4 files changed, 323 insertions, 29 deletions
diff --git a/src/server/game/Entities/Creature/CreatureData.h b/src/server/game/Entities/Creature/CreatureData.h index deca5580059..29100324590 100644 --- a/src/server/game/Entities/Creature/CreatureData.h +++ b/src/server/game/Entities/Creature/CreatureData.h @@ -30,6 +30,7 @@ struct ItemTemplate; +// EnumUtils: DESCRIBE THIS enum CreatureFlagsExtra : uint32 { CREATURE_FLAG_EXTRA_INSTANCE_BIND = 0x00000001, // creature kill bind instance with killer and killer's group @@ -68,9 +69,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 diff --git a/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp b/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp new file mode 100644 index 00000000000..3e9c0fdfa0b --- /dev/null +++ b/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "CreatureData.h" +#include "Define.h" +#include "SmartEnum.h" +#include <stdexcept> + +/*************************************************************************\ +|* data for enum 'CreatureFlagsExtra' in 'CreatureData.h' auto-generated *| +\*************************************************************************/ +template <> +TC_API_EXPORT EnumText Trinity::Impl::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 Trinity::Impl::EnumUtils<CreatureFlagsExtra>::Count() { return 32; } +template <> +TC_API_EXPORT CreatureFlagsExtra Trinity::Impl::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"); + } +} + diff --git a/src/server/game/Entities/Unit/UnitDefines.h b/src/server/game/Entities/Unit/UnitDefines.h index ce4ed98149d..a078bbd0cad 100644 --- a/src/server/game/Entities/Unit/UnitDefines.h +++ b/src/server/game/Entities/Unit/UnitDefines.h @@ -118,6 +118,7 @@ enum UnitRename : uint8 }; // 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 @@ -152,7 +153,6 @@ 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 = 33 }; // Value masks for UNIT_FIELD_FLAGS_2 @@ -179,36 +179,37 @@ enum UnitFlags2 : uint32 }; /// 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, // guessed, probably ok + UNIT_NPC_FLAG_NONE = 0x00000000, // SKIP + UNIT_NPC_FLAG_GOSSIP = 0x00000001, // TITLE has gossip menu DESCRIPTION 100% + UNIT_NPC_FLAG_QUESTGIVER = 0x00000002, // TITLE is quest giver DESCRIPTION guessed, probably ok 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, // cause client to send 997 opcode - UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click) - UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set - UNIT_NPC_FLAG_MAILBOX = 0x04000000 // + 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 cause client to send 997 opcode + UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // TITLE has spell click enabled DESCRIPTION cause client to send 1015 opcode (spell click) + 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 }; enum MovementFlags : uint32 diff --git a/src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp b/src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp new file mode 100644 index 00000000000..b1c1e6fa4b1 --- /dev/null +++ b/src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "UnitDefines.h" +#include "Define.h" +#include "SmartEnum.h" +#include <stdexcept> + +/***************************************************************\ +|* data for enum 'UnitFlags' in 'UnitDefines.h' auto-generated *| +\***************************************************************/ +template <> +TC_API_EXPORT EnumText Trinity::Impl::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 Trinity::Impl::EnumUtils<UnitFlags>::Count() { return 32; } +template <> +TC_API_EXPORT UnitFlags Trinity::Impl::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 'NPCFlags' in 'UnitDefines.h' auto-generated *| +\**************************************************************/ +template <> +TC_API_EXPORT EnumText Trinity::Impl::EnumUtils<NPCFlags>::ToString(NPCFlags value) +{ + switch (value) + { + 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", "guessed, probably ok"}; + 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", "cause client to send 997 opcode"}; + case UNIT_NPC_FLAG_SPELLCLICK: return {"UNIT_NPC_FLAG_SPELLCLICK", "has spell click enabled", "cause client to send 1015 opcode (spell click)"}; + 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", ""}; + default: throw std::out_of_range("value"); + } +} +template <> +TC_API_EXPORT size_t Trinity::Impl::EnumUtils<NPCFlags>::Count() { return 27; } +template <> +TC_API_EXPORT NPCFlags Trinity::Impl::EnumUtils<NPCFlags>::FromIndex(size_t index) +{ + switch (index) + { + case 0: return UNIT_NPC_FLAG_GOSSIP; + case 1: return UNIT_NPC_FLAG_QUESTGIVER; + case 2: return UNIT_NPC_FLAG_UNK1; + case 3: return UNIT_NPC_FLAG_UNK2; + case 4: return UNIT_NPC_FLAG_TRAINER; + case 5: return UNIT_NPC_FLAG_TRAINER_CLASS; + case 6: return UNIT_NPC_FLAG_TRAINER_PROFESSION; + case 7: return UNIT_NPC_FLAG_VENDOR; + case 8: return UNIT_NPC_FLAG_VENDOR_AMMO; + case 9: return UNIT_NPC_FLAG_VENDOR_FOOD; + case 10: return UNIT_NPC_FLAG_VENDOR_POISON; + case 11: return UNIT_NPC_FLAG_VENDOR_REAGENT; + case 12: return UNIT_NPC_FLAG_REPAIR; + case 13: return UNIT_NPC_FLAG_FLIGHTMASTER; + case 14: return UNIT_NPC_FLAG_SPIRITHEALER; + case 15: return UNIT_NPC_FLAG_SPIRITGUIDE; + case 16: return UNIT_NPC_FLAG_INNKEEPER; + case 17: return UNIT_NPC_FLAG_BANKER; + case 18: return UNIT_NPC_FLAG_PETITIONER; + case 19: return UNIT_NPC_FLAG_TABARDDESIGNER; + case 20: return UNIT_NPC_FLAG_BATTLEMASTER; + case 21: return UNIT_NPC_FLAG_AUCTIONEER; + case 22: return UNIT_NPC_FLAG_STABLEMASTER; + case 23: return UNIT_NPC_FLAG_GUILD_BANKER; + case 24: return UNIT_NPC_FLAG_SPELLCLICK; + case 25: return UNIT_NPC_FLAG_PLAYER_VEHICLE; + case 26: return UNIT_NPC_FLAG_MAILBOX; + default: throw std::out_of_range("index"); + } +} + |
