Fix an issue where emote messages would overflow the buffer of 256 by increasing the size and changing some of the initialization

Added a custom Health Update message that will display in the middle of the players screen, to enable this server wide you must enable rule 'Character:MarqueeHPUpdates'
(Haynar) Fixed some runspeed issues with Perl and LUA scripts
(Haynar) Updated #showstats and #npcstats for new speed calcs to display speeds again in familiar float format.
(Haynar) Improved client movement while AI Controlled, such as feared and charmed.  Movement will be much smoother from clients perspective.
This commit is contained in:
Akkadius
2015-07-01 01:23:00 -05:00
parent b71e856c8c
commit 2bf49be855
9 changed files with 33 additions and 1 deletions
+3
View File
@@ -3582,6 +3582,9 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
//final damage has been determined.
SetHP(GetHP() - damage);
if (IsClient())
this->CastToClient()->SendHPUpdateMarquee();
if(HasDied()) {
bool IsSaved = false;
+13
View File
@@ -8639,3 +8639,16 @@ void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold,
QueuePacket(outapp, false, Client::CLIENT_CONNECTED);
safe_delete(outapp);
}
void Client::SendHPUpdateMarquee(){
if (!RuleB(Character, MarqueeHPUpdates))
return;
/* Health Update Marquee Display: Custom*/
uint32 health_percentage = (uint32)(this->cur_hp * 100 / this->max_hp);
if (health_percentage == 100)
return;
std::string health_update_notification = StringFormat("Health: %u%%", health_percentage);
this->SendMarqueeMessage(15, 510, 0, 3000, 3000, health_update_notification);
}
+3
View File
@@ -1261,6 +1261,9 @@ public:
void QuestReward(Mob* target, uint32 copper = 0, uint32 silver = 0, uint32 gold = 0, uint32 platinum = 0, uint32 itemid = 0, uint32 exp = 0, bool faction = false);
void ResetHPUpdateTimer() { hpupdate_timer.Start(); }
void SendHPUpdateMarquee();
protected:
friend class Mob;
void CalcItemBonuses(StatBonuses* newbon);
+3
View File
@@ -1357,6 +1357,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 || dospam)) {
this->CastToClient()->SendHPUpdateMarquee();
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;