This commit is contained in:
Jackzie 2021-01-11 11:19:06 -06:00
parent 0801d644f1
commit 4a8f3f0049
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
12 changed files with 3 additions and 15 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -78,7 +78,6 @@ New logic overview:
3. Find the closest tank 3. Find the closest tank
4. Retreat if in close range (~300 units) 4. Retreat if in close range (~300 units)
*/ */
//TODO: possibly check if multiple loops being created
public Action BotControlTimerV2(Handle timer) public Action BotControlTimerV2(Handle timer)
{ {
//remove timer once tanks no longer exists/are all dead or finale escape vehicle arrived //remove timer once tanks no longer exists/are all dead or finale escape vehicle arrived
@ -121,7 +120,6 @@ public Action BotControlTimerV2(Handle timer)
} }
} }
//If the closest tank exists (-1 means no tank.) and is close, avoid. //If the closest tank exists (-1 means no tank.) and is close, avoid.
//TODO: Possibly only run if they have an item in the pill shot, or have medkit.
if(closestTank > -1 && smallestDistance <= 300 && botHealth >= 40) { if(closestTank > -1 && smallestDistance <= 300 && botHealth >= 40) {
//L4D2_RunScript("CommandABot({cmd=3,bot=GetPlayerFromUserID(%i)})", GetClientUserId(i)); //L4D2_RunScript("CommandABot({cmd=3,bot=GetPlayerFromUserID(%i)})", GetClientUserId(i));
L4D2_RunScript("CommandABot({cmd=2,bot=GetPlayerFromUserID(%i),target=GetPlayerFromUserID(%i)})", GetClientUserId(i), GetClientUserId(closestTank)); L4D2_RunScript("CommandABot({cmd=2,bot=GetPlayerFromUserID(%i),target=GetPlayerFromUserID(%i)})", GetClientUserId(i), GetClientUserId(closestTank));

View file

@ -35,7 +35,6 @@ public void OnPluginStart() {
RegAdminCmd("sm_ai_holdout", Command_SpawnHoldoutBot, ADMFLAG_ROOT); RegAdminCmd("sm_ai_holdout", Command_SpawnHoldoutBot, ADMFLAG_ROOT);
RegAdminCmd("sm_ai_minigun", Command_SpawnMinigunBot, ADMFLAG_ROOT); RegAdminCmd("sm_ai_minigun", Command_SpawnMinigunBot, ADMFLAG_ROOT);
RegAdminCmd("sm_ai_remove_far", Command_RemoveFar, ADMFLAG_ROOT); RegAdminCmd("sm_ai_remove_far", Command_RemoveFar, ADMFLAG_ROOT);
//todo: add cmd to remove any that are out of range? possibly only ones you past
} }
public void OnMapStart() { public void OnMapStart() {

View file

@ -23,7 +23,7 @@ public Plugin myinfo =
url = "" url = ""
}; };
//TODO: Performance checks, split main loop into scan loop / active loop, and convars for allowed gamemodes / difficulties //TODO: convars for allowed gamemodes / difficulties
static ArrayList WitchList; static ArrayList WitchList;
@ -124,9 +124,6 @@ public Action Event_WitchKilled(Event event, const char[] name, bool dontBroadca
if(index > -1) { if(index > -1) {
RemoveFromArray(WitchList, index); RemoveFromArray(WitchList, index);
} }
if(WitchList.Length == 0) {
CloseHandle(timer);
}
if(AutoCrownTarget == witchID) { if(AutoCrownTarget == witchID) {
ResetAutoCrown(); ResetAutoCrown();
#if defined DEBUG #if defined DEBUG
@ -206,12 +203,11 @@ public Action Timer_Scan(Handle hdl) {
int witchID = WitchList.Get(i); int witchID = WitchList.Get(i);
if(IsValidEntity(witchID) && HasEntProp(witchID, Prop_Send, "m_rage") && GetEntPropFloat(witchID, Prop_Send, "m_rage") <= 0.4) { if(IsValidEntity(witchID) && HasEntProp(witchID, Prop_Send, "m_rage") && GetEntPropFloat(witchID, Prop_Send, "m_rage") <= 0.4) {
GetEntPropVector(witchID, Prop_Send, "m_vecOrigin", witchPos); GetEntPropVector(witchID, Prop_Send, "m_vecOrigin", witchPos);
//TODO: Calculate closest witch
if(GetVectorDistance(botPosition, witchPos) <= SCAN_RANGE) { if(GetVectorDistance(botPosition, witchPos) <= SCAN_RANGE) {
//GetEntPropVector(witchID, Prop_Send, "m_angRotation", witchAng); //GetEntPropVector(witchID, Prop_Send, "m_angRotation", witchAng);
//TODO: Implement a line-of-sight trace //TODO: Implement a line-of-sight trace
#if defined DEBUG #if defined DEBUG
PrintToChatAll("Found a valid witch in range of %N: %d", bot, witchID); PrintToServer("Found a valid witch in range of %N: %d", bot, witchID);
#endif #endif
L4D2_RunScript("CommandABot({cmd=1,bot=GetPlayerFromUserID(%i),pos=Vector(%f,%f,%f)})", GetClientUserId(bot), witchPos[0], witchPos[1], witchPos[2]); L4D2_RunScript("CommandABot({cmd=1,bot=GetPlayerFromUserID(%i),pos=Vector(%f,%f,%f)})", GetClientUserId(bot), witchPos[0], witchPos[1], witchPos[2]);
AutoCrownTarget = witchID; AutoCrownTarget = witchID;

View file

@ -45,7 +45,7 @@ public void OnPluginStart()
HookEvent("player_entered_checkpoint", Event_EnterSaferoom); HookEvent("player_entered_checkpoint", Event_EnterSaferoom);
HookEvent("heal_success", Event_HealFinished); HookEvent("heal_success", Event_HealFinished);
hExtraItemBasePercentage = CreateConVar("l4d2_extraitem_chance", "0.056", "The base chance (multipled by player count) of an extra item being spawned.", FCVAR_NONE, true, 0.0, true, 1.0); hExtraItemBasePercentage = CreateConVar("l4d2_extraitem_chance", "0.056", "The base chance (multiplied by player count) of an extra item being spawned.", FCVAR_NONE, true, 0.0, true, 1.0);
AutoExecConfig(true); AutoExecConfig(true);
} }

View file

@ -17,8 +17,6 @@
//TODO: Detect if player activates crescendo from far away //TODO: Detect if player activates crescendo from far away
//Possibly cancel event, make poll for other users. if no one responds, activate troll mode/swarm or kick/ban depending on FF amount? //Possibly cancel event, make poll for other users. if no one responds, activate troll mode/swarm or kick/ban depending on FF amount?
//TODO: Replace all timers with userID not clientID. GetClientUserId() -> timer
//On player_disconnect event, NOT the forward remove?
public Plugin myinfo = public Plugin myinfo =
{ {
@ -89,9 +87,6 @@ public void OnMapStart() {
HookEntityOutput("func_button", "OnPressed", Event_ButtonPress); HookEntityOutput("func_button", "OnPressed", Event_ButtonPress);
CreateTimer(MAIN_TIMER_INTERVAL_S, Timer_Main, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE); CreateTimer(MAIN_TIMER_INTERVAL_S, Timer_Main, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
} }
public void OnPlayerDisconnect(int client) {
g_iTrollUsers[client] = 0;
}
public void Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) { public void Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(event.GetInt("userid")); int client = GetClientOfUserId(event.GetInt("userid"));
g_iTrollUsers[client] = 0; g_iTrollUsers[client] = 0;