Compare commits

...

4 Commits

Author SHA1 Message Date
JJ 4120d94fc8 Change default login server 2026-06-22 17:28:56 -04:00
nytmyr 96c32e6189 [Bots] Make ^itemuse use BaseRace (#5102)
Build / Linux (push) Has been cancelled
Build / Windows (push) Has been cancelled
2026-06-17 21:23:08 -07:00
nytmyr 1a9ef6ea39 [Bots] Add bot owner to hatelist on bot pet social aggro (#5103) 2026-06-17 21:22:50 -07:00
nytmyr 36d6613a47 [Bots] Change how bots handle blind (#5104) 2026-06-17 21:22:33 -07:00
7 changed files with 38 additions and 7 deletions
+3 -3
View File
@@ -32,8 +32,8 @@
"loginserver1": { "loginserver1": {
"account": "", "account": "",
"password": "", "password": "",
"legacy": 0, "legacy": 1,
"host": "login.projecteq.net", "host": "login.eqemulator.net",
"port": "5998" "port": "5998"
}, },
"tcp": { "tcp": {
@@ -70,4 +70,4 @@
"plugins": "quests/plugins/" "plugins": "quests/plugins/"
} }
} }
} }
+1
View File
@@ -908,6 +908,7 @@ RULE_STRING(Bots, ZoneForcedSpawnLimits, "", "Comma-delimited list of forced spa
RULE_INT(Bots, AICastSpellTypeDelay, 100, "Delay in milliseconds between AI cast attempts for each spell type. Default 100ms") RULE_INT(Bots, AICastSpellTypeDelay, 100, "Delay in milliseconds between AI cast attempts for each spell type. Default 100ms")
RULE_INT(Bots, AICastSpellTypeHeldDelay, 2500, "Delay in milliseconds between AI cast attempts for each spell type that is held or disabled. Default 2500ms (2.5s)") RULE_INT(Bots, AICastSpellTypeHeldDelay, 2500, "Delay in milliseconds between AI cast attempts for each spell type that is held or disabled. Default 2500ms (2.5s)")
RULE_BOOL(Bots, BotsRequireLoS, true, "Whether or not bots require line of sight to be told to attack their target") RULE_BOOL(Bots, BotsRequireLoS, true, "Whether or not bots require line of sight to be told to attack their target")
RULE_INT(Bots, BlindMoveChance, 5, "Chance for a bot to run to its target if it is blinded. Default 5.")
RULE_CATEGORY_END() RULE_CATEGORY_END()
RULE_CATEGORY(Chat) RULE_CATEGORY(Chat)
+5 -1
View File
@@ -3186,7 +3186,11 @@ void Mob::AddToHateList(Mob* other, int64 hate /*= 0*/, int64 damage /*= 0*/, bo
// if other is a bot, add the bots client to the hate list // if other is a bot, add the bots client to the hate list
if (RuleB(Bots, Enabled)) { if (RuleB(Bots, Enabled)) {
if (other->IsBot()) { if (other->GetOwner() && other->GetOwner()->IsBot()) {
other = other->GetOwner();
}
if (other->IsBot()) {
auto other_ = other->CastToBot(); auto other_ = other->CastToBot();
if (!other_ || !other_->GetBotOwner()) { if (!other_ || !other_->GetBotOwner()) {
+21
View File
@@ -3432,6 +3432,10 @@ bool Bot::CheckIfIncapacitated() {
} }
if (currently_fleeing) { if (currently_fleeing) {
if (!FindType(SpellEffect::Fear)) { // Blinded
return BotProcessBlind();
}
if (RuleB(Combat, EnableFearPathing) && AI_movement_timer->Check()) { if (RuleB(Combat, EnableFearPathing) && AI_movement_timer->Check()) {
// Check if we have reached the last fear point // Check if we have reached the last fear point
if (DistanceNoZ(glm::vec3(GetX(), GetY(), GetZ()), m_FearWalkTarget) <= 5.0f) { if (DistanceNoZ(glm::vec3(GetX(), GetY(), GetZ()), m_FearWalkTarget) <= 5.0f) {
@@ -3453,6 +3457,23 @@ bool Bot::CheckIfIncapacitated() {
return false; return false;
} }
bool Bot::BotProcessBlind() {
if (m_combat_jitter_timer.Check() && zone->random.Int(1, 100) <= RuleI(Bots, BlindMoveChance)) {
Mob* tar = GetTarget() ? GetTarget() : GetBotOwner();
if (tar) {
glm::vec3 Goal = tar->GetPosition();
RunTo(Goal.x, Goal.y, Goal.z);
SetCombatJitter();
}
return true;
}
return false;
}
void Bot::SetBerserkState() {// Berserk updates should occur if primary AI criteria are met void Bot::SetBerserkState() {// Berserk updates should occur if primary AI criteria are met
if (GetClass() == Class::Warrior || GetClass() == Class::Berserker) { if (GetClass() == Class::Warrior || GetClass() == Class::Berserker) {
if (!berserk && GetHPRatio() < RuleI(Combat, BerserkerFrenzyStart)) { if (!berserk && GetHPRatio() < RuleI(Combat, BerserkerFrenzyStart)) {
+2 -1
View File
@@ -542,7 +542,7 @@ public:
bool IsValidMezTarget(Mob* owner, Mob* npc, uint16 spell_id); bool IsValidMezTarget(Mob* owner, Mob* npc, uint16 spell_id);
// Cast checks // Cast checks
bool PrecastChecks(Mob* tar, uint16 spell_type); bool PrecastChecks(Mob* tar, uint16 spell_type);
bool CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool prechecks = false, bool ae_check = false); bool CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool prechecks = false, bool ae_check = false);
bool IsImmuneToBotSpell(uint16 spell_id, Mob* caster); bool IsImmuneToBotSpell(uint16 spell_id, Mob* caster);
bool CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar); bool CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar);
@@ -1055,6 +1055,7 @@ public:
bool BotCastCure(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spell_type); bool BotCastCure(Mob* tar, uint8 bot_class, BotSpell& bot_spell, uint16 spell_type);
bool CheckIfIncapacitated(); bool CheckIfIncapacitated();
bool BotProcessBlind();
bool IsAIProcessValid(const Client* bot_owner, const Group* bot_group, const Raid* raid); bool IsAIProcessValid(const Client* bot_owner, const Group* bot_group, const Raid* raid);
Client* SetLeashOwner(Client* bot_owner, Group* bot_group, Raid* raid, uint32 r_group) const; Client* SetLeashOwner(Client* bot_owner, Group* bot_group, Raid* raid, uint32 r_group) const;
+2 -2
View File
@@ -206,8 +206,8 @@ void bot_command_item_use(Client* c, const Seperator* sep)
} }
if ( if (
(!RuleB(Bots, AllowBotEquipAnyRaceGear) && ((~item_data->Races) & GetPlayerRaceBit(bot_iter->GetRace()))) || (!RuleB(Bots, AllowBotEquipAnyRaceGear) && !(item_data->Races & GetPlayerRaceBit(bot_iter->GetBaseRace()))) ||
(!RuleB(Bots, AllowBotEquipAnyClassGear) && ((~item_data->Classes) & GetPlayerClassBit(bot_iter->GetClass()))) (!RuleB(Bots, AllowBotEquipAnyClassGear) && !(item_data->Classes & GetPlayerClassBit(bot_iter->GetClass())))
) { ) {
continue; continue;
} }
+4
View File
@@ -1362,6 +1362,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
} }
} }
} }
else if (IsBot()) {
currently_fleeing = true;
CastToBot()->BotProcessBlind();
}
else if (!IsClient()) { else if (!IsClient()) {
CalculateNewFearpoint(); CalculateNewFearpoint();
} }