private void CmdMovePlayer(GameObject ply, int t) { if (ServerTime.CheckSynchronization(t) && base.GetComponent <CharacterClassManager>().curClass == 3 && Vector3.Distance(base.GetComponent <PlyMovementSync>().position, ply.transform.position) < 3f) { base.GetComponent <PlayerStats>().HurtPlayer(new PlayerStats.HitInfo(40f, "SCP:106", "SCP:106"), ply); this.CallRpcMovePlayer(ply); } }
private static bool Prefix(Scp106PlayerScript __instance, GameObject ply, int t) { try { if (!__instance._iawRateLimit.CanExecute(true)) { return(false); } if (ply == null) { return(false); } ReferenceHub hub = ReferenceHub.GetHub(ply); CharacterClassManager component = hub.characterClassManager; if (component == null) { return(false); } if (!ServerTime.CheckSynchronization(t) || !__instance.iAm106 || Vector3.Distance(__instance.GetComponent <PlayerMovementSync>().RealModelPosition, ply.transform.position) >= 3f || !component.IsHuman()) { return(false); } if (component.GodMode) { return(false); } if (component.Classes.SafeGet(component.CurClass).team == Team.SCP) { return(false); } __instance.GetComponent <CharacterClassManager>().RpcPlaceBlood(ply.transform.position, 1, 2f); if (Scp106PlayerScript._blastDoor.isClosed) { __instance.GetComponent <CharacterClassManager>().RpcPlaceBlood(ply.transform.position, 1, 2f); __instance.GetComponent <PlayerStats>().HurtPlayer( new PlayerStats.HitInfo(500f, __instance.GetComponent <NicknameSync>().MyNick + " (" + __instance.GetComponent <CharacterClassManager>().UserId + ")", DamageTypes.Scp106, __instance.GetComponent <QueryProcessor>().PlayerId), ply); } else { CharacterClassManager component3 = ply.GetComponent <CharacterClassManager>(); foreach (Scp079PlayerScript scp079PlayerScript in Scp079PlayerScript.instances) { Scp079Interactable.ZoneAndRoom otherRoom = ply.GetComponent <Scp079PlayerScript>().GetOtherRoom(); Scp079Interactable.InteractableType[] filter = new Scp079Interactable.InteractableType[] { Scp079Interactable.InteractableType.Door, Scp079Interactable.InteractableType.Light, Scp079Interactable.InteractableType.Lockdown, Scp079Interactable.InteractableType.Tesla, Scp079Interactable.InteractableType.ElevatorUse, }; bool flag = false; foreach (Scp079Interaction scp079Interaction in scp079PlayerScript.ReturnRecentHistory(12f, filter)) { foreach (Scp079Interactable.ZoneAndRoom zoneAndRoom in scp079Interaction.interactable .currentZonesAndRooms) { if (zoneAndRoom.currentZone == otherRoom.currentZone && zoneAndRoom.currentRoom == otherRoom.currentRoom) { flag = true; } } } if (flag) { scp079PlayerScript.RpcGainExp(ExpGainType.PocketAssist, component3.CurClass); } } var ev = new EnteringPocketDimensionEventArgs(API.Features.Player.Get(ply), Vector3.down * 1998.5f); Player.OnEnteringPocketDimension(ev); if (!ev.IsAllowed) { return(false); } ply.GetComponent <PlayerMovementSync>().OverridePosition(ev.Position, 0f, true); __instance.GetComponent <PlayerStats>().HurtPlayer( new PlayerStats.HitInfo(40f, __instance.GetComponent <NicknameSync>().MyNick + " (" + __instance.GetComponent <CharacterClassManager>().UserId + ")", DamageTypes.Scp106, __instance.GetComponent <QueryProcessor>().PlayerId), ply); } PlayerEffectsController effectsController = hub.playerEffectsController; effectsController.GetEffect <Corroding>().IsInPd = true; effectsController.EnableEffect <Corroding>(0.0f, false); return(false); } catch (Exception e) { Exiled.API.Features.Log.Error($"Exiled.Events.Patches.Events.Player.EnteringPocketDimension: {e}\n{e.StackTrace}"); return(true); } }
public static bool Prefix(Scp106PlayerScript __instance, GameObject ply, int t) { try { if (!__instance._iawRateLimit.CanExecute()) { return(false); } if (ply == null) { return(false); } var player = ply.GetPlayer(); var charClassManager = player.ClassManager; if (charClassManager == null || charClassManager.GodMode || charClassManager.IsAnyScp()) { return(false); } if (!ServerTime.CheckSynchronization(t) || !__instance.iAm106 || Vector3.Distance(__instance.hub.playerMovementSync.RealModelPosition, ply.transform.position) >= 3f || !charClassManager.IsHuman()) { return(false); } if (Scp106PlayerScript._blastDoor.isClosed) { __instance.hub.characterClassManager.RpcPlaceBlood(ply.transform.position, 1, 2f); __instance.hub.playerStats.HurtPlayer( new PlayerStats.HitInfo(500f, $"{__instance.GetComponent<NicknameSync>().MyNick} ({__instance.hub.characterClassManager.UserId})", DamageTypes.Scp106, __instance.GetComponent <RemoteAdmin.QueryProcessor>().PlayerId), ply); } else { foreach (var scp079PlayerScript in Scp079PlayerScript.instances) { var otherRoom = ply.GetComponent <Scp079PlayerScript>().GetOtherRoom(); var filter = new[] { Scp079Interactable.InteractableType.Door, Scp079Interactable.InteractableType.Light, Scp079Interactable.InteractableType.Lockdown, Scp079Interactable.InteractableType.Tesla, Scp079Interactable.InteractableType.ElevatorUse }; var flag = false; foreach (var zoneAndRoom in from scp079Interaction in scp079PlayerScript.ReturnRecentHistory(12f, filter) from zoneAndRoom in scp079Interaction.interactable .currentZonesAndRooms where zoneAndRoom.currentZone == otherRoom.currentZone && zoneAndRoom.currentRoom == otherRoom.currentRoom select zoneAndRoom) { flag = true; } if (flag) { scp079PlayerScript.RpcGainExp(ExpGainType.PocketAssist, player.ClassManager.CurClass); } } } var canEnter = true; Events.InvokePocketDimensionEnterEvent(player, ref canEnter); if (!canEnter) { return(false); } __instance.hub.playerStats.HurtPlayer( new PlayerStats.HitInfo(40f, $"{__instance.GetComponent<NicknameSync>().MyNick} ({__instance.hub.characterClassManager.UserId})", DamageTypes.Scp106, __instance.GetComponent <RemoteAdmin.QueryProcessor>().PlayerId), ply); player.Position = Vector3.down * 1998.5f; player.EffectsController.GetEffect <Corroding>().IsInPd = true; player.EffectsController.EnableEffect <Corroding>(); return(false); } catch (Exception e) { Log.Error($"PocketDimEnter Err: {e}"); return(true); } }
private static bool Prefix(Scp106PlayerScript __instance, GameObject ply, int t) { try { if (!__instance._iawRateLimit.CanExecute(true) || ply == null) { return(false); } var scp = __instance.GetPlayer(); var player = ply.GetPlayer(); if (player == null || player.GodMode || !ServerTime.CheckSynchronization(t) || !__instance.iAm106 || Vector3.Distance(scp.Position, player.Position) >= 3f) { return(false); } if (!scp.WeaponManager.GetShootPermission(player.ClassManager)) { return(false); } EventHandler.Get.Scp.InvokeScpAttack(scp, player, Api.Enum.ScpAttackType.Scp106_Grab, out var allow); if (!allow) { return(false); } scp.ClassManager.RpcPlaceBlood(player.Position, 1, 2f); __instance.TargetHitMarker(scp.Connection); if (Scp106PlayerScript._blastDoor.isClosed) { player.Hurt(500, DamageTypes.Scp106, scp); } else { player.Hurt(40, DamageTypes.Scp106, scp); player.Position = Vector3.down * 1998.5f; foreach (var scp079 in Scp079PlayerScript.instances) { var room = player.ClassManager.Scp079.GetOtherRoom(); var filter = new Scp079Interactable.InteractableType[] { Scp079Interactable.InteractableType.Door, Scp079Interactable.InteractableType.Light, Scp079Interactable.InteractableType.Lockdown, Scp079Interactable.InteractableType.Tesla, Scp079Interactable.InteractableType.ElevatorUse, }; var flag = true; foreach (var interaction in scp079.ReturnRecentHistory(12f, filter)) { foreach (var zoneRoom in interaction.interactable.currentZonesAndRooms) { if (zoneRoom.currentZone == room.currentZone && zoneRoom.currentRoom == room.currentRoom) { flag = true; } } } if (flag) { scp079.RpcGainExp(ExpGainType.PocketAssist, player.RoleType); } } if (player.RoleType == RoleType.Spectator) { return(false); } EventHandler.Get.Scp.Scp106.InvokePocketDimensionEnterEvent(player, scp, ref allow); if (!allow) { return(false); } scp.Scp106Controller.PocketPlayers.Add(player); player.PlayerEffectsController.GetEffect <CustomPlayerEffects.Corroding>().IsInPd = true; player.GiveEffect(Api.Enum.Effect.Corroding); } return(false); } catch (Exception e) { Logger.Get.Error($"Synapse-Event: PocketDimEnter/ScpAttackEvent(106) failed!!\n{e}\nStackTrace:\n{e.StackTrace}"); return(true); } }
public static bool Prefix(Scp106PlayerScript __instance, GameObject ply, int t) { if (EventPlugin.Scp106PocketDimensionDamageEventPatchDisable) return true; try { if (!__instance._iawRateLimit.CanExecute(true)) return false; if (ply == null) return false; CharacterClassManager component = ply.GetComponent<CharacterClassManager>(); if (component == null) return false; if (!ServerTime.CheckSynchronization(t) || !__instance.iAm106 || Vector3.Distance(__instance.GetComponent<PlyMovementSync>().RealModelPosition, ply.transform.position) >= 3f || !component.IsHuman()) return false; CharacterClassManager component2 = ply.GetComponent<CharacterClassManager>(); if (component2.GodMode) return false; if (component2.Classes.SafeGet(component2.CurClass).team == Team.SCP) return false; __instance.GetComponent<CharacterClassManager>().RpcPlaceBlood(ply.transform.position, 1, 2f); if (Scp106PlayerScript.blastDoor.isClosed) { __instance.GetComponent<CharacterClassManager>().RpcPlaceBlood(ply.transform.position, 1, 2f); __instance.GetComponent<PlayerStats>().HurtPlayer( new PlayerStats.HitInfo(500f, __instance.GetComponent<NicknameSync>().MyNick + " (" + __instance.GetComponent<CharacterClassManager>().UserId + ")", DamageTypes.Scp106, __instance.GetComponent<QueryProcessor>().PlayerId), ply); } else { CharacterClassManager component3 = ply.GetComponent<CharacterClassManager>(); // 079 shit foreach (Scp079PlayerScript scp079PlayerScript in Scp079PlayerScript.instances) { Scp079Interactable.ZoneAndRoom otherRoom = ply.GetComponent<Scp079PlayerScript>().GetOtherRoom(); Scp079Interactable.InteractableType[] filter = new Scp079Interactable.InteractableType[] { Scp079Interactable.InteractableType.Door, Scp079Interactable.InteractableType.Light, Scp079Interactable.InteractableType.Lockdown, Scp079Interactable.InteractableType.Tesla, Scp079Interactable.InteractableType.ElevatorUse }; bool flag = false; foreach (Scp079Interaction scp079Interaction in scp079PlayerScript.ReturnRecentHistory(12f, filter)) { foreach (Scp079Interactable.ZoneAndRoom zoneAndRoom in scp079Interaction.interactable .currentZonesAndRooms) { if (zoneAndRoom.currentZone == otherRoom.currentZone && zoneAndRoom.currentRoom == otherRoom.currentRoom) { flag = true; } } } if (flag) { scp079PlayerScript.RpcGainExp(ExpGainType.PocketAssist, component3.CurClass); } } // Invoke enter bool allowEnter = true; Events.InvokePocketDimEnter(ply, ref allowEnter); if (!allowEnter) return false; ply.GetComponent<PlyMovementSync>().OverridePosition(Vector3.down * 1998.5f, 0f, true); // Invoke damage. bool allowDamage = true; Events.InvokePocketDimDamage(ply, ref allowDamage); if (allowDamage) __instance.GetComponent<PlayerStats>().HurtPlayer( new PlayerStats.HitInfo(40f, __instance.GetComponent<NicknameSync>().MyNick + " (" + __instance.GetComponent<CharacterClassManager>().UserId + ")", DamageTypes.Scp106, __instance.GetComponent<QueryProcessor>().PlayerId), ply); } PlayerEffectsController componentInParent = ply.GetComponentInParent<PlayerEffectsController>(); componentInParent.GetEffect<Corroding>("Corroding").isInPd = true; componentInParent.EnableEffect("Corroding"); return false; } catch (Exception exception) { Log.Error($"PocketDimDamageEvent error: {exception}"); return true; } }
private static bool Prefix(Scp106PlayerScript __instance, GameObject ply, int t) { try { if (!__instance._iawRateLimit.CanExecute(true) || ply == null) { return(false); } ReferenceHub hub = ReferenceHub.GetHub(ply); CharacterClassManager ccm = hub != null ? hub.characterClassManager : null; if (ccm == null) { return(false); } if (!ServerTime.CheckSynchronization(t) || !__instance.iAm106 || Vector3.Distance(hub.playerMovementSync.RealModelPosition, ply.transform.position) >= 3f || !ccm.IsHuman() || ccm.GodMode || ccm.CurRole.team == Team.SCP) { return(false); } Vector3 position = ply.transform.position; float num1 = Vector3.Distance(__instance._hub.playerMovementSync.RealModelPosition, position); float num2 = Math.Abs(__instance._hub.playerMovementSync.RealModelPosition.y - position.y); if ((num1 >= 1.8179999589920044 && num2 < 1.0199999809265137) || (num1 >= 2.0999999046325684 && num2 < 1.9500000476837158) || ((num1 >= 2.6500000953674316 && num2 < 2.200000047683716) || (num1 >= 3.200000047683716 && num2 < 3.0)) || num1 >= 3.640000104904175) { __instance._hub.characterClassManager.TargetConsolePrint(__instance.connectionToClient, $"106 MovePlayer command rejected - too big distance (code: T1). Distance: {num1}, Y Diff: {num2}.", "gray"); } else if (Physics.Linecast(__instance._hub.playerMovementSync.RealModelPosition, ply.transform.position, __instance._hub.weaponManager.raycastServerMask)) { __instance._hub.characterClassManager.TargetConsolePrint(__instance.connectionToClient, $"106 MovePlayer command rejected - collider found between you and the target (code: T2). Distance: {num1}, Y Diff: {num2}.", "gray"); } else { var instanceHub = ReferenceHub.GetHub(__instance.gameObject); instanceHub.characterClassManager.RpcPlaceBlood(ply.transform.position, 1, 2f); __instance.TargetHitMarker(__instance.connectionToClient, __instance.captureCooldown); if (Scp106PlayerScript._blastDoor.isClosed) { instanceHub.characterClassManager.RpcPlaceBlood(ply.transform.position, 1, 2f); instanceHub.playerStats.HurtPlayer(new PlayerStats.HitInfo(500f, instanceHub.LoggedNameFromRefHub(), DamageTypes.Scp106, instanceHub.playerId), ply); } else { Scp079Interactable.ZoneAndRoom otherRoom = hub.scp079PlayerScript.GetOtherRoom(); Scp079Interactable.InteractableType[] filter = new Scp079Interactable.InteractableType[] { Scp079Interactable.InteractableType.Door, Scp079Interactable.InteractableType.Light, Scp079Interactable.InteractableType.Lockdown, Scp079Interactable.InteractableType.Tesla, Scp079Interactable.InteractableType.ElevatorUse, }; foreach (Scp079PlayerScript scp079PlayerScript in Scp079PlayerScript.instances) { bool flag = false; foreach (Scp079Interaction scp079Interaction in scp079PlayerScript.ReturnRecentHistory(12f, filter)) { foreach (Scp079Interactable.ZoneAndRoom zoneAndRoom in scp079Interaction.interactable .currentZonesAndRooms) { if (zoneAndRoom.currentZone == otherRoom.currentZone && zoneAndRoom.currentRoom == otherRoom.currentRoom) { flag = true; } } } if (flag) { scp079PlayerScript.RpcGainExp(ExpGainType.PocketAssist, ccm.CurClass); } } var ev = new EnteringPocketDimensionEventArgs(API.Features.Player.Get(ply), Vector3.down * 1998.5f, API.Features.Player.Get(instanceHub)); Exiled.Events.Handlers.Player.OnEnteringPocketDimension(ev); if (!ev.IsAllowed) { return(false); } hub.playerMovementSync.OverridePosition(ev.Position, 0f, true); instanceHub.playerStats.HurtPlayer(new PlayerStats.HitInfo(40f, instanceHub.LoggedNameFromRefHub(), DamageTypes.Scp106, instanceHub.playerId), ply); } PlayerEffectsController effectsController = hub.playerEffectsController; effectsController.GetEffect <Corroding>().IsInPd = true; effectsController.EnableEffect <Corroding>(0.0f, false); } return(false); } catch (Exception e) { Exiled.API.Features.Log.Error($"{typeof(EnteringPocketDimension).FullName}:\n{e}"); return(true); } }
private static bool Prefix(Scp106PlayerScript __instance, GameObject ply, int t) { try { if (!__instance._iawRateLimit.CanExecute(true) || ply == null) { return(false); } ReferenceHub hub = ReferenceHub.GetHub(ply); CharacterClassManager ccm = hub != null ? hub.characterClassManager : null; if (ccm == null) { return(false); } if (!ServerTime.CheckSynchronization(t) || !__instance.iAm106 || Vector3.Distance(hub.playerMovementSync.RealModelPosition, ply.transform.position) >= 3f || !ccm.IsHuman() || ccm.GodMode || ccm.CurRole.team == Team.SCP) { return(false); } var instanceHub = ReferenceHub.GetHub(__instance.gameObject); instanceHub.characterClassManager.RpcPlaceBlood(ply.transform.position, 1, 2f); __instance.TargetHitMarker(__instance.connectionToClient); if (Scp106PlayerScript._blastDoor.isClosed) { instanceHub.characterClassManager.RpcPlaceBlood(ply.transform.position, 1, 2f); instanceHub.playerStats.HurtPlayer(new PlayerStats.HitInfo(500f, instanceHub.LoggedNameFromRefHub(), DamageTypes.Scp106, instanceHub.playerId), ply); } else { Scp079Interactable.ZoneAndRoom otherRoom = hub.scp079PlayerScript.GetOtherRoom(); Scp079Interactable.InteractableType[] filter = new Scp079Interactable.InteractableType[] { Scp079Interactable.InteractableType.Door, Scp079Interactable.InteractableType.Light, Scp079Interactable.InteractableType.Lockdown, Scp079Interactable.InteractableType.Tesla, Scp079Interactable.InteractableType.ElevatorUse, }; foreach (Scp079PlayerScript scp079PlayerScript in Scp079PlayerScript.instances) { bool flag = false; foreach (Scp079Interaction scp079Interaction in scp079PlayerScript.ReturnRecentHistory(12f, filter)) { foreach (Scp079Interactable.ZoneAndRoom zoneAndRoom in scp079Interaction.interactable .currentZonesAndRooms) { if (zoneAndRoom.currentZone == otherRoom.currentZone && zoneAndRoom.currentRoom == otherRoom.currentRoom) { flag = true; } } } if (flag) { scp079PlayerScript.RpcGainExp(ExpGainType.PocketAssist, ccm.CurClass); } } var ev = new EnteringPocketDimensionEventArgs(API.Features.Player.Get(ply), Vector3.down * 1998.5f, API.Features.Player.Get(instanceHub)); Player.OnEnteringPocketDimension(ev); if (!ev.IsAllowed) { return(false); } hub.playerMovementSync.OverridePosition(ev.Position, 0f, true); instanceHub.playerStats.HurtPlayer(new PlayerStats.HitInfo(40f, instanceHub.LoggedNameFromRefHub(), DamageTypes.Scp106, instanceHub.playerId), ply); } PlayerEffectsController effectsController = hub.playerEffectsController; effectsController.GetEffect <Corroding>().IsInPd = true; effectsController.EnableEffect <Corroding>(0.0f, false); return(false); } catch (Exception e) { Exiled.API.Features.Log.Error($"{typeof(EnteringPocketDimension).FullName}:\n{e}"); return(true); } }
private static bool MovePlayer(Scp106PlayerScript __instance, GameObject ply, int t) { try { if (!__instance._iawRateLimit.CanExecute(true) || ply == null || !__instance.iAm106) { return(false); } var scp = __instance.GetPlayer(); var player = ply.GetPlayer(); if (player == null || player.GodMode || !ServerTime.CheckSynchronization(t) || !player.ClassManager.IsHuman()) { return(false); } if (!SynapseExtensions.GetHarmPermission(scp, player)) { return(false); } var pos = player.Position; var num = Vector3.Distance(scp.Position, pos); var num2 = Math.Abs(scp.Position.y - pos.y); if ((num >= 1.818f && num2 < 1.02f) || (num >= 3.4f && num2 < 1.95f) || (num >= 3.7f && num2 < 2.2f) || (num >= 3.9f && num2 < 3f) || num >= 4.2f) { __instance._hub.characterClassManager.TargetConsolePrint(scp.Connection, string.Format("106 MovePlayer command rejected - too big distance (code: T1). Distance: {0}, Y Diff: {1}.", num, num2), "gray"); return(false); } if (Physics.Linecast(scp.Position, player.Position, MicroHIDItem.WallMask)) { __instance._hub.characterClassManager.TargetConsolePrint(scp.Connection, string.Format("106 MovePlayer command rejected - collider found between you and the target (code: T2). Distance: {0}, Y Diff: {1}.", num, num2), "gray"); return(false); } EventHandler.Get.Scp.InvokeScpAttack(scp, player, Api.Enum.ScpAttackType.Scp106_Grab, out var allow); if (!allow) { return(false); } scp.ClassManager.RpcPlaceBlood(player.Position, 1, 2f); __instance.TargetHitMarker(scp.Connection, __instance.captureCooldown); __instance._currentServerCooldown = __instance.captureCooldown; if (Scp106PlayerScript._blastDoor.isClosed) { __instance._hub.characterClassManager.RpcPlaceBlood(player.Position, 1, 2f); player.PlayerStats.DealDamage(new ScpDamageHandler(__instance._hub, PlayerStatsSystem.DeathTranslations.PocketDecay)); } else { EventHandler.Get.Scp.Scp106.InvokePocketDimensionEnterEvent(player, scp, ref allow); if (!allow) { return(false); } foreach (var script in Scp079PlayerScript.instances) { script.ServerProcessKillAssist(player.Hub, ExpGainType.PocketAssist); } player.Hub.scp106PlayerScript.GrabbedPosition = player.Hub.playerMovementSync.RealModelPosition; player.PlayerStats.DealDamage(new ScpDamageHandler(__instance._hub, 40f, PlayerStatsSystem.DeathTranslations.PocketDecay)); player.Position = Vector3.down * 1998.5f; scp.Scp106Controller.PocketPlayers.Add(player); } player.PlayerEffectsController.EnableEffect <CustomPlayerEffects.Corroding>(0f, false); return(false); } catch (Exception e) { Logger.Get.Error($"Synapse-Event: PocketDimEnter/ScpAttackEvent(106) failed!!\n{e}"); return(true); } }