mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-25 18:47:35 +00:00
Add Bot Heal Message Display
Creates a new rule to display Bot heal messages to the Bot Owner
This commit is contained in:
@@ -614,6 +614,7 @@ 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, 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, 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, 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_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+61
-17
@@ -3853,7 +3853,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
|
void Mob::HealDamage(uint32 amount, Mob* caster, uint16 spell_id)
|
||||||
{
|
{
|
||||||
int32 maxhp = GetMaxHP();
|
int32 maxhp = GetMaxHP();
|
||||||
int32 curhp = GetHP();
|
int32 curhp = GetHP();
|
||||||
@@ -3868,15 +3868,16 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
|
|||||||
if (caster) {
|
if (caster) {
|
||||||
if (IsBuffSpell(spell_id)) { // hots
|
if (IsBuffSpell(spell_id)) { // hots
|
||||||
// message to caster
|
// message to caster
|
||||||
if (caster->IsClient() && caster == this) {
|
if ((caster->IsClient() && caster == this)) {
|
||||||
if (caster->CastToClient()->ClientVersionBit() & EQ::versions::maskSoFAndLater)
|
if (caster->CastToClient()->ClientVersionBit() & EQ::versions::maskSoFAndLater) {
|
||||||
FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime,
|
FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime,
|
||||||
HOT_HEAL_SELF, itoa(acthealed), spells[spell_id].name);
|
HOT_HEAL_SELF, itoa(acthealed), spells[spell_id].name);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime,
|
FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime,
|
||||||
YOU_HEALED, GetCleanName(), itoa(acthealed));
|
YOU_HEALED, GetCleanName(), itoa(acthealed));
|
||||||
}
|
}
|
||||||
else if (caster->IsClient() && caster != this) {
|
else if ((caster->IsClient() && caster != this)) {
|
||||||
if (caster->CastToClient()->ClientVersionBit() & EQ::versions::maskSoFAndLater)
|
if (caster->CastToClient()->ClientVersionBit() & EQ::versions::maskSoFAndLater)
|
||||||
caster->FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime,
|
caster->FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime,
|
||||||
HOT_HEAL_OTHER, GetCleanName(), itoa(acthealed),
|
HOT_HEAL_OTHER, GetCleanName(), itoa(acthealed),
|
||||||
@@ -3885,8 +3886,35 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
|
|||||||
caster->FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime,
|
caster->FilteredMessageString(caster, Chat::NonMelee, FilterHealOverTime,
|
||||||
YOU_HEAL, GetCleanName(), itoa(acthealed));
|
YOU_HEAL, GetCleanName(), itoa(acthealed));
|
||||||
}
|
}
|
||||||
|
#ifdef BOTS
|
||||||
|
if (caster->IsBot() && this != caster->CastToBot()->GetBotOwner() && RuleB(Bots, DisplayHealDamage)) {
|
||||||
|
|
||||||
|
|
||||||
|
// %1 healed %2 for %3 hit points from %4's %5
|
||||||
|
const char s2[]{ " healed " };
|
||||||
|
const char s4[]{ " for " };
|
||||||
|
const char s6[]{ " hit points from " };
|
||||||
|
const char s8[]{ "'s " };
|
||||||
|
|
||||||
|
caster->CastToBot()->GetBotOwner()->FilteredMessageString(
|
||||||
|
caster->CastToBot()->GetBotOwner(), //send to the Bot Owner's client
|
||||||
|
Chat::NonMelee,
|
||||||
|
FilterHealOverTime,
|
||||||
|
GENERIC_9_STRINGS, //using generic for testing purposes %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
caster->GetCleanName(), // %1 caster (bot's) name
|
||||||
|
s2, // %2
|
||||||
|
this->GetCleanName(), // %3 caster (bot's) target
|
||||||
|
s4, // %4
|
||||||
|
itoa(acthealed), // %5 amount healed
|
||||||
|
s6, // %6
|
||||||
|
caster->GetCleanName(), // %7 caster (bot's) name
|
||||||
|
s8, // %8
|
||||||
|
spells[spell_id].name // %9 spell name
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif // BOTS
|
||||||
// message to target
|
// message to target
|
||||||
if (IsClient() && caster != this) {
|
if ((IsClient() && caster != this)) {
|
||||||
if (CastToClient()->ClientVersionBit() & EQ::versions::maskSoFAndLater)
|
if (CastToClient()->ClientVersionBit() & EQ::versions::maskSoFAndLater)
|
||||||
FilteredMessageString(this, Chat::NonMelee, FilterHealOverTime,
|
FilteredMessageString(this, Chat::NonMelee, FilterHealOverTime,
|
||||||
HOT_HEALED_OTHER, caster->GetCleanName(),
|
HOT_HEALED_OTHER, caster->GetCleanName(),
|
||||||
@@ -3899,25 +3927,41 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
|
|||||||
else { // normal heals
|
else { // normal heals
|
||||||
FilteredMessageString(caster, Chat::NonMelee, FilterSpellDamage,
|
FilteredMessageString(caster, Chat::NonMelee, FilterSpellDamage,
|
||||||
YOU_HEALED, caster->GetCleanName(), itoa(acthealed));
|
YOU_HEALED, caster->GetCleanName(), itoa(acthealed));
|
||||||
|
#ifndef BOTS
|
||||||
if (caster != this)
|
if (caster != this)
|
||||||
caster->FilteredMessageString(caster, Chat::NonMelee, FilterSpellDamage,
|
caster->FilteredMessageString(caster, Chat::NonMelee, FilterSpellDamage,
|
||||||
YOU_HEAL, GetCleanName(), itoa(acthealed));
|
YOU_HEAL, GetCleanName(), itoa(acthealed));
|
||||||
}
|
}
|
||||||
}
|
#endif
|
||||||
else {
|
#ifdef BOTS
|
||||||
Message(Chat::NonMelee, "You have been healed for %d points of damage.", acthealed);
|
if (caster->IsBot() && RuleB(Bots, DisplayHealDamage)) {
|
||||||
}
|
caster->CastToBot()->GetBotOwner()->FilteredMessageString(caster->CastToBot()->GetBotOwner(),
|
||||||
}
|
Chat::NonMelee, FilterSpellDamage, GENERIC_9_STRINGS,
|
||||||
|
caster->GetCleanName(), " healed ", this->GetCleanName(), " for ", itoa(acthealed), " hit points.", " ", " ", " ");
|
||||||
|
}
|
||||||
|
else if (caster != this) {
|
||||||
|
caster->FilteredMessageString(caster, Chat::NonMelee, FilterSpellDamage,
|
||||||
|
YOU_HEAL, GetCleanName(), itoa(acthealed));
|
||||||
|
|
||||||
if (curhp < maxhp) {
|
}
|
||||||
if ((curhp + amount) > maxhp)
|
}
|
||||||
curhp = maxhp;
|
#endif // BOTS
|
||||||
else
|
|
||||||
curhp += amount;
|
|
||||||
SetHP(curhp);
|
|
||||||
|
|
||||||
SendHPUpdate();
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Message(Chat::NonMelee, "You have been healed for %d points of damage.", acthealed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (curhp < maxhp) {
|
||||||
|
if ((curhp + amount) > maxhp)
|
||||||
|
curhp = maxhp;
|
||||||
|
else
|
||||||
|
curhp += amount;
|
||||||
|
SetHP(curhp);
|
||||||
|
|
||||||
|
SendHPUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//proc chance includes proc bonus
|
//proc chance includes proc bonus
|
||||||
|
|||||||
Reference in New Issue
Block a user