Got retainer meeting group working and cleaned up retainer instancing. Added a RemoveItemAtSlot with quantity.

This commit is contained in:
Filip Maj
2017-09-09 10:54:40 -04:00
parent 5bec522c8e
commit 76f073d85f
4 changed files with 70 additions and 15 deletions

View File

@@ -230,6 +230,27 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
doRealign();
if (owner is Player)
SendUpdatePackets((Player)owner);
}
public void RemoveItemAtSlot(ushort slot, int quantity)
{
if (slot >= endOfListIndex)
return;
if (list[slot] != null)
{
list[slot].quantity -= quantity;
if (list[slot].quantity <= 0)
{
list[slot] = null;
doRealign();
}
isDirty[slot] = true;
if (owner is Player)
SendUpdatePackets((Player)owner);
}
}
public void ChangeDurability(uint slot, uint durabilityChange)
@@ -390,12 +411,14 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
Array.Clear(isDirty, 0, isDirty.Length);
player.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId));
player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode));
//Send Updated Slots
SendInventoryPackets(player, items);
//Send Remove packets for tail end
SendInventoryRemovePackets(player, slotsToRemove);
player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
player.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
}
#endregion