AutomaticPvPSwitch
Automatically switches player ability builds when entering PvP combat.
模組介紹 作者原文
AutomaticPvPSwitch
Server mod for V Rising. Automatically switches player ability builds when entering PvP combat.
How it works
Players save separate PvP and PvE ability builds. When a player enters PvP combat (detected via Buff_InCombat_PvPVampire), their abilities are automatically swapped to their saved PvP build. Players can manually switch back to PvE with.pve when Vampire PvP Combat debuff expires (Also has a 10s cooldown between manual switches).
Ability swaps use the VBloodAbilityUtilities.TryApplyVBloodAbility - this updates the ability bar, "spellbook" UI, network sync, and preserves cooldowns.
The switch back to PvE is not automatic - players must use.pve manually when they're ready. This avoids unwanted swaps mid-fight if the PvP buff briefly drops.
Saved slots
- Spell 1 (bar slot 5)
- Spell 2 (bar slot 6)
- Ultimate (bar slot 7)
- Travel/Veil (bar slot 2)
Commands
Player commands
| Command | Description |
|---|---|
|.pvp save | Save current abilities as PvP build |
|.pve save | Save current abilities as PvE build |
|.pvp | Switch to PvP build (blocked during PvP debuff, 10s cooldown) |
|.pve | Switch to PvE build (blocked during PvP debuff, 10s cooldown) |
|.pvp enable | Enable auto-switch for yourself (default) |
|.pvp disable | Disable auto-switch for yourself |
Admin commands
| Command | Description |
|---|---|
|.pvpswitch | Show global status |
|.pvpswitch enable | Enable the automatic switch to the PvP build, globally |
|.pvpswitch disable | Disable the automatic switch to the PvP build, globally (manual.pvp.pve still work) |
|.pvpswitch reset | Clear all saved builds for all players (use after a wipe) |
|.pvpswitch resetplayer | Clear a specific player's builds and remove their VBlood abilities |
Saved configs
- Player builds: BepInEx/config/AutomaticPvPSwitch/builds.json
- Global toggle: BepInEx/config/AutomaticPvPSwitch/global_enabled - if the file is absent, the automatic switch is enabled; a file containing 1 also means enabled; a file containing 0 means no automatic PvP switch.
Performance
- Event-driven: a HookDOTS prefix on BuffSystem_Spawn_Server reacts only to buffs spawned that tick, resolving the carrier via EntityOwner.Owner. No per-tick polling of players.
- Zero cost when no player has a PvP build saved (early-out).
- Zero allocation on ticks where no buff spawns.
- The only heavy work (applying a build) runs on the combat-entry event, not every tick.
Dependencies & credits
- BepInEx (required)
- HookDOTS by cheesasaurus (required)
- VampireCommandFramework by deca (required)
- KindredCommands by Odjit (not required)
License
AGPL-3.0.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: