动态 PVP 通过创建/删除区域管理器区域和相关的 PVE 插件排除映射,为混合 PVE/PVP 服务器提供 PVP 区域的自动管理。
重要提示
为了提高与所选 PVE 插件的兼容性,建议将其添加为硬依赖项DynamicPVP.cs。
例:
//Requires: TruePVE
//Requires: ZoneManager
using System;
事件类型
动态 PVP 可以自动管理以下类型事件的区域管理器区域的创建和删除以及相关 PVE 插件排除映射:
一般活动
这些是基于以下原版世界事件的动态 PVP 事件:
- 布拉德利 APC 死亡
- 巡逻直升机死亡
- 补给空投(定时空投)
- 供应信号(称为空投)
- 可破解的板条箱(支奴干 – 以及可选的货船和/或石油钻井平台 – 板条箱)
- 巨型挖掘机点火/激活
- 货船
纪念碑活动
这些是基于游戏或自定义地图定义的纪念碑的静态 PVP 事件。
纪念碑事件区域几何形状可以根据“防止建筑物”体积自动计算。
注意:动态PVP会自动将禁用的事件添加到原版纪念碑、火车隧道部分以及当前加载地图中任何命名纪念碑的配置文件中。
自定义事件
这些是用户定义的自动或定时事件,通过命令管理并在动态 PVP 的数据文件中配置。dynpvp
请在卸载插件后编辑数据文件,以免丢失更改。
PVP 延迟
动态 PVP 支持按事件配置 PVP 退出延迟(或简称“PVP 延迟”)。这是一种机制,使玩家在退出 PVP 区域后在配置的时间内被视为仍处于 PVP 状态,以防止他们在战斗中利用 PVE/PVP 区域边界。
从动态PVP 4.3.0开始,True PVE 2.2.3的API可用于实现PVP延迟,而不是内置的钩子处理程序。强烈建议这样做,因为允许 True PVE 执行所有伤害计算既更有效,又允许跨区域/由多个 PVP 插件创建的延迟来解决伤害规则。ExcludePlayerCanEntityTakeDamage
True PVE 支持可以在配置文件中显式激活,但当检测到 True PVE 2.2.3 并且在配置文件中启用所有 PVP 延迟伤害类型时,它也会自动激活。ExcludePlayer
权限
oxide.grant <user or group> <name or steam id> <permission>oxide.revoke <user or group> <name or steam id> <permission>dynamicpvp.admin— 允许玩家使用命令dynpvp
命令
dynpvp help或 — 查看帮助dynpvp hdynpvp add <eventName> [timed]— 创建自定义事件记录。如果指定,则将是一个定时事件timeddynpvp remove <eventName>— 删除自定义事件记录dynpvp start <eventName>— 启动自定义事件dynpvp stop <eventName>— 停止自定义事件dynpvp edit <eventName> true或 — 启用或禁用(分别)自动事件的自动启动状态dynpvp edit <eventName> falsedynpvp edit <eventName> move— 将自定义事件移动到您当前的位置dynpvp edit <eventName> <time>— 更改定时事件的持续时间(以秒为单位)dynpvp list— Display all custom eventsdynpvp show— Temporarily show geometries in-game for all active zones
Note: Geometries are shown for the commanding admin only. Duration can be changed in the config file.
Configuration
DynamicPVPconfigIMPORTANT NOTES
-
对于每个启用的事件,必须定义大于零的区域半径或区域大小。如果不这样做,区域创建将失败,并显示 4.3.0 的错误日志。半径优先于大小,因此如果要创建矩形框区域,请将半径设置为零。
-
玩家可见的圆顶只能为半径定义的“球体”区域创建。由大小定义的“盒子”区域没有圆顶。管理员可以通过命令可视化这两种区域。
/dynpvp show -
PVP 延迟标志:
ZonePlayersCanDamageDelayedPlayers— PVP 区域的玩家可以在 PVP 延迟中对玩家造成伤害DelayedPlayersCanDamageDelayedPlayers— 处于 PVP 延迟状态的玩家可以对 PVP 区域中的玩家造成伤害DelayedPlayersCanDamageZonePlayers— 处于 PVP 延迟状态的玩家可能会在 PVP 延迟中对玩家造成伤害
-
固定旋转:
- 这通常仅对具有箱形区域的纪念碑活动有用。如果 ,则该区域将相对于世界旋转;如果,它将相对于纪念碑旋转。通常,您需要将其设置为 ,因为无论其世界方向如何,盒子覆盖纪念碑通常是最重要的。
truefalsefalse
- 这通常仅对具有箱形区域的纪念碑活动有用。如果 ,则该区域将相对于世界旋转;如果,它将相对于纪念碑旋转。通常,您需要将其设置为 ,因为无论其世界方向如何,盒子覆盖纪念碑通常是最重要的。
示例配置文件
{
"Global Settings": {
"Enable Debug Mode": true,
"Log Debug To File": false,
"Compare Radius (Used to determine if it is a SupplySignal)": 50.0, // Used to distinguish whether supply drops originate from a Supply Signal or a timed drop
"If the entity has an owner, don't create a PVP zone": true, // "Entity" refers to the one that triggered the event, such as Bradley or Heli
"PVP Delay Flags": "ZonePlayersCanDamageDelayedPlayers, DelayedPlayersCanDamageZonePlayers, DelayedPlayersCanDamageDelayedPlayers"
},
"Chat Settings": {
"Command": "dynpvp",
"Chat Prefix": "[DynamicPVP]: ",
"Chat Prefix Color": "#00FFFF",
"Chat SteamID Icon": 0
},
"General Event Settings": {
"Bradley event settings": {
"Event Duration": 600.0,
"Enable Bots (Need BotSpawn Plugin)": false,
"BotSpawn Profile Name": "Bradley",
"Enable Event": true,
"Enable PVP Delay": true, // When a player leaves the area for a period of time, they can still be hurt by other players
"PVP Delay Time": 10.0,
"Enable Domes": true, // This will be ignored for cube zones
"Domes Darkness": 8,
"Delay In Starting Event": 0.0,
"Delay In Stopping Event": 0.0,
"TruePVE Mapping": "exclude", // Tells PVE plugin to exclude this from PVE rules, making it a PVP zone
"Transform Position": { // Move the position of the zone; use `dynpvp show` to see x/y/z for non-fixed rotation zones
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"Use Blacklist Commands (If false, a whitelist is used)": true,
"Command List (If there is a '/' at the front, it is a chat command)": [
"kill",
"/god"
],
"Dynamic pvp zone settings": {
"Zone Radius": 100.0, // Defines a spherical zone
"Zone Size": { // Defines a box zone if Zone Radius is zero, otherwise ignored
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"Zone Rotation": 0.0, // Box zone rotation
"Fixed Rotation": false,
"Zone Comfort": 0.0,
"Zone Radiation": 0.0,
"Zone Temperature": 0.0,
"Zone Radius": "100",
"Enter Message": "Entering a PVP area!",
"Leave Message": "Leaving a PVP area.",
"Eject Spawns": "",
"Permission Required To Enter Zone": "",
"Extra Zone Flags": [
"notp",
"undestr"
]
}
}
},
"Monument Event Settings": {
"Large Fishing Village": {
"Enable Event": false,
"Delay In Starting Event": 0.0,
"Delay In Stopping Event": 0.0,
"Holster Time On Enter (In seconds, or 0 to disable)": 0.0,
"Enable PVP Delay": false,
"PVP Delay Time": 10.0,
"TruePVE Mapping": "exclude",
"Use Blacklist Commands (If false, a whitelist is used)": true,
"Command works for PVP delayed players": false,
"Command List (If there is a '/' at the front, it is a chat command)": [],
"Enable Domes": true,
"Domes Darkness": 8,
"Dynamic PVP Zone Settings": {
"Zone Comfort": 0.0,
"Zone Radiation": 0.0,
"Zone Temperature": 0.0,
"Enable Safe Zone": false,
"Eject Spawns": "",
"Zone Parent ID": "",
"Enter Message": "Entering a PVP area!",
"Leave Message": "Leaving a PVP area.",
"Permission Required To Enter Zone": "",
"Extra Zone Flags": [],
"Zone Radius": 0.0,
"Zone Size": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"Zone Rotation": 0.0,
"Fixed Rotation": false,
"Auto-calculate zone geometry (overwrites existing values)": false // determines whether Zone Radius, Zone Size, Zone Rotation, Fixed Rotation, and Transform Position should be calculated automatically and overwritten
},
"Zone ID": "",
"Transform Position": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
}
}
钩
以下钩子用于与其他插件集成和/或为其他插件提供集成点。
PVE规则排除
void AddOrUpdateMapping(string zoneId, string mapping)
调用以请求PVE插件,以将通过指定的动态PVP区域ID映射到通过 指定的规则集。zoneIdmapping
void ExcludePlayer(ulong playerID, float pvpDelayTime, Oxide.Plugins.DynamicPVP)
当通过配置文件或自动感应激活对此功能的支持时,将调用该功能以请求 PVE 插件,以代表动态 PVP 在给定的时间内激活给定玩家 ID 的 PVE 规则排除(即 PVP 延迟状态)。
void RemoveMapping(string zoneId)
调用以请求PVE插件以删除通过 指定的Dyanmic PVP区域ID的规则集映射。zoneId
PVP 区域报告
void OnPlayerEnterPVP(BasePlayer player, string zoneId)
被调用报告给定玩家已进入具有给定区域 ID 的 Dyamic PVP 区域。
void OnPlayerExitPVP(BasePlayer player, string zoneId)
调用以报告给定玩家已使用给定区域 ID 退出动态 PVP 区域,并且不受 PVP 退出延迟的影响。
void OnPlayerExitPVP(BasePlayer player, string zoneId, float pvpDelaySeconds)
调用以报告给定玩家已使用给定区域 ID 退出动态 PVP 区域,并受到给定长度(以秒为单位)的 PVP 退出延迟的影响。
PVP 延迟报告
void OnPlayerAddedToPVPDelay(ulong playerID, string zoneId, float pvpDelayTime, BasePlayer player)
当给定玩家在进入给定动态PVP区域时激活PVP延迟时,在给定的时间(以秒为单位)内调用。
void OnPlayerRemovedFromPVPDelay(ulong playerId, string leftZoneId, BasePlayer player)
当给定玩家因离开给定区域ID而产生的PVP延迟到期或因进入另一个动态PVP区域而被移除时调用。
活动管理
object OnCreateDynamicPVP(string eventName, BaseEntity entity)
在即将创建动态PVP区域时调用。如果另一个插件返回非空值,则区域创建将中止。
void OnCreatedDynamicPVP(string zoneId, string eventName, Vector3 position, float duration)
在动态 PVP 区域创建完成后调用。
object OnDeleteDynamicPVP(string zoneId, string eventName)
当动态 PVP 区域即将被删除时调用。如果另一个插件返回非空值,则区域删除将中止。
void OnDeletedDynamicPVP(string zoneId, string eventName)
在动态 PVP 区域删除完成后调用。
BaseEvent OnGetBaseEvent(string eventName)
每当动态 PVP 想要获取命名事件的基本配置时调用。这允许插件提供自己的事件,由动态PVP管理。
应用程序接口
提供了以下方法,用于通过 Oxide 或 API 与其他插件集成。Interface.CallHook()DynamicPVP.Call()
string[] AllDynamicPVPZones()
返回一个字符串数组,其中包含所有活动动态 PVP 事件的区域管理器区域 ID。
bool IsDynamicPVPZone(string zoneID)
如果给定的区域管理器区域 ID 被动态 PVP 识别为它正在管理的区域 ID,则返回,否则返回 。truefalse
bool EventDataExists(string eventName)
如果动态 PVP 的数据记录中存在具有给定名称的自动/定时自定义事件,则返回,否则返回 。truefalse
bool IsPlayerInPVPDelay(ulong playerID)
如果动态PVP当前正在跟踪给定玩家的PVP延迟状态,则返回,否则返回 。truefalse
string GetPlayerPVPDelayedZoneID(ulong playerId)
如果给定玩家具有动态 PVP 跟踪的 PVP 延迟状态,则返回玩家离开的区域的区域管理器区域 ID,以触发延迟;否则返回 。null
string GetEventName(string zoneId)
如果给定的区域管理器区域 ID 被识别为动态 PVP 事件区域,则返回事件的名称;否则返回 。null
bool CreateOrUpdateEventData(string eventName, string eventData, bool isTimed = false)
根据给定的事件数据,创建/重新创建具有给定名称的自动(如果指定或未指定)或定时(如果是)自定义事件数据记录。自动事件将自动启动。返回一个布尔值,指示(重新)创建是否成功。 必须包含事件对象的 JSON 定义,具体取决于 的值:isTimedfalseisTimedtrueAutoStart=trueeventDataisTimed
false— 必须包含一个对象AutoEventtrue— 必须包含一个对象TimedEvent
bool CreateEventData(string eventName, Vector3 position, bool isTimed)
在给定位置使用默认配置创建具有给定名称的自动(如果是)或定时(如果是)自定义事件数据记录。不自动启动事件。如果返回(即,如果自定义事件数据记录已存在 ),则返回 ,否则返回 。isTimedfalseisTimedtruefalseEventDataExists(eventName)trueeventNametrue
bool RemoveEventData(string eventName, bool forceClose = true)
删除给定自定义事件的数据记录。调用以处理删除已启动事件的数据的情况,除非指定了值 。如果返回,则返回(即,如果不存在 的自定义事件数据记录)。ForceCloseZones(eventName)forceClosefalsefalseEventDataExists(eventName)falseeventName
bool StartEvent(string eventName, Vector3 position)
在给定位置启动给定的自定义事件名称。对于事件,可以是 ,在这种情况下,使用预配置的位置。如果返回(即,如果 不存在自定义事件数据记录),则返回 区域创建失败。AutoEventpositiondefaultfalseEventDataExists(eventName)falseeventName
bool StopEvent(string eventName)
如果 和 both 返回,则返回 ,否则返回 。trueEventDataExists(eventName)ForceCloseZones(eventName)truefalse
bool ForceCloseZones(string eventName)
删除与 关联的任何动态 PVP 区域,并返回是否发生关闭的布尔指示。eventName
bool IsUsingExcludePlayer()
如果由于配置或自动感应而使用 True PVE 2.2.3 PVP 延迟 API,则返回。trueExcludePlayer()
学分
- HunterZ:该插件的当前维护者。
- CatMeat:该插件的原作者。(感谢这个惊人的插件!
- Arainrr:以前的维护者。(谢谢你的辛勤工作)
- IIIaKa:钩子增强。
- sickness0666:皮套功能。
- WhiteThunder:自定义纪念碑“防止建筑物”对撞机检测。
- Nivex:在“防止建筑物”对撞机检测方面进行合作。

















暂无评论内容