Introduction
Dynamic PVP automatically manages creation and deletion of Zone Manager zones and corresponding PVE plugin ruleset mappings, for various events on your server. This allows you to turn a PVE server into a hybrid PVE/PVP server.The most common setup is to use a PVE plugin to make your entire server PVE by default, and then have Dynamic PVP create "exclusion" zones where the PVE plugin knows to not enforce its rules.
This means that Dynamic PVP requires Zone Manager, and in most cases a compatible PVE plugin such as True PVE.
IMPORTANT NOTE
For increased compatibility with your chosen PVE plugin, it is recommended to add it as a hard dependency in DynamicPVP.cs.Example:
Event Types
Dynamic PVP can automatically manage zones mappings for the following kinds of events:General Events
These are dynamic PVP events based on the following vanilla world events:- Bradley APC death
- Patrol Helicopter death
- Supply Drop (timed airdrops)
- Supply Signal (called airdrops)
- Hackable Crates (Chinook - and optionally Cargo Ship and/or Oil Rig - crates)
- Giant Excavator ignition/activation
- Cargo Ship
Monument events
These are static PVP events based on monuments defined by the game or custom maps.Monument event zone geometry can be automatically calculated based on "prevent building" volumes.
NOTE: Dynamic PVP will automatically add disabled events to the config file for vanilla monuments, Train Tunnel sections, and any named monuments from the currently loaded map.
Custom events
These are user-defined automatic or timed events managed via the dynpvp command and configured in Dynamic PVP's data file.Please edit the data file after unloading the plugin to avoid losing changes.
PVP Delays
Dynamic PVP supports per-event configuration of PVP exit delays (or "PVP delays" for short). This is a mechanism that causes players to be considered still in PVP status for a configured amount of time after exiting a PVP zone, in order to prevent them from exploiting PVE/PVP zone boundaries during a fight.As of Dynamic PVP 4.3.0, True PVE 2.2.3's ExcludePlayer API can be used to implement PVP delays instead of the built-in CanEntityTakeDamage hook handler. This is highly recommended because allowing True PVE to perform all damage calculations is both more efficient, and allows for damage rules to be resolved across zones/delays created by multiple PVP plugins.
True PVE ExcludePlayer support can be explicitly activated in the config file, but it will also activate automatically when True PVE 2.2.3 is detected and all PVP delay damage types are enabled in the config file.
Permissions
This plugin uses the permission system. To assign a permission, use oxide.grant <user or group> <name or steam id> <permission>. To remove a permission, use oxide.revoke <user or group> <name or steam id> <permission>.- dynamicpvp.admin -- Allows player to use dynpvp commands
Commands
This plugin provides both chat and console commands using the same syntax. When using a command in chat, prefix it with a forward slash: `/`.- dynpvp help or dynpvp h -- View help
- dynpvp add <eventName> [timed] -- Create custom event record. If timed is specified, it will be a timed event
- dynpvp remove <eventName> -- Remove custom event record
- dynpvp start <eventName> -- Start custom event
- dynpvp stop <eventName> -- Stop custom event
- dynpvp edit <eventName> true or dynpvp edit <eventName> false -- Enable or disable (respectively) auto-start state of auto event
- dynpvp edit <eventName> move -- Move custom event to your current location
- dynpvp edit <eventName> <time> -- Changes the duration (in seconds) of a timed event
- dynpvp list -- Display all custom events
- dynpvp show -- Temporarily show geometries in-game for all active zones
Configuration
The settings and options can be configured in the DynamicPVP file under the config directory. The use of an editor and validator is recommended to avoid formatting issues and syntax errors.IMPORTANT NOTES
- For each enabled event, you must define a Zone Radius or Zone Size that is greater than zero. If you do not do this, zone creation will fail with an error log as of 4.3.0. Radius takes precedence over size, so set radius to zero if you want to create a rectangular box zone.
- Player-visible domes can only be created for "sphere" zones defined by a radius. "Box" zones defined by a size have no domes. Admins can visualize both kinds of zones via the /dynpvp show command.
- PVP Delay flags:
- ZonePlayersCanDamageDelayedPlayers -- Players in PVP zone can damage players in PVP delay
- DelayedPlayersCanDamageDelayedPlayers -- Players in PVP delay can damage players in PVP zone
- DelayedPlayersCanDamageZonePlayers -- Players in PVP delay can damage players in PVP delay
- Fixed Rotation:
- This is generally only useful for monument events with box-shaped zones. If true, the zone will be rotated relative to the world; if false, it will be rotated relative to the monument. Generally you will want to set this to false since it's usually most important that the box cover the monument regardless of its world orientation.
Example Configuration File
Hooks
The following hooks are used to integrate with and/or provide integration points for other plugins.PVE rule exclusion
Called to request a PVE plugin to map the Dynamic PVP zone ID specified via zoneId to the ruleset specified via mapping.When support for this feature is active via config file or automatic sensing, it will be called to request a PVE plugin to activate PVE rule exclusion (i.e. PVP delay status) for the given player ID for the given amount of time, on behalf of Dynamic PVP.
Called to request a PVE plugin to remove the ruleset mapping for the Dyanmic PVP zone ID specified via zoneId.
PVP zone reporting
Called to report that the given player has entered a Dyamic PVP zone with the given zone ID.Called to report that the given player has exited a Dynamic PVP zone with the given zone ID, and is not subject to a PVP exit delay.
Called to report that the given player has exited a Dynamic PVP zone with the given zone ID, and is subject to a PVP exit delay of the given length in seconds.
PVP delay reporting
Called when a PVP delay is activated for the given player upon entering the given Dynamic PVP zone, for the given amount of time (in seconds).Called when the given player's PVP delay originating from leaving the given zone ID expires or is removed due to entering another Dynamic PVP zone.
Event management
Called when a Dynamic PVP zone is about to be created. If another plugin returns a non-null value, zone creation will be aborted.Called after a Dynamic PVP zone creation has completed.
Called when a Dynamic PVP zone is about to be deleted. If another plugin returns a non-null value, zone deletion will be aborted.
Called after a Dynamic PVP zone deletion has completed.
Called whenever Dynamic PVP wants to get the base configuration for the named event. This allows plugins to provide their own events to be managed by Dynamic PVP.
API
The following methods are provided for integration with other plugins via Oxide's Interface.CallHook() or DynamicPVP.Call() APIs.Returns an array of strings containing Zone Manager zone IDs for all active Dynamic PVP events.
Populates given list with Zone Manager zone IDs for all active Dynamic PVP events. This is an alternative to AllDynamicPVPZones() that avoids allocating a new array.
Returns true if the given Zone Manager zone ID is recognized by Dynamic PVP as one that it's managing, otherwise returns false.
Returns true if a auto/timed custom event with the given name exists in Dynamic PVP's data records, otherwise returns false.
Returns true if Dynamic PVP is currently tracking a PVP delay status for the given player, otherwise returns false.
If given player has a PVP delay status tracked by Dynamic PVP, returns the Zone Manager zone ID for the zone that the player left in order to trigger the delay; otherwise returns null.
If the given Zone Manager zone ID is recognized as a Dynamic PVP event zone, returns the name of the event; otherwise returns null.
Creates/recreates an auto (if isTimed is false or not specified) or timed (if isTimed is true) custom event data record with the given name, based on the given event data. Auto events with AutoStart=true will be auto-started. Returns a boolean indicating whether (re)creation was successful. eventData must contain a JSON definition of an event object depending on the value of isTimed:
- false -- must contain an AutoEvent object
- true -- must contain a TimedEvent object
Removes the given custom event's data record. Calls ForceCloseZones(eventName) to handle the case of removing data for a started event, unless a forceClose value of false is specified. Returns false if EventDataExists(eventName) returns false (i.e. if no custom event data record exists for eventName).
Starts the given custom event name, at the given location. For AutoEvent events, position can be default, in which case the preconfigured location is used. Returns false if EventDataExists(eventName) returns false (i.e. if no custom event data record exists for eventName), or if zone creation fails.
Returns true if EventDataExists(eventName) and ForceCloseZones(eventName) both return true, otherwise returns false.
Deletes any Dynamic PVP zone associated with eventName, and returns a boolean indication of whether a closure occurred.
Returns true if True PVE 2.2.3 ExcludePlayer() PVP delay API is being used, either due to configuration, or due to auto sensing.