Upload from upload_mods.ps1

This commit is contained in:
Nathaniel Cosford
2025-06-04 16:44:53 +09:30
commit f1fbbe67bb
1722 changed files with 165268 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
using UnityEngine.Scripting;
[Preserve]
public class NetPackageAddCompanion : NetPackage
{
public NetPackageAddCompanion Setup(int _npcEntityID, int _ownerID)
{
this.npcEntityID = _npcEntityID;
this.ownerID = _ownerID;
return this;
}
public override void read(PooledBinaryReader _reader)
{
this.npcEntityID = _reader.ReadInt32();
this.ownerID = _reader.ReadInt32();
}
public override void write(PooledBinaryWriter _writer)
{
base.write(_writer);
_writer.Write(this.npcEntityID);
_writer.Write(this.ownerID);
}
public override void ProcessPackage(World _world, GameManager _callbacks)
{
//Log.Out("NetPackageAddCompanion-ProcessPackage 1");
if (_world == null || !_world.IsRemote())
{
//Log.Out("NetPackageAddCompanion-ProcessPackage 2");
return;
}
EntityNPCRebirth npc = _world.GetEntity(this.npcEntityID) as EntityNPCRebirth;
if (npc != null)
{
//Log.Out("NetPackageAddCompanion-ProcessPackage 3, ownerID: " + ownerID);
EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
if (primaryPlayer != null && ownerID == primaryPlayer.entityId)
{
//Log.Out("NetPackageAddCompanion-ProcessPackage 4");
npc.Buffs.SetCustomVar("$Leader", primaryPlayer.entityId);
npc.Buffs.SetCustomVar("$delayedPickup", 1f);
npc.LeaderUtils.AddCompanion();
}
}
}
public override int GetLength()
{
return 2;
}
private int npcEntityID;
private int ownerID;
}