Code:
#!/bin/bash
#
# ZM to ZR configs of maps converter 1.0
# Copyright 2010 Darkthrone
#
# 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.
#
# This program 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# Requirements
# - GNU/Linux operating system
# - Zombie:Reloaded 3.0.0-b2-r635 or newer
# - ZombieMod 2.0.1 E or newer configs of maps
#
# How to run
# - configure the settings below
# - save this script as zm2zr-mapcfg-conv.sh
# - make it executable (chmod +x ./path/to/zm2zr-mapcfg-conv.sh)
# - run
#
#
# Settings
#
# full path to ZombieMod configs of maps
# default: "/home/user/srcds_l/orangebox/cstrike/cfg/zombiemod/"
zmpath="/home/user/srcds_l/orangebox/cstrike/cfg/zombiemod/"
# full path to Zombie:Reloaded configs of maps
# default: "/home/user/srcds_l/orangebox/cstrike/cfg/sourcemod/zombiereloaded/"
zrpath="/home/user/srcds_l/orangebox/cstrike/cfg/sourcemod/zombiereloaded/"
# maxplayers of your server (used to calculate count of first zombies)
# default: 24
maxplayers=24
# class of mother zombie (used to calculate double health of first zombie)
# default: "Mother zombie"
mzombie="Mother zombie"
# health of zombie (used to calculate double health of first zombie)
# default: 2500
zhealth=2500
#
# End of settings
#
cp "$zmpath"/*.cfg "$zrpath"
rm -f "$zrpath"/downloads.cfg
rm -f "$zrpath"/models.cfg
rm -f "$zrpath"/zombie_classes.cfg
rm -f "$zrpath"/zombiemod.cfg
tmp=/tmp/tmp.$$
tmpf=/tmp/tmpf.$$
for file in "$zrpath"/*.cfg
do
sed "s/ */ /g;s/\t/ /g;s/[ \t]*$//" "$file" > $tmp
mv $tmp "$file"
zmspeed=`grep "zombie_speed " "$file" | cut -d " " -f 2`
zrspeed=`echo "$zmspeed - 250.0;" | bc`
zmzcount=`grep "zombie_count " "$file" | cut -d " " -f 2`
zrzcount=`echo "$maxplayers / $zmzcount;" | bc`
zmzcountmin=`grep "zombie_count_min " "$file" | cut -d " " -f 2`
zmzcountmax=`grep "zombie_count_max " "$file" | cut -d " " -f 2`
zrzcountminmax=`echo "$maxplayers / (($zmzcountmin + $zmzcountmax) / 2);" | bc`
mzhealth=`echo "$zhealth * 2;" | bc`
zmchealth=`grep "zombie_health_percent " "$file" | cut -d " " -f 2`
zrchealth=`echo "scale=1; $zmchealth / 100;" | bc`
zmcspeed=`grep "zombie_speed_percent " "$file" | cut -d " " -f 2`
zrcspeed=`echo "scale=1; $zmcspeed / 100;" | bc`
zmcjumph=`grep "zombie_jump_height_percent " "$file" | cut -d " " -f 2`
zrcjumph=`echo "scale=1; $zmcjumph / 100;" | bc`
zmcknockb=`grep "zombie_knockback_percent " "$file" | cut -d " " -f 2`
zrcknockb=`echo "scale=1; $zmcknockb / 100;" | bc`
zrrestrict=`grep "zombie_restrictions " "$file" | cut -d "\"" -f 2 | sed "s/^/\"/;s/$/\"/;s/ /\" \"/g;s/equip/equipment/;s/rifles/rifle/;s/mac/mac10/;s/flash/flashbang/"`
grep "zombie_undead_sound_exclusions " "$file" | cut -d "\"" -f 2 | sed "s/,/\n/g" | sed "/^$/d;s/$/.cfg/" > $tmpf
sed "s/^zombie_sound_rand \([0-9]*.[0-9]*\).*/zr_seffects_moan \1/;
s/^zombie_health \([0-9]*\).*/zr_class_modify \"zombies\" \"health\" \1/;
s/^zombie_speed [0-9]*.[0-9]*.*/zr_class_modify \"zombies\" \"speed\" $zrspeed/;
s/^zombie_knockback \([0-9]*.[0-9]*\).*/zr_class_modify \"zombies\" \"knockback\" \1/;
/^zombie_headshot_count .*/d;
/^zombie_headshots .*/d;
s/^zombie_allow_disable_nv \([0-1]\).*/zr_classes_overlay_toggle \1/;
s/^zombie_headshots_only 0.*/zr_hitgroup_enable_all/;
s/^zombie_headshots_only 1.*/zr_hitgroup_headshots_only/;
s/^zombie_timer_max \([0-9]*.[0-9]*\).*/zr_infect_spawntime_max \1/;
s/^zombie_timer_min \([0-9]*.[0-9]*\).*/zr_infect_spawntime_min \1/;
/^zombie_balancer_health_ratio .*/d;
/^zombie_balancer_player_ratio .*/d;
/^zombie_balancer_type .*/d;
/^zombie_balancer_min_health .*/d;
s/^zombie_show_health 0.*/zr_zhp 0/;
s/^zombie_show_health [1-2].*/zr_zhp 1/;
s/^zombie_regen_timer \([0-9]*.[0-9]*\).*/zr_class_modify \"zombies\" \"health_regen_interval\" \1/;
s/^zombie_regen_health \([0-9]*\).*/zr_class_modify \"zombies\" \"health_regen_amount\" \1/;
s/^zombie_count [0-1].*/zr_infect_mzombie_ratio 0/;
s/^zombie_count [0-9]*.*/zr_infect_mzombie_ratio $zrzcount/;
/^zombie_count_min 0.*/d;
/^zombie_count_max 0.*/d;
s/^zombie_count_min [0-9]*.*/zr_infect_mzombie_ratio $zrzcountminmax/;
s/^zombie_count_max [0-9]*.*/zr_infect_mzombie_ratio $zrzcountminmax/;
/^zombie_count_doublehp 0.*/d;
s/^zombie_count_doublehp [1-2].*/zr_class_modify \"$mzombie\" \"health\" $mzhealth/;
s/^zombie_first_zombie_tele \([0-1]\).*/zr_infect_mzombie_respawn \1/;
/^zombie_grenade_damage_multiplier .*/d;
/^zombie_grenade_knockback_multiplier .*/d;
s/^zombie_health_bonus \([0-9]*\).*/zr_class_modify \"zombies\" \"health_infect_gain\" \1/;
s/^zombie_falldamage 0.*/zr_class_modify \"zombies\" \"no_fall_damage\" \"on\"/;
s/^zombie_falldamage 1.*/zr_class_modify \"zombies\" \"no_fall_damage\" \"off\"/;
s/^zombie_respawn \([0-1]\).*/zr_respawn \1/;
s/^zombie_respawn_delay \([0-9]*\).*/zr_respawn_delay \1/;
s/^zombie_respawn_protection 0.*/zr_spawnprotect 0/;
s/^zombie_respawn_protection \([0-9]*\).*/zr_spawnprotect 1\nzr_spawnprotect_time \1/;
s/^zombie_respawn_as_zombie \([0-1]\).*/zr_respawn_team_zombie \1/;
s/^zombie_respawn_onconnect \([0-1]\).*/zr_zspawn \1/;
s/^zombie_respawn_onconnect_as_zombie 0.*/zr_zspawn_team_override 1\nzr_zspawn_team_zombie 0/;
s/^zombie_respawn_onconnect_as_zombie 1.*/zr_zspawn_team_override 1\nzr_zspawn_team_zombie 1/;
/^zombie_respawn_primary .*/d;
/^zombie_respawn_secondary .*/d;
/^zombie_respawn_grenades .*/d;
/^zombie_respawn_dontdrop_indexes .*/d;
/^zombie_respawn_dropweapons .*/d;
/^zombie_classes .*/d;
s/^zombie_save_classlist \([0-1]\).*/zr_classes_save \1/;
s/^zombie_health_percent [0-9]*.*/zr_class_modify \"zombies\" \"health\" $zrchealth true/;
s/^zombie_speed_percent [0-9]*.[0-9]*.*/zr_class_modify \"zombies\" \"speed\" $zrcspeed true/;
s/^zombie_jump_height_percent [0-9]*.[0-9]*.*/zr_class_modify \"zombies\" \"jump_height\" $zrcjumph true/;
s/^zombie_knockback_percent [0-9]*.[0-9]*.*/zr_class_modify \"zombies\" \"knockback\" $zrcknockb true/;
s/^zombie_classes_random \([0-1]\).*/zr_classes_random \1/;
s/^zombie_classes_random 2.*/zr_classes_default_zombie \"random\"/;
s/^zombie_classes_random 3.*/zr_classes_menu_spawn 1/;
/^zombie_class_url .*/d;
/^zombie_jetpack .*/d;
/^humans_jetpack .*/d;
/^zombie_jetpack_timer .*/d;
s/^zombie_restrictions [a-z0-9A-Z]*.*/zr_restrict $zrrestrict/;
/^zombie_unlimited_ammo .*/d;
/^zombie_weapon .*/d;
s/^zombie_delete_dropped_weapons 0.*/zr_infect_weapons_drop 1/;
s/^zombie_delete_dropped_weapons 1.*/zr_infect_weapons_drop 0/;
/^zombie_allow_picked_up_weapons .*/d;
s/^zombie_buymenu \([0-1]\).*/zr_weapons_zmarket \1/;
s/^zombie_buymenu_zone_only \([0-1]\).*/zr_weapons_zmarket_buyzone \1/;
/^zombie_buymenu_roundstart .*/d;
/^zombie_buymenu_timelimit .*/d;
s/^zombie_teleportcount \([0-9]*\).*/zr_ztele_max_zombie \1\nzr_ztele_max_human \1/;
s/^zombie_teleport_zombies_only 0.*/zr_ztele_human_before 1\nzr_ztele_human_after 1/;
s/^zombie_teleport_zombies_only 1.*/zr_ztele_human_before 0\nzr_ztele_human_after 0/;
s/^zombie_model_file .*/zr_config_path_models \"configs\/zr\/models.txt\"/;
s/^zombie_download_file .*/zr_config_path_downloads \"configs\/zr\/downloads.txt\"/;
s/^zombie_startup 0.*/sm plugins unload zombiereloaded/;
/^zombie_startup 1.*/d;
/^zombie_notices .*/d;
/^zombie_welcome_delay .*/d;
/^zombie_welcome_text .*/d;
/^zombie_help_url .*/d;
s/^zombie_end_round_overlay$/zr_roundend_overlay 0/;
s/^zombie_end_round_overlay \(.*\).*/zr_roundend_overlay 1\nzr_roundend_overlays_zombie \"vgui\/hud\/zombiemod\/\1_zombies\"\nzr_roundend_overlays_human \"vgui\/hud\/zombiemod\/\1_humans\"/;
/^zombie_language_file .*/d;
/^zombie_language_error .*/d;
/^zombie_teams .*/d;
/^zombie_stuckcheck_radius .*/d;
/^zombie_damagelist .*/d;
/^zombie_damagelist_time .*/d;
/^zombie_kickstart_percent .*/d;
/^zombie_kickstart_timer .*/d;
/^zombie_vote_interval .*/d;
/^zombie_disconnect_protection .*/d;
/^zombie_force_endround .*/d;
s/^zombie_dark 0.*/zr_veffects_lightstyle 0/;
s/^zombie_dark 1.*/zr_veffects_lightstyle 1\nzr_veffects_lightstyle_value \"b\"/;
s/^zombie_fog 0.*/zr_veffects_fog 0/;
s/^zombie_fog 1.*/zr_veffects_fog 1\nzr_veffects_fog_override 1/;
s/^zombie_fog_sky \([0-1]\).*/zr_veffects_sky \1/;
s/^zombie_fog_colour \"\([0-9]*.[0-9]*.[0-9]*\)\".*/zr_veffects_fog_pcolor \"\1\"/;
s/^zombie_fog_colour2 \"\([0-9]*.[0-9]*.[0-9]*\)\".*/zr_veffects_fog_scolor \"\1\"/;
s/^zombie_fog_start \([0-9]*\).*/zr_veffects_fog_startdist \1/;
s/^zombie_fog_end \([0-9]*\).*/zr_veffects_fog_enddist \1/;
/^zombie_fog_blend .*/d;
s/^zombie_effect 0.*/zr_infect_explosion 0/;
s/^zombie_effect 1.*/zr_infect_explosion 1\nzr_infect_smoke 1/;
s/^zombie_shake \([0-1]\).*/zr_infect_shake \1/;
s/^zombie_fog_sky_material \"\(.*\)\".*/zr_veffects_sky_path \"\1up.vmt\"/;
s/^zombie_dissolve_corpse \([0-1]\).*/zr_veffects_ragdoll_remove \1/;
s/^zombie_dissolve_corpse_delay \([0-9]*.[0-9]*\).*/zr_veffects_ragdoll_delay \1/;
s/^zombie_fov \([0-9]*\).*/zr_class_modify \"zombies\" \"fov\" \1/;
s/^zombie_vision_material \"\(.*\)\".*/zr_class_modify \"zombies\" \"overlay_path\" \"vgui\/hud\/zombiemod\/\1\"/;
/^zombie_vision_r .*/d;
/^zombie_vision_g .*/d;
/^zombie_vision_b .*/d;
/^zombie_vision_a .*/d;
s/^zombie_vision_timer \([0-9]*.[0-9]*\).*/zr_overlays_update_time \1/;
/^zombie_talk .*/d;
s/^zombie_suicide \([0-1]\).*/zr_damage_suicide_zombie \1\nzr_damage_suicide_mzombie \1\nzr_damage_suicide_human \1/;
s/^zombie_changeteam_block 0.*/zr_damage_suicide_cmds \"kill, spectate, joinclass, explode\"/;
s/^zombie_changeteam_block 1.*/zr_damage_suicide_cmds \"kill, spectate, jointeam, joinclass, explode\"/;
/^zombie_suicide_text .*/d;
s/^zombie_kill_bonus \([0-9]*\).*/zr_class_modify \"zombies\" \"kill_bonus\" \1/;
/^zombie_zstuck_enabled .*/d;
/^zombie_show_attacker_health .*/d;
s/^zombie_startmoney 0.*/zr_account_cashfill 0/;
s/^zombie_startmoney \([0-9]*\).*/zr_account_cashfill 1\nzr_account_cashfill_value \1/;
/^zombie_tk_money .*/d;
/^zombie_kill_money .*/d;
/^zombie_zombie_money .*/d;
s/^zombie_undead_sound_enabled \([0-1]\).*/zr_ambientsounds \1/;
s/^zombie_undead_sound_volume \([0-9]*.[0-9]*\).*/zr_ambientsounds_volume \1/;
s/^zombie_undead_sound \(.*\).*/zr_ambientsounds_file \1/;
/^zombie_undead_sound_exclusions .*/d" "$file" | uniq > $tmp
mv $tmp "$file"
done
for f in $(cat $tmpf)
do
cd "$zrpath"
echo "zr_ambientsounds 0" >> $f
cat "$f" | uniq > $tmpf
mv $tmpf $f
done
this shell script converts this
PHP Code:
zombie_sound_rand 50
zombie_health 2500
zombie_speed 325
zombie_knockback 4
zombie_headshot_count 6
zombie_headshots 1
zombie_allow_disable_nv 0
zombie_headshots_only 0
zombie_timer_max 12
zombie_timer_min 4
zombie_balancer_health_ratio 0
zombie_balancer_player_ratio 0
zombie_balancer_type 1
zombie_balancer_min_health 100
zombie_show_health 1
zombie_regen_timer 20
zombie_regen_health 10
zombie_count 1
zombie_count_min 2
zombie_count_max 4
zombie_count_doublehp 1
zombie_first_zombie_tele 1.0
zombie_grenade_damage_multiplier 2.0
zombie_grenade_knockback_multiplier 2.0
zombie_health_bonus 50
zombie_falldamage 1.0
zombie_respawn 0
zombie_respawn_delay 1
zombie_respawn_protection 10
zombie_respawn_as_zombie 0
zombie_respawn_onconnect 1
zombie_respawn_onconnect_as_zombie 1
zombie_respawn_primary "weapon_tmp"
zombie_respawn_secondary "weapon_usp"
zombie_respawn_grenades 1.0
zombie_respawn_dontdrop_indexes "1,3"
zombie_respawn_dropweapons 1.0
zombie_classes 1.0
zombie_save_classlist 1.0
zombie_health_percent 100
zombie_speed_percent 100
zombie_jump_height_percent 100
zombie_knockback_percent 100
zombie_classes_random 0.0
zombie_class_url "http://www.c0ld.net/zombiemod/zombie_classes.php"
zombie_jetpack 0
humans_jetpack 0
zombie_jetpack_timer 6
zombie_restrictions "rifles m249 flash"
zombie_unlimited_ammo 0
zombie_weapon "zombie_claws_of_death"
zombie_delete_dropped_weapons 1.0
zombie_allow_picked_up_weapons 1.0
zombie_buymenu 1.0
zombie_buymenu_zone_only 0.0
zombie_buymenu_roundstart 1.0
zombie_buymenu_timelimit 1.0
zombie_teleportcount 3
zombie_teleport_zombies_only 0
zombie_model_file "cfg/zombiemod/models.cfg"
zombie_download_file "cfg/zombiemod/downloads.cfg"
zombie_startup 1
zombie_notices 1
zombie_welcome_delay 2
zombie_welcome_text "[ZOMBIE] This server is using the ZombieMod Server Plugin. Type !zhelp in chat for help.\nGet it at www.ZombieMod.com"
zombie_help_url "http://www.zombiemod.com/zombie_help.php"
zombie_end_round_overlay 1024
zombie_language_file "english.cfg"
zombie_language_error "*** %s not found in language file ***"
zombie_teams 1
zombie_stuckcheck_radius 35
zombie_damagelist 1
zombie_damagelist_time -1
zombie_kickstart_percent 70
zombie_kickstart_timer 120
zombie_vote_interval 60
zombie_disconnect_protection 1.0
zombie_force_endround 1.0
zombie_dark 1
zombie_fog 1
zombie_fog_sky 1
zombie_fog_colour "176 192 202"
zombie_fog_colour2 "206 216 222"
zombie_fog_start 30
zombie_fog_end 4000
zombie_fog_blend 1
zombie_effect 1
zombie_shake 1
zombie_fog_sky_material "zombie_sky"
zombie_dissolve_corpse 1.0
zombie_dissolve_corpse_delay 1.0
zombie_fov 125
zombie_vision_material "zombie_view"
zombie_vision_r 0
zombie_vision_g 160
zombie_vision_b 0
zombie_vision_a 50
zombie_vision_timer 20
zombie_talk 1
zombie_suicide 1
zombie_changeteam_block 1
zombie_suicide_text "Dont be an asshole."
zombie_kill_bonus 0
zombie_zstuck_enabled 1
zombie_show_attacker_health 1.0
zombie_startmoney 16000
zombie_tk_money 3000
zombie_kill_money 300
zombie_zombie_money 500
zombie_undead_sound_enabled 1
zombie_undead_sound_volume 0.7
zombie_undead_sound "ambient/zombiemod/zombie_ambient.mp3"
zombie_undead_sound_exclusions "de_aztec"
into this
PHP Code:
zr_seffects_moan 50
zr_class_modify "zombies" "health" 2500
zr_class_modify "zombies" "speed" 75.0
zr_class_modify "zombies" "knockback" 4
zr_classes_overlay_toggle 0
zr_hitgroup_enable_all
zr_infect_spawntime_max 12
zr_infect_spawntime_min 4
zr_zhp 1
zr_class_modify "zombies" "health_regen_interval" 20
zr_class_modify "zombies" "health_regen_amount" 10
zr_infect_mzombie_ratio 0
zr_infect_mzombie_ratio 8
zr_class_modify "Mother zombie" "health" 5000
zr_infect_mzombie_respawn 1
zr_class_modify "zombies" "health_infect_gain" 50
zr_class_modify "zombies" "no_fall_damage" "off"
zr_respawn 0
zr_respawn_delay 1
zr_spawnprotect 1
zr_spawnprotect_time 10
zr_respawn_team_zombie 0
zr_zspawn 1
zr_zspawn_team_override 1
zr_zspawn_team_zombie 1
zr_classes_save 1
zr_class_modify "zombies" "health" 1.0 true
zr_class_modify "zombies" "speed" 1.0 true
zr_class_modify "zombies" "jump_height" 1.0 true
zr_class_modify "zombies" "knockback" 1.0 true
zr_classes_random 0
zr_restrict "rifle" "m249" "flashbang"
zr_infect_weapons_drop 0
zr_weapons_zmarket 1
zr_weapons_zmarket_buyzone 0
zr_ztele_max_zombie 3
zr_ztele_max_human 3
zr_ztele_human_before 1
zr_ztele_human_after 1
zr_config_path_models "configs/zr/models.txt"
zr_config_path_downloads "configs/zr/downloads.txt"
zr_roundend_overlay 1
zr_roundend_overlays_zombie "vgui/hud/zombiemod/1024_zombies"
zr_roundend_overlays_human "vgui/hud/zombiemod/1024_humans"
zr_veffects_lightstyle 1
zr_veffects_lightstyle_value "b"
zr_veffects_fog 1
zr_veffects_fog_override 1
zr_veffects_sky 1
zr_veffects_fog_pcolor "176 192 202"
zr_veffects_fog_scolor "206 216 222"
zr_veffects_fog_startdist 30
zr_veffects_fog_enddist 4000
zr_infect_explosion 1
zr_infect_smoke 1
zr_infect_shake 1
zr_veffects_sky_path "zombie_skyup.vmt"
zr_veffects_ragdoll_remove 1
zr_veffects_ragdoll_delay 1.0
zr_class_modify "zombies" "fov" 125
zr_class_modify "zombies" "overlay_path" "vgui/hud/zombiemod/zombie_view"
zr_overlays_update_time 20
zr_damage_suicide_zombie 1
zr_damage_suicide_mzombie 1
zr_damage_suicide_human 1
zr_damage_suicide_cmds "kill, spectate, jointeam, joinclass, explode"
zr_class_modify "zombies" "kill_bonus" 0
zr_account_cashfill 1
zr_account_cashfill_value 16000
zr_ambientsounds 1
zr_ambientsounds_volume 0.7
zr_ambientsounds_file "ambient/zombiemod/zombie_ambient.mp3"
also it creates new config of map de_aztec.cfg with this
PHP Code:
zr_ambientsounds 0
because of
PHP Code:
// A comma delimited string of maps with wich not to use zombie_undead_sound.
zombie_undead_sound_exclusions "de_aztec"