Core/Creatures: Updated totem slot assignment logic

* Implemented SUMMON_SLOT_ANY_TOTEM
* Fixed showing totems on player frames
* Fixed removing totems from player frames
* Fixed being able to summon unlimited windfury totems
Port From (https://github.com/TrinityCore/TrinityCore/commit/fefc7192631764245396cd2622aa11f649411946)
This commit is contained in:
hondacrx
2023-09-14 03:27:06 -04:00
parent 0449c88951
commit 45c95d22ed
4 changed files with 80 additions and 17 deletions
+3 -2
View File
@@ -1892,7 +1892,7 @@ namespace Game.DataStorage
return _talentsByPosition[(int)class_][tier][column];
}
public bool IsTotemCategoryCompatibleWith(uint itemTotemCategoryId, uint requiredTotemCategoryId)
public bool IsTotemCategoryCompatibleWith(uint itemTotemCategoryId, uint requiredTotemCategoryId, bool requireAllTotems = true)
{
if (requiredTotemCategoryId == 0)
return true;
@@ -1909,7 +1909,8 @@ namespace Game.DataStorage
if (itemEntry.TotemCategoryType != reqEntry.TotemCategoryType)
return false;
return (itemEntry.TotemCategoryMask & reqEntry.TotemCategoryMask) == reqEntry.TotemCategoryMask;
int sharedMask = itemEntry.TotemCategoryMask & reqEntry.TotemCategoryMask;
return requireAllTotems ? sharedMask == reqEntry.TotemCategoryMask : sharedMask != 0;
}
public bool IsToyItem(uint toy)