Started implementing retainers. Added a instanced retainer spawn. Documented retainer scripts.

This commit is contained in:
Filip Maj 2017-09-05 12:37:23 -04:00
parent b5054debea
commit f437b36f5a
19 changed files with 313 additions and 34 deletions

View file

@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FFXIVClassic_Map_Server.actors.chara.npc;
namespace FFXIVClassic_Map_Server.dataobjects
{
@ -96,13 +97,30 @@ namespace FFXIVClassic_Map_Server.dataobjects
//Remove missing actors
for (int i = 0; i < actorInstanceList.Count; i++)
{
if (!list.Contains(actorInstanceList[i]))
//Retainer Instance
if (actorInstanceList[i] is Retainer && playerActor.currentSpawnedRetainer == null)
{
QueuePacket(RemoveActorPacket.BuildPacket(actorInstanceList[i].actorId));
actorInstanceList.RemoveAt(i);
}
else if (!list.Contains(actorInstanceList[i]) && !(actorInstanceList[i] is Retainer))
{
QueuePacket(RemoveActorPacket.BuildPacket(actorInstanceList[i].actorId));
actorInstanceList.RemoveAt(i);
}
}
//Retainer Instance
if (playerActor.currentSpawnedRetainer != null && !playerActor.sentRetainerSpawn)
{
Actor actor = playerActor.currentSpawnedRetainer;
QueuePacket(actor.GetSpawnPackets(playerActor, 1));
QueuePacket(actor.GetInitPackets());
QueuePacket(actor.GetSetEventStatusPackets());
actorInstanceList.Add(actor);
playerActor.sentRetainerSpawn = true;
}
//Add new actors or move
for (int i = 0; i < list.Count; i++)
{