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

@@ -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;
}
}