Some servers apparently relied on the HP update spam

This commit is contained in:
Michael Cook (mackal) 2015-06-30 20:35:28 -04:00
parent 56b57d2ca6
commit ea18238a12
3 changed files with 7 additions and 4 deletions

View File

@ -113,6 +113,7 @@ RULE_INT(Character, TradeskillUpMakePoison, 2) // Make Poison skillup rate adjus
RULE_INT(Character, TradeskillUpPottery, 4) // Pottery skillup rate adjust. Lower is faster.
RULE_INT(Character, TradeskillUpResearch, 1) // Research skillup rate adjust. Lower is faster.
RULE_INT(Character, TradeskillUpTinkering, 2) // Tinkering skillup rate adjust. Lower is faster.
RULE_BOOL(Character, SpamHPUpdates, false) // if your server has stupid amounts of HP that causes client display issues, turn this on!
RULE_CATEGORY_END()
RULE_CATEGORY(Mercs)

View File

@ -3693,11 +3693,11 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
//send an HP update if we are hurt
if(GetHP() < GetMaxHP())
SendHPUpdate(!iBuffTic); // the OP_Damage actually updates the client in these cases, so we skill them
SendHPUpdate(!iBuffTic); // the OP_Damage actually updates the client in these cases, so we skip the HP update for them
} //end `if damage was done`
//send damage packet...
if(!iBuffTic) { //buff ticks do not send damage, instead they just call SendHPUpdate(), which is done below
if(!iBuffTic) { //buff ticks do not send damage, instead they just call SendHPUpdate(), which is done above
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
CombatDamage_Struct* a = (CombatDamage_Struct*)outapp->pBuffer;
a->target = GetID();

View File

@ -1354,8 +1354,9 @@ void Mob::SendHPUpdate(bool skip_self)
}
}
bool dospam = RuleB(Character, SpamHPUpdates);
// send to self - we need the actual hps here
if(IsClient() && !skip_self) {
if(IsClient() && (!skip_self || dospam)) {
EQApplicationPacket* hp_app2 = new EQApplicationPacket(OP_HPUpdate,sizeof(SpawnHPUpdate_Struct));
SpawnHPUpdate_Struct* ds = (SpawnHPUpdate_Struct*)hp_app2->pBuffer;
ds->cur_hp = CastToClient()->GetHP() - itembonuses.HP;
@ -1364,7 +1365,8 @@ void Mob::SendHPUpdate(bool skip_self)
CastToClient()->QueuePacket(hp_app2);
safe_delete(hp_app2);
}
ResetHPUpdateTimer(); // delay the timer
if (!dospam)
ResetHPUpdateTimer(); // delay the timer
}
// this one just warps the mob to the current location