Upload from upload_mods.ps1
This commit is contained in:
45
Scripts/Dialog/DialogActionDespawnEntityRebirth.cs
Normal file
45
Scripts/Dialog/DialogActionDespawnEntityRebirth.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
public class DialogActionDespawnEntityRebirth : DialogActionAddBuff
|
||||
{
|
||||
public override BaseDialogAction.ActionTypes ActionType => BaseDialogAction.ActionTypes.AddBuff;
|
||||
|
||||
public override void PerformAction(EntityPlayer player)
|
||||
{
|
||||
var entityId = -1;
|
||||
if (player.Buffs.HasCustomVar("CurrentNPC"))
|
||||
{
|
||||
//Log.Out("DialogActionDespawnEntityRebirth-PerformAction 1");
|
||||
entityId = (int)player.Buffs.GetCustomVar("CurrentNPC");
|
||||
}
|
||||
|
||||
if (entityId == -1)
|
||||
{
|
||||
//Log.Out("DialogActionDespawnEntityRebirth-PerformAction 2");
|
||||
return;
|
||||
}
|
||||
|
||||
var myEntity = GameManager.Instance.World.GetEntity(entityId) as EntityNPCRebirth;
|
||||
if (myEntity == null)
|
||||
{
|
||||
//Log.Out("DialogActionDespawnEntityRebirth-PerformAction 3");
|
||||
return;
|
||||
}
|
||||
|
||||
RebirthUtilities.DespawnEntity(myEntity);
|
||||
|
||||
/*player.Companions.Remove(myEntity);
|
||||
|
||||
if (!SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
||||
{
|
||||
//Log.Out("DialogActionDespawnEntityRebirth-PerformAction 5");
|
||||
SingletonMonoBehaviour<ConnectionManager>.Instance.SendToServer(NetPackageManager.GetPackage<NetPackageDespawnEntityRebirth>().Setup(myEntity.entityId), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("DialogActionDespawnEntityRebirth-PerformAction 6");
|
||||
////Log.Out("DialogActionDespawnEntityRebirth-PerformAction REMOVE HIRE/OWNED ENTITY, hire: " + myEntity.entityId);
|
||||
RebirthManager.RemoveHire(myEntity.entityId, true);
|
||||
myEntity.bWillRespawn = false;
|
||||
GameManager.Instance.World.RemoveEntity(myEntity.entityId, EnumRemoveEntityReason.Unloaded);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user