[L4D2] The Chosen One
Remove the old .cfg file if you decide to update
Description:
This plugin will work on any versus-based game or coop-based game (Supports Coop, Realism & Last Gnome On Earth). On every round start, the plugin will randomly select one survivor. If there are no players in the survivor team, the plugin will select the first or second bot. If there are, the plugin will select one randomly.
The selected survivor will become "The Chosen One" and will get additional Health.
What is the point of all this? If the survivor gets biled, the entire survivors team will get biled, if he gets damage, the entire survivor team gets damage, if the chosen one gets killed, the game ends inmediatly.
The survivors must protect the choosed survivor, or else the entire team will lose. This will enhance team work and will prevent rushes, because if the chosen one gets into trouble and dies, as mentioned above, the game will end.
Uses:
-You can use this plugin as a total new game mode, similar to CSS's VIP game mode.
-You can use this plugin as an anti-rush system.
Set up the CVARS to fit your needs
Penalties
When the chosen one dies:
-Explosion in radius: A powerful explosion will occur right where the chosen one died, and will push everything back. Will also burn special infected, in case they don't die. The command !boomboom will create an unexpected explosion, but use the command with care. One explosion might kill an entire team in seconds!
-Incap in radius: If the chosen one dies, all the survivors within the specified radius will get incaped or killed.
-Health Penalty: Will hurt the entire team with the specified damage.
-End Game: All survivors die instantly when the chosen one does.
When you get too far:
-Incap: Incapacitates the survivor if he is too far and ignores warnings
-Apply Damage: Keep inflicting damage to the survivor if he refuses to get near the chosen one.
-Freeze: Stops the movement of the survivor if he refuses to get near the chosen one after the specified warnings
-Kill: "I hate rushers! Kill 'em all!" Will kill the survivor.
CVARS:
Code:
// Allow the admins to select or change the chosen one by a command or trough the admin menu?
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_chosen_one_admin_select "1"
// How should the plugin announce itself? (0: DONT ANNOUNCE |1:CHAT| 2:HINT TEXT | 3:CENTER HINT TEXT)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "3.000000"
l4d2_chosen_one_advert "1"
// How should the plugin announce the chosen one to Infected? (0: DONT ANNOUNCE |1:CHAT| 2:HINT TEXT | 3:CENTER HINT TEXT | 4:INSTRUCTOR HINT)
// -
// Default: "4"
// Minimum: "0.000000"
// Maximum: "4.000000"
l4d2_chosen_one_advert_infected "4"
// How should the plugin announce the chosen one to Survivors? (0: DONT ANNOUNCE |1:CHAT| 2:HINT TEXT | 3:CENTER HINT TEXT | 4:INSTRUCTOR HINT)
// -
// Default: "4"
// Minimum: "0.000000"
// Maximum: "4.000000"
l4d2_chosen_one_advert_survivor "4"
// Attach players to the chosen one? If the get too far, they get a penalty
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_chosen_one_attach "1"
// How should the plugin war the player? (0: DONT WARN |1:CHAT| 2:HINT TEXT | 3:CENTER HINT TEXT)
// -
// Default: "4"
// Minimum: "0.000000"
// Maximum: "3.000000"
l4d2_chosen_one_attach_announce "4"
// Damage done to the player that is too far from the chosen one?
// -
// Default: "5"
// Minimum: "0.000000"
l4d2_chosen_one_attach_damage "5"
// If the damage penalty is choosed, interval between hits
// -
// Default: "5"
// Minimum: "0.000000"
l4d2_chosen_one_attach_damage_interval "5"
// Run the warnings timer if the player is incapacitated?
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_chosen_one_attach_incap "0"
// Infected to spawn in front of the player, specifiy separated by comas, but only 1 per class(smoker, smoker: is incorrect)
// -
// Default: "hunter"
l4d2_chosen_one_attach_infected "hunter"
// Interval between each warning?
// -
// Default: "5"
// Minimum: "0.000000"
l4d2_chosen_one_attach_interval "5"
// Penalty if the player ignore the warnings and still too far (0: INCAP | 1: APPLY DAMAGE | 2: FREEZE | 3: KILL | 4:SPAWN INFECTED IN FRONT)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "4.000000"
l4d2_chosen_one_attach_penalty "1"
// Maximum distance allowed between a player and the chosen one
// -
// Default: "3000"
l4d2_chosen_one_attach_radius "3000"
// Number of warnings before appling the penalty
// -
// Default: "5"
// Minimum: "0.000000"
l4d2_chosen_one_attach_warnings "5"
// Color of the chosen survivor? (1:RED | 2:BLUE | 3:GREEN| 4:BLACK | 5:INVISIBLE | 6:NORMAL)
// -
// Default: "6"
l4d2_chosen_one_color "6"
// Enable the plugin?
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_chosen_one_enable "1"
// Time in seconds to wait before ending game
// -
// Default: "0"
// Minimum: "0.000000"
l4d2_chosen_one_end_time "0"
// What should the plugin do if the chosen one gets friendly fired? (0: NOTHING | 1:HEAL HIM | 2:HEAL AND PUNISH AGRESSOR
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_chosen_one_friendly_fire "1"
// The chosen one will not deal any friendly fire to survivors
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_chosen_one_friendly_fire_disable "1"
// Percentage of the damage returned to the agressor?
// -
// Default: "100"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_chosen_one_friendly_fire_punish "100"
// Health of the chosen survivor?
// -
// Default: "150"
l4d2_chosen_one_health "150"
// Should the entire survivor team get damage if the chosen one does?
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_chosen_one_hurt_all "1"
// Chance of hurting the entire team if the chosen one gets hurt (1: 100% | 2: 50% and so on)
// -
// Default: "5"
// Minimum: "1.000000"
l4d2_chosen_one_hurt_all_chance "5"
// Percentage of the chosen one damage received by the rest of the team?
// -
// Default: "50"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_chosen_one_hurt_all_damage "50"
// What should happen with the team if the survivor dies? (0: EXPLOSION IN RADIUS| 1: END GAME| 2:HEALTH PENALTY |3:INCAP IN RADIUS)
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "3.000000"
l4d2_chosen_one_penalty "1"
// Health penalty for the survivors?
// -
// Default: "75"
l4d2_chosen_one_penalty_health "75"
// Power of the explosion, if activated
// -
// Default: "1500"
l4d2_chosen_one_power "1500"
// Radius value for explosion or incap
// -
// Default: "450"
l4d2_chosen_one_radius "450"
// If set to 1, the plugin will check if the chosen one commits suicide, and will re-choose a player without appling penalty
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_chosen_one_suicide "1"
// Should the entire survivor team get vomited (Shorter time) if the chosen one does?
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_chosen_one_vomit_all "1"
Admin Commands:
-"sm_selectchosen": Will change the chosen player into the given name.
-"sm_boomboom": Creates and explosion right under your feet.
-[DEV]"sm_spawnpack": Will spawn a pack of infected based on server convars
Installation:
-Put the l4d2_chosen_one.smx file on your sourcemod/plugins folder.
-Put the l4d2chosenone.txt file on your sourcemod/gamedata folder.
TO DO:
-Allow admins to change / select The Chosen One - Done
Known Bugs:
-Sometimes, for a still unknown reason (Working on that!), the survivors will get nearly 65000 HP or will be inmune to any attacks. To find out the problem, i need to test out in different game modes, so please be patient. Disable any health options provided to avoid this issue!
Changelog:
Code:
1.1.3
-Survivors shouln't insta die when the round starts.
1.1.2
-Added support for coop gamemode. If the survivors die, the chosen one stats will reset.
-Added ConVar to control the time before selecting a survivor.
1.1.1
-Fixed suicide checker problem.
-Fixed explosion graphics and also added Fire trace.
1.1
-Added the possibility to attach players to the chosen one, if they get too far, they will be warned and after that, punished.
-Added the option to disable friendly fire toward the chosen one, and from him too to prevent exploits ;)
-Added the option to disable penalty if the chosen survivor commits suicide. The plugin is able to detect if the player kills himself.
-Added some more stuff, check the .cfg file for more information!
-Fixed everyone dying at round starts.
1.0.1b
-Fixed 2 bugs
1.0.1a
-Fixed debug dialog being shown when debugging was disabled.
1.0.1
-Added a command and Admin Menu item to change the chosen one.
1.0.0
-Initial Release