Upload from upload_mods.ps1
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// <triggered_effect trigger = "onSelfBuffUpdate" action="NotifyTeamTeleport, SCore" />
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user