[Bots] Update Bot Heal & Damage methods to more closely match Clients + Bugfixes (#2045)

* - Fixed Bots Spell Damage being negative under some circumstances (heal target)
- Allow Bots to send non-melee damage reports in the same manner as Clients
- Refactor\Update Bots Spell Damage & Heal calculations to match current state of Clients.
- Allow Bots to actually utilize Spell Damage and Heal Amount stats

* Don't send packets to bots

* remove random tab

* align text lol
This commit is contained in:
catapultam-habeo
2022-03-11 15:28:00 -08:00
committed by GitHub
parent 3ed6663c4c
commit abcf8cbce1
2 changed files with 157 additions and 82 deletions
+5 -5
View File
@@ -1709,7 +1709,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQ::skills::Skill
return false;
}
if (killerMob && killerMob->IsClient() && (spell != SPELL_UNKNOWN) && damage > 0) {
if (killerMob && (killerMob->IsClient() || killerMob->IsBot()) && (spell != SPELL_UNKNOWN) && damage > 0) {
char val1[20] = { 0 };
entity_list.MessageCloseString(
@@ -2293,7 +2293,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
return false;
}
if (killer_mob->IsClient() && (spell != SPELL_UNKNOWN) && damage > 0) {
if ((killer_mob->IsClient() || killer_mob->IsBot()) && (spell != SPELL_UNKNOWN) && damage > 0) {
char val1[20] = { 0 };
entity_list.MessageCloseString(
@@ -3935,9 +3935,8 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
}
else {
//attacker is not a pet, send to the attacker
//if the attacker is a client, try them with the correct filter
if (attacker && attacker->IsClient()) {
if (attacker && (attacker->IsClient() || attacker->IsBot())) {
if ((spell_id != SPELL_UNKNOWN || FromDamageShield) && damage > 0) {
//special crap for spell damage, looks hackish to me
char val1[20] = { 0 };
@@ -3958,7 +3957,8 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
);
}
}
else {
// Only try to queue these packets to a client
else if (attacker && (attacker->IsClient())) {
if (damage > 0) {
if (spell_id != SPELL_UNKNOWN)
filter = iBuffTic ? FilterDOT : FilterSpellDamage;