Core/Creatures: Implemented serverside checks for UNIT_FLAG2_INTERACT_WHILE_HOSTILE and UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT

* Also stop sending npc flags for hostile creatures
Port From (https://github.com/TrinityCore/TrinityCore/commit/c2e36dea6c6af6139bf60454e9299447ec7d9897)
This commit is contained in:
hondacrx
2024-03-05 18:16:38 -05:00
parent 0325d8b523
commit e646b8008d
8 changed files with 125 additions and 39 deletions
+12 -12
View File
@@ -131,26 +131,26 @@ namespace Framework.Constants
public enum UnitFlags3 : uint
{
Unk0 = 0x01,
UnconsciousOnDeath = 0x02, // Title Unconscious On Death Description Shows "Unconscious" In Unit Tooltip Instead Of "Dead"
AllowMountedCombat = 0x04, // Title Allow Mounted Combat
GarrisonPet = 0x08, // Title Garrison Pet Description Special Garrison Pet Creatures That Display One Of Favorite Player Battle Pets - This Flag Allows Querying Name And Turns Off Default Battle Pet Behavior
UiCanGetPosition = 0x10, // Title Ui Can Get Position Description Allows Lua Functions Like Unitposition To Always Get The Position Even For Npcs Or Non-Grouped Players
UnconsciousOnDeath = 0x02, // Description Shows "Unconscious" In Unit Tooltip Instead Of "Dead"
AllowMountedCombat = 0x04,
GarrisonPet = 0x08, // Special Garrison Pet Creatures That Display One Of Favorite Player Battle Pets - This Flag Allows Querying Name And Turns Off Default Battle Pet Behavior
UiCanGetPosition = 0x10, // Allows Lua Functions Like Unitposition To Always Get The Position Even For Npcs Or Non-Grouped Players
AiObstacle = 0x20,
AlternativeDefaultLanguage = 0x40,
SuppressAllNpcFeedback = 0x80, // Title Suppress All Npc Feedback Description Skips Playing Sounds On Left Clicking Npc For All Npcs As Long As Npc With This Flag Is Visible
IgnoreCombat = 0x100, // Title Ignore Combat Description Same As SpellAuraIgnoreCombat
SuppressNpcFeedback = 0x200, // Title Suppress Npc Feedback Description Skips Playing Sounds On Left Clicking Npc
SuppressAllNpcFeedback = 0x80, // Skips Playing Sounds On Left Clicking Npc For All Npcs As Long As Npc With This Flag Is Visible
IgnoreCombat = 0x100, // Same As SpellAuraIgnoreCombat
SuppressNpcFeedback = 0x200, // Skips Playing Sounds On Left Clicking Npc
Unk10 = 0x400,
Unk11 = 0x800,
Unk12 = 0x1000,
FakeDead = 0x2000, // Title Show As Dead
NoFacingOnInteractAndFastFacingChase = 0x4000, // Causes The Creature To Both Not Change Facing On Interaction And Speeds Up Smooth Facing Changes While Attacking (Clientside)
UntargetableFromUi = 0x8000, // Title Untargetable From Ui Description Cannot Be Targeted From Lua Functions Startattack, Targetunit, Petattack
UntargetableFromUi = 0x8000, // Cannot Be Targeted From Lua Functions Startattack, Targetunit, Petattack
NoFacingOnInteractWhileFakeDead = 0x10000, // Prevents Facing Changes While Interacting If Creature Has Flag FakeDead
AlreadySkinned = 0x20000,
SuppressAllNpcSounds = 0x40000, // Title Suppress All Npc Sounds Description Skips Playing Sounds On Beginning And End Of Npc Interaction For All Npcs As Long As Npc With This Flag Is Visible
SuppressNpcSounds = 0x80000, // Title Suppress Npc Sounds Description Skips Playing Sounds On Beginning And End Of Npc Interaction
Unk20 = 0x100000,
SuppressAllNpcSounds = 0x40000, // Skips Playing Sounds On Beginning And End Of Npc Interaction For All Npcs As Long As Npc With This Flag Is Visible
SuppressNpcSounds = 0x80000, // Skips Playing Sounds On Beginning And End Of Npc Interaction
AllowInteractionWhileInCombat = 0x100000, //Allows using various NPC functions while in combat (vendor, gossip, questgiver)
Unk21 = 0x200000,
DontFadeOut = 0x400000,
Unk23 = 0x800000,
@@ -168,7 +168,7 @@ namespace Framework.Constants
IgnoreCombat | SuppressNpcFeedback | Unk10 | Unk11 |
Unk12 | /* FakeDead | */ /* NoFacingOnInteractAndFastFacingChase | */ /* UntargetableFromUi | */
/* NoFacingOnInteractWhileFakeDead | */ AlreadySkinned | /* SuppressAllNpcSounds | */ /* SuppressNpcSounds | */
Unk20 | Unk21 | /* DontFadeOut | */ Unk23 |
AllowInteractionWhileInCombat | Unk21 | /* DontFadeOut | */ Unk23 |
ForceHideNameplate | Unk25 | Unk26 | Unk27 |
Unk28 | Unk29 | Unk30 | Unk31), // Skip
Allowed = (0xffffffff & ~Disallowed) // Skip