Files
zzz_REBIRTH__Utils/Scripts/Network/NetPackageRebirthUtilitiesSpawnEntityAdvanced.cs
2025-06-04 16:44:53 +09:30

218 lines
9.7 KiB
C#

public class NetPackageRebirthUtilitiesSpawnEntityAdvanced : NetPackage
{
public NetPackageRebirthUtilitiesSpawnEntityAdvanced Setup(int entityID,
string strEntity,
int numEntities = 1,
string entityPos = "",
string entityRot = "",
string strDistance = "",
string strSpawner = "dynamic",
string strHeight = "",
string strDirection = "",
float numStartScale = 1f,
int numRotation = -1,
bool randomRotation = false,
bool atPlayerLevel = false,
bool attackPlayer = true,
int entityPlayerID = -1,
int minion = -1,
string strSound = "",
int maxEntities = 20,
int checkMaxEntities = 0,
int minMax = 40,
int repeat = 1,
int allNames = 1,
int isBoss = -1,
int handParticle = -1,
string lootListName = "",
string lootDropClass = "",
int lootDropChance = 1,
string navIcon = "",
string buffList = "",
Boolean setRespawn = false
)
{
//Log.Out("NetPackageRebirthUtilitiesSpawnEntityAdvanced-Setup START");
this.entityID = entityID;
this.strEntity = strEntity;
this.numEntities = numEntities;
this.entityPos = entityPos;
this.entityRot = entityRot;
this.strDistance = strDistance;
this.strSpawner = strSpawner;
this.strHeight = strHeight;
this.strDirection = strDirection;
this.numStartScale = numStartScale;
this.numRotation = numRotation;
this.randomRotation = randomRotation;
this.atPlayerLevel = atPlayerLevel;
this.attackPlayer = attackPlayer;
this.entityPlayerID = entityPlayerID;
this.minion = minion;
this.strSound = strSound;
this.maxEntities = maxEntities;
this.checkMaxEntities = checkMaxEntities;
this.minMax = minMax;
this.repeat = repeat;
this.allNames = allNames;
this.isBoss = isBoss;
this.handParticle = handParticle;
this.lootListName = lootListName;
this.lootDropClass = lootDropClass;
this.lootDropChance = lootDropChance;
this.navIcon = navIcon;
this.buffList = buffList;
this.setRespawn = setRespawn;
return this;
}
public override void read(PooledBinaryReader _reader)
{
//Log.Out("NetPackageRebirthUtilitiesSpawnEntityAdvanced-read START");
this.entityID = _reader.ReadInt32();
this.strEntity = _reader.ReadString();
this.numEntities = _reader.ReadInt32();
this.entityPos = _reader.ReadString();
this.entityRot = _reader.ReadString();
this.strDistance = _reader.ReadString();
this.strSpawner = _reader.ReadString();
this.strHeight = _reader.ReadString();
this.strDirection = _reader.ReadString();
this.numStartScale = _reader.ReadSingle();
this.numRotation = _reader.ReadInt32();
this.randomRotation = _reader.ReadBoolean();
this.atPlayerLevel = _reader.ReadBoolean();
this.attackPlayer = _reader.ReadBoolean();
this.entityPlayerID = _reader.ReadInt32();
this.minion = _reader.ReadInt32();
this.strSound = _reader.ReadString();
this.maxEntities = _reader.ReadInt32();
this.checkMaxEntities = _reader.ReadInt32();
this.minMax = _reader.ReadInt32();
this.repeat = _reader.ReadInt32();
this.allNames = _reader.ReadInt32();
this.isBoss = _reader.ReadInt32();
this.handParticle = _reader.ReadInt32();
this.lootListName = _reader.ReadString();
this.lootDropClass = _reader.ReadString();
this.lootDropChance = _reader.ReadInt32();
this.navIcon = _reader.ReadString();
this.buffList = _reader.ReadString();
this.setRespawn = _reader.ReadBoolean();
}
public override void write(PooledBinaryWriter _writer)
{
//Log.Out("NetPackageRebirthUtilitiesSpawnEntityAdvanced-write START");
base.write(_writer);
_writer.Write(this.entityID);
_writer.Write(this.strEntity);
_writer.Write(this.numEntities);
_writer.Write(this.entityPos);
_writer.Write(this.entityRot);
_writer.Write(this.strDistance);
_writer.Write(this.strSpawner);
_writer.Write(this.strHeight);
_writer.Write(this.strDirection);
_writer.Write(this.numStartScale);
_writer.Write(this.numRotation);
_writer.Write(this.randomRotation);
_writer.Write(this.atPlayerLevel);
_writer.Write(this.attackPlayer);
_writer.Write(this.entityPlayerID);
_writer.Write(this.minion);
_writer.Write(this.strSound);
_writer.Write(this.maxEntities);
_writer.Write(this.checkMaxEntities);
_writer.Write(this.minMax);
_writer.Write(this.repeat);
_writer.Write(this.allNames);
_writer.Write(this.isBoss);
_writer.Write(this.handParticle);
_writer.Write(this.lootListName);
_writer.Write(this.lootDropClass);
_writer.Write(this.lootDropChance);
_writer.Write(this.navIcon);
_writer.Write(this.buffList);
_writer.Write(this.setRespawn);
}
public override void ProcessPackage(World _world, GameManager _callbacks)
{
//Log.Out("NetPackageRebirthUtilitiesSpawnEntityAdvanced-ProcessPackage START");
if (_world == null)
{
return;
}
RebirthUtilities.SpawnEntity(this.entityID,
strEntity,
numEntities,
entityPos,
entityRot,
strDistance,
strSpawner,
strHeight,
strDirection,
numStartScale,
numRotation,
randomRotation,
atPlayerLevel,
attackPlayer,
entityPlayerID,
minion,
strSound,
maxEntities,
checkMaxEntities,
minMax,
repeat,
allNames,
isBoss,
handParticle,
lootListName,
lootDropClass,
lootDropChance,
navIcon,
buffList,
setRespawn
);
}
public override int GetLength()
{
return 30;
}
private int entityID;
private string strEntity;
private int numEntities = 1;
private string strDistance = "";
private string entityPos = "";
private string entityRot = "";
private string strSpawner = "dynamic";
private string strHeight = "";
private string strDirection = "";
private float numStartScale = 1f;
private int numRotation = -1;
private bool randomRotation = true;
private bool atPlayerLevel = false;
private bool attackPlayer = true;
private int entityPlayerID = -1;
private int minion = -1;
private string strSound = "";
private int maxEntities = 20;
private int checkMaxEntities = 0;
private int minMax = 40;
private int repeat = 1;
private int allNames = 1;
private int isBoss = -1;
private int handParticle = -1;
private string lootListName = "";
private string lootDropClass = "";
private int lootDropChance = 1;
private string navIcon = "";
private string buffList = "";
private Boolean setRespawn = false;
}