[Bots] Cleanup and remove preprocessors. (#2757)

* [Bots] Cleanup and remove preprocessors.

- Removes every `#ifdef BOTS` we have and locks bots behind `Bots:AllowBots` rule.
- Bot updates are now done by default similar to regular database updates.
- Modify `CMakeLists.txt`, `.drone.yml`, and `BUILD.md` to match the removal of `EQEMU_ENABLE_BOTS`.

* Cleanup

- Add SQL for enabling bots for servers with bots.
- Add message that tells players/operators bots are disabled.

* Suggested changes.

* Bot injection stuff

* Change SQL to bot SQL.

* Tweaks

* Remove `is_bot`

* Update version.h

* Update main.cpp

* Update database.cpp

* Fix name availability crash

* Remove bots from update script

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Alex King
2023-01-20 13:35:33 -05:00
committed by GitHub
parent 1f0b2a8991
commit 3335cacac1
91 changed files with 263 additions and 1150 deletions
-15
View File
@@ -4156,12 +4156,10 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
if (parse->EventSpell(EVENT_SPELL_FADE, this, nullptr, buffs[slot].spellid, export_string, 0) != 0) {
return;
}
#ifdef BOTS
} else if (IsBot()) {
if (parse->EventSpell(EVENT_SPELL_FADE, this, nullptr, buffs[slot].spellid, export_string, 0) != 0) {
return;
}
#endif
}
for (int i=0; i < EFFECT_COUNT; i++)
@@ -4541,9 +4539,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
}
if((IsClient() && !CastToClient()->GetPVP()) ||
(IsPet() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()) ||
#ifdef BOTS
(IsBot() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()) ||
#endif
(IsMerc() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()))
{
EQApplicationPacket *outapp = MakeBuffsPacket();
@@ -6792,11 +6788,9 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id)
bool bDepleted = false;
int buff_max = GetMaxTotalSlots();
#ifdef BOTS
std::string buff_name;
size_t buff_counter = 0;
bool buff_update = false;
#endif
//Spell specific procs [Type 7,10,11]
if (IsValidSpell(spell_id)) {
@@ -6804,11 +6798,9 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id)
if (buffs[d].spellid == spell_id && buffs[d].hit_number > 0 &&
spells[buffs[d].spellid].hit_number_type == static_cast<int>(type)) {
#ifdef BOTS
buff_name = spells[buffs[d].spellid].name;
buff_counter = (buffs[d].hit_number - 1);
buff_update = true;
#endif
if (--buffs[d].hit_number == 0) {
CastOnNumHitFade(buffs[d].spellid);
@@ -6822,12 +6814,9 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id)
} else if (type == NumHit::MatchingSpells) {
if (buff_slot >= 0) {
if (--buffs[buff_slot].hit_number == 0) {
#ifdef BOTS
buff_name = spells[buffs[buff_slot].spellid].name;
buff_counter = (buffs[buff_slot].hit_number - 1);
buff_update = true;
#endif
CastOnNumHitFade(buffs[buff_slot].spellid);
if (!TryFadeEffect(buff_slot))
@@ -6842,11 +6831,9 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id)
if (IsValidSpell(buffs[d].spellid) && buffs[d].hit_number > 0 &&
spells[buffs[d].spellid].hit_number_type == static_cast<int>(type)) {
#ifdef BOTS
buff_name = spells[buffs[d].spellid].name;
buff_counter = (buffs[d].hit_number - 1);
buff_update = true;
#endif
if (--buffs[d].hit_number == 0) {
CastOnNumHitFade(buffs[d].spellid);
@@ -6859,7 +6846,6 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id)
}
}
#ifdef BOTS
if (IsBot() && buff_update) {
auto bot_owner = entity_list.GetBotOwnerByBotEntityID(GetID());
if (bot_owner && bot_owner->GetBotOption(Client::booBuffCounter)) {
@@ -6879,7 +6865,6 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id)
);
}
}
#endif
}
//for some stupid reason SK procs return theirs one base off...