mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
Got retainer meeting group working and cleaned up retainer instancing. Added a RemoveItemAtSlot with quantity.
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -135,7 +135,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
public uint homepoint = 0;
|
||||
public byte homepointInn = 0;
|
||||
|
||||
//Instancing
|
||||
//Retainer
|
||||
RetainerMeetingRelationGroup retainerMeetingGroup = null;
|
||||
public Retainer currentSpawnedRetainer = null;
|
||||
public bool sentRetainerSpawn = false;
|
||||
|
||||
@@ -1742,30 +1743,30 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
chocoboAppearance = appearanceId;
|
||||
}
|
||||
|
||||
public bool SpawnMyRetainer(Npc bell, int retainerIndex)
|
||||
public Retainer SpawnMyRetainer(Npc bell, int retainerIndex)
|
||||
{
|
||||
Tuple<uint, uint, string> retainerData = Database.GetRetainer(this, retainerIndex);
|
||||
|
||||
ActorClass actorClass = Server.GetWorldManager().GetActorClass(retainerData.Item2);
|
||||
|
||||
if (actorClass == null)
|
||||
return false;
|
||||
return null;
|
||||
|
||||
float distance = (float)Math.Sqrt(((positionX - bell.positionX) * (positionX - bell.positionX)) + ((positionZ - bell.positionZ) * (positionZ - bell.positionZ)));
|
||||
float posX = bell.positionX - ((-1.0f * (bell.positionX - positionX)) / distance);
|
||||
float posZ = bell.positionZ - ((-1.0f * (bell.positionZ - positionZ)) / distance);
|
||||
|
||||
Retainer retainer = new Retainer(retainerData.Item1, retainerData.Item3, actorClass, this, posX, bell.positionY, positionZ, (float)Math.Atan2(positionX - posX, positionZ - posZ));
|
||||
Retainer retainer = new Retainer(retainerData.Item3, actorClass, this, posX, bell.positionY, positionZ, (float)Math.Atan2(positionX - posX, positionZ - posZ));
|
||||
|
||||
retainer.LoadEventConditions(actorClass.eventConditions);
|
||||
|
||||
//RetainerMeetingRelationGroup group = new RetainerMeetingRelationGroup(5555, this, retainer);
|
||||
//group.SendGroupPackets(playerSession);
|
||||
retainerMeetingGroup = new RetainerMeetingRelationGroup(5555, this, retainer);
|
||||
retainerMeetingGroup.SendGroupPackets(playerSession);
|
||||
|
||||
currentSpawnedRetainer = retainer;
|
||||
sentRetainerSpawn = false;
|
||||
|
||||
return true;
|
||||
return retainer;
|
||||
}
|
||||
|
||||
public void DespawnMyRetainer()
|
||||
@@ -1773,6 +1774,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
if (currentSpawnedRetainer != null)
|
||||
{
|
||||
currentSpawnedRetainer = null;
|
||||
retainerMeetingGroup.SendDeletePacket(playerSession);
|
||||
retainerMeetingGroup = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user