Upload from upload_mods.ps1
This commit is contained in:
50
Scripts/MinEvents/MinEventActionDespawnEntity.cs
Normal file
50
Scripts/MinEvents/MinEventActionDespawnEntity.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
//using static RebirthManager;
|
||||
|
||||
public class MinEventActionDespawnEntity : MinEventActionTargetedBase
|
||||
{
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute START");
|
||||
EntityAlive entity = _params.Self as EntityAlive;
|
||||
if (entity == null)
|
||||
{
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity is EntityTurret)
|
||||
{
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute 2");
|
||||
EntityTurret entityTurret = (EntityTurret)entity;
|
||||
|
||||
entity.Buffs.SetCustomVar("$FR_Turret_Temp", 2f);
|
||||
entity.bWillRespawn = false;
|
||||
GameManager.Instance.World.RemoveEntity(entity.entityId, EnumRemoveEntityReason.Killed);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute 3");
|
||||
RebirthUtilities.DespawnEntity(entity);
|
||||
|
||||
/*entity.bIsChunkObserver = false;
|
||||
|
||||
if (entity is EntityNPCRebirth)
|
||||
{
|
||||
EntityNPCRebirth npc = (EntityNPCRebirth)entity;
|
||||
|
||||
if (npc != null && npc.LeaderUtils.Owner != null)
|
||||
{
|
||||
npc.LeaderUtils.Owner.Companions.Remove(npc);
|
||||
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute REMOVE HIRE/OWNED ENTITY, hire: " + npc.entityId);
|
||||
RebirthManager.RemoveHire(npc.entityId, true);
|
||||
}
|
||||
}
|
||||
|
||||
entity.bWillRespawn = false;
|
||||
GameManager.Instance.World.RemoveEntity(entity.entityId, EnumRemoveEntityReason.Despawned);*/
|
||||
}
|
||||
|
||||
//Log.Out("MinEventActionDespawnEntity-Execute 4");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user