diff --git a/dlls/bot_combat.cpp b/dlls/bot_combat.cpp index 2d93102..10d3c79 100644 --- a/dlls/bot_combat.cpp +++ b/dlls/bot_combat.cpp @@ -60,6 +60,27 @@ typedef struct } bot_fire_delay_t; +bot_weapon_select_t sgtc_weapon_select[] = { + {SGTC_WEAPON_LANCE, "weapon_lance", 5, 0.0, 9999.0, 0.0, 9999.0, + 100, FALSE, 80, 1, 10, FALSE, FALSE, FALSE, TRUE, 0.0, 0.8}, + {SGTC_WEAPON_ZAT, "weapon_zat", 5, 0.0, 1200.0, 0.0, 1200.0, + 100, TRUE, 70, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0}, + /* terminator */ + {0, "", 0, 0.0, 0.0, 0.0, 0.0, 0, TRUE, 0, 1, 1, FALSE, FALSE, FALSE, FALSE, 0.0, 0.0} +}; + +bot_fire_delay_t sgtc_fire_delay[] = { + {SGTC_WEAPON_LANCE, + 0.2, {0.0, 0.2, 0.3, 0.5, 1.0}, {0.1, 0.3, 0.5, 0.8, 1.2}, + 1.0, {0.2, 0.3, 0.5, 0.8, 1.2}, {0.5, 0.7, 1.0, 1.5, 2.0}}, + {SGTC_WEAPON_ZAT, + 0.3, {0.0, 0.1, 0.2, 0.3, 0.4}, {0.1, 0.2, 0.3, 0.4, 0.5}, + 0.2, {0.0, 0.0, 0.1, 0.1, 0.2}, {0.1, 0.1, 0.2, 0.2, 0.4}}, + /* terminator */ + {0, 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, + 0.0, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}} +}; + // weapons are stored in priority order, most desired weapon should be at // the start of the array and least desired should be at the end @@ -800,7 +821,13 @@ bool BotFireWeapon( Vector v_enemy, bot_t *pBot, int weapon_choice) float distance = v_enemy.Length(); // how far away is the enemy? - if (mod_id == VALVE_DLL) + if (true) + { + + pSelect = &sgtc_weapon_select[0]; + pDelay = &sgtc_fire_delay[0]; + } + else if (mod_id == VALVE_DLL) { pSelect = &valve_weapon_select[0]; pDelay = &valve_fire_delay[0]; diff --git a/dlls/bot_weapons.h b/dlls/bot_weapons.h index e8e71b8..70ada3d 100644 --- a/dlls/bot_weapons.h +++ b/dlls/bot_weapons.h @@ -9,6 +9,12 @@ #ifndef BOT_WEAPONS_H #define BOT_WEAPONS_H + +#define SGTC_WEAPON_CROWBAR 1 +#define SGTC_WEAPON_ZAT 2 +#define SGTC_WEAPON_LANCE 4 + + // weapon ID values for Valve's Half-Life Deathmatch #define VALVE_WEAPON_CROWBAR 1 #define VALVE_WEAPON_GLOCK 2 diff --git a/sgtcweps.sma b/sgtcweps.sma new file mode 100644 index 0000000..4dd4c1d --- /dev/null +++ b/sgtcweps.sma @@ -0,0 +1,163 @@ +#include +#include +#include +#include +#include + +#define PLUGIN "SGTC BOTS GIVE WEAPONS" +#define VERSION "1.0" +#define AUTHOR "Freeman" + +public plugin_init() +{ + register_plugin(PLUGIN,VERSION,AUTHOR) + register_event("ResetHUD", "event_spawn", "b"); + set_task(float(10),"checkPlayers",_,_,_,"b") +} +public event_spawn(id) +{ + //log_amx( "[SGTC Weapons] spawn."); + //make_sure_has_gun(id); + +} + +public make_sure_has_gun(id) +{ + + + + if(is_user_alive(id) && is_user_bot(id) ) + { + + new iWeapon = get_user_weapon( id ); + new szWeapon[ 32 ]; + + if ( iWeapon ) + get_weaponname( iWeapon , szWeapon , 31 ); + else + return 0; + + new szUsername[ 32 ]; + get_user_name(id, szUsername, 31); + + + log_amx( "[SGTC Weapons] %s has weapon: %s.", szUsername, szWeapon); + + if (equal( szWeapon, "weapon_batsup") || equal( szWeapon, "weapon_coujaf") || equal( szWeapon, "weapon_couteau") ) + { + + if ( get_user_team(id) == 1 ) //tauri + { + new iChance = random_num(0, 4); + if (iChance == 0) + { + give_item(id, "weapon_mp5") + } + else if (iChance == 1) + { + give_item(id, "weapon_psg1") + } + else if (iChance == 2) + { + give_item(id, "weapon_psg1") + } + else if (iChance == 3) + { + give_item(id, "weapon_m16") + } + else + { + give_item(id, "weapon_p90") + } + + } + else // goauld + { + new iChance = random_num(0, 4); + if (iChance == 0) + { + give_item(id, "weapon_reetou") + } + else if (iChance == 1) + { + give_item(id, "weapon_glstaff") + } + else if (iChance == 2) + { + give_item(id, "weapon_zatarc") + } + else if (iChance == 3) + { + give_item(id, "weapon_lance") + } + else + { + give_item(id, "weapon_main") + } + } + + + } + else + { + //log_amx( "[SGTC Weapons] (dont give a wep) %s has weapon: %s.", szUsername, szWeapon); + + } + + } + +} + + + +public checkPlayers() { + + + + new realPlayers = 0; + + + log_amx( "[SGTC Weapons] checkPlayers."); + for (new i = 1; i <= get_maxplayers(); i++) { + if ( !is_user_bot(i) && is_user_alive(i) ) { + realPlayers = realPlayers + 1; + } + + if (is_user_alive(i) && is_user_connected(i) ) { + make_sure_has_gun(i) ; + } + + if (is_user_bot(i) && get_user_team(i) == 0 ) + { + log_amx( "[SGTC Weapons] force spectating bot to join."); + new iChance = random_num(0, 1); + if (iChance == 0) + client_cmd(i,"jointeam 1;classe 1 1") ; + else + client_cmd(i,"jointeam 2;classe 2 2") ; + + } + } + + + + + if (/*realPlayers < 1 &&*/ get_cvar_num("mp_timeleft") < 0) + { + log_amx( "[SGTC ] killbots."); + /*for (new i = 1; i <= get_maxplayers(); i++) { + user_kill(i);*/ + + new szNextMap[ 32 ]; + new szcmd[ 64 ]; + get_cvar_string( "amx_nextmap", szNextMap, 31); + + format(szcmd,64,"changelevel %s", szNextMap); + + server_cmd(szcmd); + + //} + } + + return PLUGIN_HANDLED; +} diff --git a/waypoints/ctp_amon.HPB_wp1 b/waypoints/ctp_amon.HPB_wp1 new file mode 100644 index 0000000..e1c172d Binary files /dev/null and b/waypoints/ctp_amon.HPB_wp1 differ diff --git a/waypoints/ctp_amon.HPB_wpt b/waypoints/ctp_amon.HPB_wpt new file mode 100644 index 0000000..88e0026 Binary files /dev/null and b/waypoints/ctp_amon.HPB_wpt differ diff --git a/waypoints/ctp_crypt.HPB_wp1 b/waypoints/ctp_crypt.HPB_wp1 new file mode 100644 index 0000000..af7467b Binary files /dev/null and b/waypoints/ctp_crypt.HPB_wp1 differ diff --git a/waypoints/ctp_crypt.HPB_wpt b/waypoints/ctp_crypt.HPB_wpt new file mode 100644 index 0000000..20eac66 Binary files /dev/null and b/waypoints/ctp_crypt.HPB_wpt differ diff --git a/waypoints/sg_chateau.HPB_wp1 b/waypoints/sg_chateau.HPB_wp1 new file mode 100644 index 0000000..6f2418e Binary files /dev/null and b/waypoints/sg_chateau.HPB_wp1 differ diff --git a/waypoints/sg_chateau.HPB_wpt b/waypoints/sg_chateau.HPB_wpt new file mode 100644 index 0000000..8f151a0 Binary files /dev/null and b/waypoints/sg_chateau.HPB_wpt differ diff --git a/waypoints/sg_conquest.HPB_wp1 b/waypoints/sg_conquest.HPB_wp1 new file mode 100644 index 0000000..098351a Binary files /dev/null and b/waypoints/sg_conquest.HPB_wp1 differ diff --git a/waypoints/sg_conquest.HPB_wpt b/waypoints/sg_conquest.HPB_wpt new file mode 100644 index 0000000..4aac2ad Binary files /dev/null and b/waypoints/sg_conquest.HPB_wpt differ diff --git a/waypoints/sg_crypt.HPB_wp1 b/waypoints/sg_crypt.HPB_wp1 new file mode 100644 index 0000000..8180a71 Binary files /dev/null and b/waypoints/sg_crypt.HPB_wp1 differ diff --git a/waypoints/sg_crypt.HPB_wpt b/waypoints/sg_crypt.HPB_wpt new file mode 100644 index 0000000..cfa4c77 Binary files /dev/null and b/waypoints/sg_crypt.HPB_wpt differ diff --git a/waypoints/sg_escape.HPB_wp1 b/waypoints/sg_escape.HPB_wp1 new file mode 100644 index 0000000..d52a5ef Binary files /dev/null and b/waypoints/sg_escape.HPB_wp1 differ diff --git a/waypoints/sg_escape.HPB_wpt b/waypoints/sg_escape.HPB_wpt new file mode 100644 index 0000000..573ee08 Binary files /dev/null and b/waypoints/sg_escape.HPB_wpt differ diff --git a/waypoints/sg_hina.HPB_wp1 b/waypoints/sg_hina.HPB_wp1 new file mode 100644 index 0000000..d705fa2 Binary files /dev/null and b/waypoints/sg_hina.HPB_wp1 differ diff --git a/waypoints/sg_hina.HPB_wpt b/waypoints/sg_hina.HPB_wpt new file mode 100644 index 0000000..9c4656e Binary files /dev/null and b/waypoints/sg_hina.HPB_wpt differ diff --git a/waypoints/sg_land3.HPB_wp1 b/waypoints/sg_land3.HPB_wp1 new file mode 100644 index 0000000..d8e7557 Binary files /dev/null and b/waypoints/sg_land3.HPB_wp1 differ diff --git a/waypoints/sg_land3.HPB_wpt b/waypoints/sg_land3.HPB_wpt new file mode 100644 index 0000000..a162f57 Binary files /dev/null and b/waypoints/sg_land3.HPB_wpt differ diff --git a/waypoints/sg_loop.HPB_wp1 b/waypoints/sg_loop.HPB_wp1 new file mode 100644 index 0000000..ed6f4e3 Binary files /dev/null and b/waypoints/sg_loop.HPB_wp1 differ diff --git a/waypoints/sg_loop.HPB_wpt b/waypoints/sg_loop.HPB_wpt new file mode 100644 index 0000000..58a2c7d Binary files /dev/null and b/waypoints/sg_loop.HPB_wpt differ diff --git a/waypoints/sg_newstrike.HPB_wp1 b/waypoints/sg_newstrike.HPB_wp1 new file mode 100644 index 0000000..53a167d Binary files /dev/null and b/waypoints/sg_newstrike.HPB_wp1 differ diff --git a/waypoints/sg_newstrike.HPB_wpt b/waypoints/sg_newstrike.HPB_wpt new file mode 100644 index 0000000..b440dc5 Binary files /dev/null and b/waypoints/sg_newstrike.HPB_wpt differ diff --git a/waypoints/sg_nox.HPB_wp1 b/waypoints/sg_nox.HPB_wp1 new file mode 100644 index 0000000..ebf7d09 Binary files /dev/null and b/waypoints/sg_nox.HPB_wp1 differ diff --git a/waypoints/sg_nox.HPB_wpt b/waypoints/sg_nox.HPB_wpt new file mode 100644 index 0000000..1171ae1 Binary files /dev/null and b/waypoints/sg_nox.HPB_wpt differ diff --git a/waypoints/sg_prison.HPB_wpt b/waypoints/sg_prison.HPB_wpt new file mode 100644 index 0000000..10c3110 Binary files /dev/null and b/waypoints/sg_prison.HPB_wpt differ diff --git a/waypoints/sg_pyramide.HPB_wpt b/waypoints/sg_pyramide.HPB_wpt new file mode 100644 index 0000000..8e34c05 Binary files /dev/null and b/waypoints/sg_pyramide.HPB_wpt differ diff --git a/waypoints/sg_quietvillage.HPB_wp1 b/waypoints/sg_quietvillage.HPB_wp1 new file mode 100644 index 0000000..c0ea58c Binary files /dev/null and b/waypoints/sg_quietvillage.HPB_wp1 differ diff --git a/waypoints/sg_quietvillage.HPB_wpt b/waypoints/sg_quietvillage.HPB_wpt new file mode 100644 index 0000000..1e0b3bd Binary files /dev/null and b/waypoints/sg_quietvillage.HPB_wpt differ diff --git a/waypoints/sg_shunky.HPB_wp1 b/waypoints/sg_shunky.HPB_wp1 new file mode 100644 index 0000000..9a1e696 Binary files /dev/null and b/waypoints/sg_shunky.HPB_wp1 differ diff --git a/waypoints/sg_shunky.HPB_wpt b/waypoints/sg_shunky.HPB_wpt new file mode 100644 index 0000000..4b04483 Binary files /dev/null and b/waypoints/sg_shunky.HPB_wpt differ diff --git a/waypoints/sg_stargate.HPB_wp1 b/waypoints/sg_stargate.HPB_wp1 new file mode 100644 index 0000000..dcbd64c Binary files /dev/null and b/waypoints/sg_stargate.HPB_wp1 differ diff --git a/waypoints/sg_stargate.HPB_wpt b/waypoints/sg_stargate.HPB_wpt new file mode 100644 index 0000000..befb763 Binary files /dev/null and b/waypoints/sg_stargate.HPB_wpt differ diff --git a/waypoints/sg_strike3.HPB_wp1 b/waypoints/sg_strike3.HPB_wp1 new file mode 100644 index 0000000..00bab90 Binary files /dev/null and b/waypoints/sg_strike3.HPB_wp1 differ diff --git a/waypoints/sg_strike3.HPB_wpt b/waypoints/sg_strike3.HPB_wpt new file mode 100644 index 0000000..0fad2be Binary files /dev/null and b/waypoints/sg_strike3.HPB_wpt differ diff --git a/waypoints/sg_target2a.HPB_wpt b/waypoints/sg_target2a.HPB_wpt new file mode 100644 index 0000000..20627b5 Binary files /dev/null and b/waypoints/sg_target2a.HPB_wpt differ diff --git a/waypoints/sg_tekluhanak.HPB_wpt b/waypoints/sg_tekluhanak.HPB_wpt new file mode 100644 index 0000000..1acb47b Binary files /dev/null and b/waypoints/sg_tekluhanak.HPB_wpt differ diff --git a/waypoints/sg_temple.HPB_wp1 b/waypoints/sg_temple.HPB_wp1 new file mode 100644 index 0000000..258c0ac Binary files /dev/null and b/waypoints/sg_temple.HPB_wp1 differ diff --git a/waypoints/sg_temple.HPB_wpt b/waypoints/sg_temple.HPB_wpt new file mode 100644 index 0000000..77e25f3 Binary files /dev/null and b/waypoints/sg_temple.HPB_wpt differ diff --git a/waypoints/sg_thor.HPB_wp1 b/waypoints/sg_thor.HPB_wp1 new file mode 100644 index 0000000..b73b3b7 Binary files /dev/null and b/waypoints/sg_thor.HPB_wp1 differ diff --git a/waypoints/sg_thor.HPB_wpt b/waypoints/sg_thor.HPB_wpt new file mode 100644 index 0000000..5a8fbd1 Binary files /dev/null and b/waypoints/sg_thor.HPB_wpt differ diff --git a/waypoints/sg_tokra2.HPB_wp1 b/waypoints/sg_tokra2.HPB_wp1 new file mode 100644 index 0000000..5212e80 Binary files /dev/null and b/waypoints/sg_tokra2.HPB_wp1 differ diff --git a/waypoints/sg_tokra2.HPB_wpt b/waypoints/sg_tokra2.HPB_wpt new file mode 100644 index 0000000..581c439 Binary files /dev/null and b/waypoints/sg_tokra2.HPB_wpt differ