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
+6 -2
View File
@@ -44,11 +44,15 @@ namespace Game.Entities
Player owner = GetOwner().ToPlayer();
if (owner)
{
if (m_Properties.Slot >= (int)SummonSlot.Totem && m_Properties.Slot < SharedConst.MaxTotemSlot)
int slot = m_Properties.Slot;
if (slot == (int)SummonSlot.Any)
slot = FindUsableTotemSlot(owner);
if (slot >= (int)SummonSlot.Totem && slot < SharedConst.MaxTotemSlot)
{
TotemCreated packet = new();
packet.Totem = GetGUID();
packet.Slot = (byte)(m_Properties.Slot - (int)SummonSlot.Totem);
packet.Slot = (byte)(slot - (int)SummonSlot.Totem);
packet.Duration = duration;
packet.SpellID = m_unitData.CreatedBySpell;
owner.ToPlayer().SendPacket(packet);