2021-03-25 11L04pm

Spell and Heal Rule added to allow for Bot spell and heal damage to be sent to the Bot Owner's Group.  Also added a check to remove duplicate message for #damage on self.
This commit is contained in:
Neckkola
2021-03-25 23:05:37 -03:00
parent dd1ce19d4f
commit bcf0677656
2 changed files with 33 additions and 3 deletions
+2 -1
View File
@@ -614,7 +614,8 @@ RULE_REAL(Bots, LeashDistance, 562500.0f, "Distance a bot is allowed to travel f
RULE_BOOL(Bots, AllowApplyPoisonCommand, true, "Allows the use of the bot command 'applypoison'")
RULE_BOOL(Bots, AllowApplyPotionCommand, true, "Allows the use of the bot command 'applypotion'")
RULE_BOOL(Bots, RestrictApplyPotionToRogue, true, "Restricts the bot command 'applypotion' to rogue-usable potions (i.e., poisons)")
RULE_BOOL(Bots, DisplayHealDamage, false, "Enables the display of bot heal damage to the client")
RULE_BOOL(Bots, DisplayHealDamage, false, "Enables the display of bot heal damage to the bot owner client")
RULE_BOOL(Bots, DisplaySpellDamage, false, "Enables the display of bot spell damage to the bot owner client")
RULE_CATEGORY_END()
#endif
+31 -2
View File
@@ -3807,7 +3807,20 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
// If this is Damage Shield damage, the correct OP_Damage packets will be sent from Mob::DamageShield, so
// we don't send them here.
if (!FromDamageShield) {
#ifdef BOTS
// If a bot is the attacker, send a damage message ot the Bot Owner
if (spell_id != SPELL_UNKNOWN && damage > 0 && attacker && attacker != this && attacker->IsBot() && RuleB(Bots, DisplaySpellDamage)) {
attacker->CastToBot()->GetBotOwner()->FilteredMessageString(
attacker->CastToBot()->GetBotOwner(),
Chat::DotDamage,
FilterDOT,
OTHER_HIT_DOT,
attacker->GetTarget()->GetCleanName(),
itoa(damage),
attacker->GetCleanName(),
spells[spell_id].name);
}
#endif
entity_list.QueueCloseClients(
this, /* Sender */
outapp, /* packet */
@@ -3819,7 +3832,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
);
//send the damage to ourself if we are a client
if (IsClient()) {
if (IsClient() && spell_id != SPELL_UNKNOWN) { //added !SPELL_UNKNOWN to remove duplicate display for #damage to self
//I dont think any filters apply to damage affecting us
CastToClient()->QueuePacket(outapp);
}
@@ -3849,6 +3862,22 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
spells[spell_id].name /* Message4 */
);
}
#ifdef BOTS
// If a bot is the attacker, send a damage message ot the Bot Owner
else if (spell_id != SPELL_UNKNOWN && attacker->IsBot() && damage > 0 && attacker && attacker !=this && RuleB(Bots, DisplaySpellDamage)) {
attacker->CastToBot()->GetBotOwner()->FilteredMessageString(
attacker->CastToBot()->GetBotOwner(),
Chat::DotDamage,
FilterDOT,
OTHER_HIT_DOT,
attacker->GetTarget()->GetCleanName(),
itoa(damage),
attacker->GetCleanName(),
spells[spell_id].name);
}
#endif
} //end packet sending
}