Core/Loot: Move loot rolls from Group to Loot

Port From (https://github.com/TrinityCore/TrinityCore/commit/3ef5079feeedfdafc9d3c1d9f865e96dbc77ecc8)
This commit is contained in:
hondacrx
2022-09-18 17:57:08 -04:00
parent 0f77a9b27d
commit b76c9571d2
19 changed files with 803 additions and 932 deletions
+15 -13
View File
@@ -362,22 +362,14 @@ namespace Game
if (player.GetGUID() == loot.roundRobinPlayer)
{
loot.roundRobinPlayer.Clear();
Group group = player.GetGroup();
if (group)
{
if (group.GetLootMethod() != LootMethod.MasterLoot)
group.SendLooter(creature, null);
}
// force dynflag update to update looter and lootable info
creature.m_values.ModifyValue(creature.m_objectData).ModifyValue(creature.m_objectData.DynamicFlags);
creature.ForceUpdateFieldChange();
loot.NotifyLootList(creature.GetMap());
}
// force dynflag update to update looter and lootable info
creature.m_values.ModifyValue(creature.m_objectData).ModifyValue(creature.m_objectData.DynamicFlags);
creature.ForceUpdateFieldChange();
}
}
//Player is not looking at loot list, he doesn't need to see updates on the loot list
loot.RemoveLooter(player.GetGUID());
}
public void DoLootReleaseAll()
@@ -466,6 +458,16 @@ namespace Game
}
}
[WorldPacketHandler(ClientOpcodes.LootRoll)]
void HandleLootRoll(LootRollPacket packet)
{
LootRoll lootRoll = GetPlayer().GetLootRoll(packet.LootObj, (byte)(packet.LootListID - 1));
if (lootRoll == null)
return;
lootRoll.PlayerVote(GetPlayer(), packet.RollType);
}
[WorldPacketHandler(ClientOpcodes.SetLootSpecialization)]
void HandleSetLootSpecialization(SetLootSpecialization packet)
{