add bot camp timer to prevent /camp exploits

This commit is contained in:
nytmyr
2024-11-13 10:10:47 -06:00
parent 6d97536e38
commit 2e0840db72
5 changed files with 10 additions and 0 deletions
+1
View File
@@ -871,6 +871,7 @@ RULE_INT(Bots, DefaultFollowDistance, 20, "Default 20. Distance a bot will follo
RULE_INT(Bots, MaxFollowDistance, 300, "Default 300. Max distance a bot can be set to follow behind.") RULE_INT(Bots, MaxFollowDistance, 300, "Default 300. Max distance a bot can be set to follow behind.")
RULE_INT(Bots, MaxDistanceRanged, 300, "Default 300. Max distance a bot can be set to ranged.") RULE_INT(Bots, MaxDistanceRanged, 300, "Default 300. Max distance a bot can be set to ranged.")
RULE_BOOL(Bots, AllowAIMez, true, "If enabled bots will automatically mez/AE mez eligible targets.") RULE_BOOL(Bots, AllowAIMez, true, "If enabled bots will automatically mez/AE mez eligible targets.")
RULE_INT(Bots, CampTimer, 25, "Number of seconds after /camp has begun before bots camp out.")
RULE_CATEGORY_END() RULE_CATEGORY_END()
RULE_CATEGORY(Chat) RULE_CATEGORY(Chat)
+2
View File
@@ -148,6 +148,7 @@ Client::Client(EQStreamInterface *ieqs) : Mob(
), ),
hpupdate_timer(2000), hpupdate_timer(2000),
camp_timer(29000), camp_timer(29000),
bot_camp_timer((RuleI(Bots, CampTimer) * 1000)),
process_timer(100), process_timer(100),
consume_food_timer(CONSUMPTION_TIMER), consume_food_timer(CONSUMPTION_TIMER),
zoneinpacket_timer(1000), zoneinpacket_timer(1000),
@@ -252,6 +253,7 @@ Client::Client(EQStreamInterface *ieqs) : Mob(
fishing_timer.Disable(); fishing_timer.Disable();
dead_timer.Disable(); dead_timer.Disable();
camp_timer.Disable(); camp_timer.Disable();
bot_camp_timer.Disable();
autosave_timer.Disable(); autosave_timer.Disable();
GetMercTimer()->Disable(); GetMercTimer()->Disable();
instalog = false; instalog = false;
+1
View File
@@ -2036,6 +2036,7 @@ private:
PTimerList p_timers; //persistent timers PTimerList p_timers; //persistent timers
Timer hpupdate_timer; Timer hpupdate_timer;
Timer camp_timer; Timer camp_timer;
Timer bot_camp_timer;
Timer process_timer; Timer process_timer;
Timer consume_food_timer; Timer consume_food_timer;
Timer zoneinpacket_timer; Timer zoneinpacket_timer;
+2
View File
@@ -4341,6 +4341,7 @@ void Client::Handle_OP_Camp(const EQApplicationPacket *app)
return; return;
} }
camp_timer.Start(29000, true); camp_timer.Start(29000, true);
bot_camp_timer.Start((RuleI(Bots, CampTimer) * 1000), true);
return; return;
} }
@@ -14760,6 +14761,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
SetFeigned(false); SetFeigned(false);
BindWound(this, false, true); BindWound(this, false, true);
camp_timer.Disable(); camp_timer.Disable();
bot_camp_timer.Disable();
} }
else if (sa->parameter == Animation::Sitting) { else if (sa->parameter == Animation::Sitting) {
SetAppearance(eaSitting); SetAppearance(eaSitting);
+4
View File
@@ -193,6 +193,10 @@ bool Client::Process() {
return false; //delete client return false; //delete client
} }
if (bot_camp_timer.Check()) {
Bot::BotOrderCampAll(this);
}
if (camp_timer.Check()) { if (camp_timer.Check()) {
Raid *myraid = entity_list.GetRaidByClient(this); Raid *myraid = entity_list.GetRaidByClient(this);
if (myraid) { if (myraid) {