// using System; using System.Collections.Generic; using static HiresManagerRebirth; public class MinEventActionNotifyTeamTeleportRebirth : MinEventActionTargetedBase { public override void Execute(MinEventParams _params) { var leader = _params.Self as EntityPlayer; if (leader == null) return; foreach (hireInfo hire in playerHires) { if (hire.playerID == leader.entityId && hire.order == 0) { EntityNPCRebirth entity = GameManager.Instance.World.GetEntity(hire.hireID) as EntityNPCRebirth; if (entity) { float flNPCRespawned = entity.Buffs.GetCustomVar("$FR_NPC_Respawn"); if (entity.IsDead() || flNPCRespawned == 1) continue; var distance = entity.GetDistance(leader); if (distance > 60) { entity.TeleportToPlayer(leader, true); } } } } } }