/* * CSB Nemesis Mode * Copyright (C) 2026 counter-strike-boost.com * * A self-contained "Nemesis" boss round: with a configurable chance, one random * player is turned into a super-soldier boss with scaled-up HP, a red glow, * higher speed, knife only and heavy damage reduction. Everyone else has to gun * it down together; a HUD bar shows the Nemesis' remaining HP. This build does * NOT depend on any external zombie-mod core - it stands on its own. * * Inspired by the Nemesis round from Zombie Plague by MeRcyLeZZ. This is an * independent GPL re-implementation; no original code is reused. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) * any later version. It is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details: . */ #include #include #include #include new const PLUGIN[] = "CSB Nemesis Mode" new const VERSION[] = "1.0.0" new const AUTHOR[] = "counter-strike-boost.com" new bool:g_bNemesis[33] new g_iNemesis = 0 new g_iNemesisMaxHP = 0 new g_pEnabled, g_pChance, g_pHpPerPlayer, g_pHpBase, g_pSpeed, g_pReduction new g_iHudSync public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_pEnabled = register_cvar("csb_nemesis_enabled", "1") g_pChance = register_cvar("csb_nemesis_chance", "20") // percent chance per round g_pHpBase = register_cvar("csb_nemesis_hp_base", "2000") g_pHpPerPlayer = register_cvar("csb_nemesis_hp_perplayer", "800") g_pSpeed = register_cvar("csb_nemesis_speed", "320") g_pReduction = register_cvar("csb_nemesis_reduction", "0.35") // fraction of damage the boss actually takes RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage") RegisterHam(Ham_Killed, "player", "fwKilled", 1) register_event("HLTV", "eNewRound", "a", "1=0", "2=0") register_clcmd("csb_nemesis", "cmdForce", ADMIN_LEVEL_A, "- force a Nemesis round next spawn") g_iHudSync = CreateHudSyncObj() } public eNewRound() { clearNemesis() if (!get_pcvar_num(g_pEnabled)) return if (random_num(1, 100) <= get_pcvar_num(g_pChance)) set_task(2.0, "taskPickNemesis") } public cmdForce(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED set_task(0.5, "taskPickNemesis") client_print(id, print_chat, "[CSB] A Nemesis will be chosen now.") return PLUGIN_HANDLED } public taskPickNemesis() { new players[32], num get_players(players, num, "ah") // alive, humans (skip bots? include - "a" alive only) if (num < 2) return new pick = players[random_num(0, num - 1)] makeNemesis(pick, num) } makeNemesis(id, playerCount) { if (!is_user_alive(id)) return g_iNemesis = id g_bNemesis[id] = true new hp = get_pcvar_num(g_pHpBase) + get_pcvar_num(g_pHpPerPlayer) * (playerCount - 1) g_iNemesisMaxHP = hp set_user_health(id, hp) set_user_maxspeed(id, float(get_pcvar_num(g_pSpeed))) set_user_gravity(id, 0.85) set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 20) strip_user_weapons(id) give_item(id, "weapon_knife") new name[32] get_user_name(id, name, charsmax(name)) set_hudmessage(255, 0, 0, -1.0, 0.20, 2, 0.5, 4.0, 0.1, 0.2, -1) show_hudmessage(0, "### NEMESIS ROUND ###^n%s is the Nemesis - %d HP!^nGun it down!", name, hp) client_print(0, print_chat, "[CSB] %s became the NEMESIS (%d HP). Everyone else: kill it!", name, hp) set_task(0.5, "taskHpBar", 771, _, _, "b") } public taskHpBar() { if (!g_iNemesis || !is_user_alive(g_iNemesis)) { clearNemesis() return } new hp = get_user_health(g_iNemesis) new pct = g_iNemesisMaxHP ? (hp * 100) / g_iNemesisMaxHP : 0 new bar[24], filled = pct / 10 new i for (i = 0; i < filled && i < 10; i++) bar[i] = '|' for (; i < 10; i++) bar[i] = '.' bar[10] = 0 new name[32] get_user_name(g_iNemesis, name, charsmax(name)) set_hudmessage(255, 60, 60, 0.02, 0.15, 0, 0.0, 0.6, 0.0, 0.1, -1) ShowSyncHudMsg(0, g_iHudSync, "NEMESIS %s^n[%s] %d HP", name, bar, hp) } public fwTakeDamage(victim, inflictor, attacker, Float:damage, damagebits) { if (victim == g_iNemesis && g_bNemesis[victim]) { new Float:reduction = get_pcvar_float(g_pReduction) if (reduction < 0.0) reduction = 0.0 if (reduction > 1.0) reduction = 1.0 SetHamParamFloat(4, damage * reduction) } return HAM_IGNORED } public fwKilled(victim, attacker, shouldgib) { if (victim == g_iNemesis && g_bNemesis[victim]) { new aname[32] if (attacker >= 1 && attacker <= 32 && is_user_connected(attacker)) { get_user_name(attacker, aname, charsmax(aname)) client_print(0, print_chat, "[CSB] %s took down the Nemesis! Humans win the round.", aname) } else { client_print(0, print_chat, "[CSB] The Nemesis is down. Humans win the round.") } clearNemesis() } return HAM_IGNORED } public client_disconnected(id) { if (id == g_iNemesis) clearNemesis() g_bNemesis[id] = false } clearNemesis() { remove_task(771) if (g_iNemesis && is_user_connected(g_iNemesis)) { g_bNemesis[g_iNemesis] = false set_user_rendering(g_iNemesis, kRenderFxNone, 0, 0, 0, kRenderNormal, 0) } g_iNemesis = 0 g_iNemesisMaxHP = 0 }