mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 23:20:25 +00:00
Implement number of hit indicators for UF and RoF
There is a small display bug with the initial cast of the spell, but it updates quickly enough that it shouldn't be too noticeable This still needs to be fixed though Changed SendBuffDurationPacket to take a Buffs_Struct by reference to allow more of the data to be obtained without more params Added Client::SendBuffNumHitPacket(Buffs_Struct &buff, int slot)
This commit is contained in:
+2
-1
@@ -896,7 +896,8 @@ public:
|
||||
|
||||
//This is used to later set the buff duration of the spell, in slot to duration.
|
||||
//Doesn't appear to work directly after the client recieves an action packet.
|
||||
void SendBuffDurationPacket(uint16 spell_id, int duration, int inlevel);
|
||||
void SendBuffDurationPacket(Buffs_Struct &buff);
|
||||
void SendBuffNumHitPacket(Buffs_Struct &buff, int slot);
|
||||
|
||||
void ProcessInspectRequest(Client* requestee, Client* requester);
|
||||
bool ClientFinishedLoading() { return (conn_state == ClientConnectFinished); }
|
||||
|
||||
+31
-39
@@ -3395,7 +3395,7 @@ void Mob::BuffProcess()
|
||||
{
|
||||
if(buffs[buffs_i].UpdateClient == true)
|
||||
{
|
||||
CastToClient()->SendBuffDurationPacket(buffs[buffs_i].spellid, buffs[buffs_i].ticsremaining, buffs[buffs_i].casterlevel);
|
||||
CastToClient()->SendBuffDurationPacket(buffs[buffs_i]);
|
||||
buffs[buffs_i].UpdateClient = false;
|
||||
}
|
||||
}
|
||||
@@ -5559,64 +5559,56 @@ void Mob::CheckNumHitsRemaining(uint8 type, uint32 buff_slot, uint16 spell_id)
|
||||
uint32 buff_max = GetMaxTotalSlots();
|
||||
|
||||
//Spell specific procs [Type 7,10,11]
|
||||
if (IsValidSpell(spell_id)){
|
||||
|
||||
for(uint32 d = 0; d < buff_max; d++) {
|
||||
|
||||
if((buffs[d].spellid == spell_id) && (buffs[d].numhits > 0) && (spells[buffs[d].spellid].numhitstype == type)){
|
||||
|
||||
if(--buffs[d].numhits == 0) {
|
||||
if (IsValidSpell(spell_id)) {
|
||||
for (uint32 d = 0; d < buff_max; d++) {
|
||||
if (buffs[d].spellid == spell_id && buffs[d].numhits > 0 &&
|
||||
spells[buffs[d].spellid].numhitstype == type) {
|
||||
if (--buffs[d].numhits == 0) {
|
||||
CastOnNumHitFade(buffs[d].spellid);
|
||||
if(!TryFadeEffect(d))
|
||||
if (!TryFadeEffect(d))
|
||||
BuffFadeBySlot(d, true);
|
||||
} else if (IsClient()) { // still have numhits and client, update
|
||||
CastToClient()->SendBuffNumHitPacket(buffs[d], d);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (type == 7){
|
||||
if (buff_slot > 0){
|
||||
|
||||
if(--buffs[buff_slot].numhits == 0) {
|
||||
} else if (type == 7) {
|
||||
if (buff_slot > 0) {
|
||||
if (--buffs[buff_slot].numhits == 0) {
|
||||
CastOnNumHitFade(buffs[buff_slot].spellid);
|
||||
if(!TryFadeEffect(buff_slot))
|
||||
if (!TryFadeEffect(buff_slot))
|
||||
BuffFadeBySlot(buff_slot , true);
|
||||
}
|
||||
} else if (IsClient()) { // still have numhits and client, update
|
||||
CastToClient()->SendBuffNumHitPacket(buffs[buff_slot], buff_slot);
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
for(int d = 0; d < buff_max; d++) {
|
||||
|
||||
if(!m_spellHitsLeft[d])
|
||||
} else {
|
||||
for (int d = 0; d < buff_max; d++) {
|
||||
if (!m_spellHitsLeft[d])
|
||||
continue;
|
||||
|
||||
if ((IsValidSpell(buffs[d].spellid)) && (m_spellHitsLeft[d] == buffs[d].spellid)) {
|
||||
if(--buffs[d].numhits == 0) {
|
||||
if (IsValidSpell(buffs[d].spellid) && m_spellHitsLeft[d] == buffs[d].spellid) {
|
||||
if (--buffs[d].numhits == 0) {
|
||||
CastOnNumHitFade(buffs[d].spellid);
|
||||
m_spellHitsLeft[d] = 0;
|
||||
if(!TryFadeEffect(d))
|
||||
if (!TryFadeEffect(d))
|
||||
BuffFadeBySlot(d, true);
|
||||
} else if (IsClient()) { // still have numhits and client, update
|
||||
CastToClient()->SendBuffNumHitPacket(buffs[d], d);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else{
|
||||
|
||||
for(uint32 d = 0; d < buff_max; d++) {
|
||||
|
||||
if((IsValidSpell(buffs[d].spellid)) && (buffs[d].numhits > 0) && (spells[buffs[d].spellid].numhitstype == type)){
|
||||
|
||||
if(--buffs[d].numhits == 0) {
|
||||
} else {
|
||||
for (uint32 d = 0; d < buff_max; d++) {
|
||||
if (IsValidSpell(buffs[d].spellid) && buffs[d].numhits > 0 &&
|
||||
spells[buffs[d].spellid].numhitstype == type) {
|
||||
if (--buffs[d].numhits == 0) {
|
||||
CastOnNumHitFade(buffs[d].spellid);
|
||||
if(!TryFadeEffect(d)){
|
||||
if (!TryFadeEffect(d))
|
||||
BuffFadeBySlot(d, true);
|
||||
}
|
||||
} else if (IsClient()) { // still have numhits and client, update
|
||||
CastToClient()->SendBuffNumHitPacket(buffs[d], d);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+30
-8
@@ -5164,20 +5164,40 @@ void Mob::_StopSong()
|
||||
//Thus I use this in the buff process to update the correct duration once after casting
|
||||
//this allows AAs and focus effects that increase buff duration to work correctly, but could probably
|
||||
//be used for other things as well
|
||||
void Client::SendBuffDurationPacket(uint16 spell_id, int duration, int inlevel)
|
||||
void Client::SendBuffDurationPacket(Buffs_Struct &buff)
|
||||
{
|
||||
EQApplicationPacket* outapp;
|
||||
outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffFade_Struct));
|
||||
SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*) outapp->pBuffer;
|
||||
|
||||
sbf->entityid = GetID();
|
||||
sbf->slot=2;
|
||||
sbf->spellid=spell_id;
|
||||
sbf->slotid=0;
|
||||
sbf->effect = inlevel > 0 ? inlevel : GetLevel();
|
||||
sbf->level = inlevel > 0 ? inlevel : GetLevel();
|
||||
sbf->slot = 2;
|
||||
sbf->spellid = buff.spellid;
|
||||
sbf->slotid = 0;
|
||||
sbf->effect = buff.casterlevel > 0 ? buff.casterlevel : GetLevel();
|
||||
sbf->level = buff.casterlevel > 0 ? buff.casterlevel : GetLevel();
|
||||
sbf->bufffade = 0;
|
||||
sbf->duration = duration;
|
||||
sbf->duration = buff.ticsremaining;
|
||||
sbf->num_hits = buff.numhits;
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
void Client::SendBuffNumHitPacket(Buffs_Struct &buff, int slot)
|
||||
{
|
||||
// UF+ use this packet
|
||||
if (GetClientVersion() < EQClientUnderfoot)
|
||||
return;
|
||||
EQApplicationPacket *outapp;
|
||||
outapp = new EQApplicationPacket(OP_BuffCreate, sizeof(BuffIcon_Struct) + sizeof(BuffIconEntry_Struct));
|
||||
BuffIcon_Struct *bi = (BuffIcon_Struct *)outapp->pBuffer;
|
||||
bi->entity_id = GetID();
|
||||
bi->count = 1;
|
||||
bi->all_buffs = 0;
|
||||
|
||||
bi->entries[0].buff_slot = slot;
|
||||
bi->entries[0].spell_id = buff.spellid;
|
||||
bi->entries[0].tics_remaining = buff.ticsremaining;
|
||||
bi->entries[0].num_hits = buff.numhits;
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
@@ -5252,6 +5272,7 @@ EQApplicationPacket *Mob::MakeBuffsPacket(bool for_target)
|
||||
BuffIcon_Struct *buff = (BuffIcon_Struct*)outapp->pBuffer;
|
||||
buff->entity_id = GetID();
|
||||
buff->count = count;
|
||||
buff->all_buffs = 1;
|
||||
|
||||
uint32 index = 0;
|
||||
for(unsigned int i = 0; i < buff_count; ++i)
|
||||
@@ -5261,6 +5282,7 @@ EQApplicationPacket *Mob::MakeBuffsPacket(bool for_target)
|
||||
buff->entries[index].buff_slot = i;
|
||||
buff->entries[index].spell_id = buffs[i].spellid;
|
||||
buff->entries[index].tics_remaining = buffs[i].ticsremaining;
|
||||
buff->entries[index].num_hits = buffs[i].numhits;
|
||||
++index;
|
||||
}
|
||||
}
|
||||
@@ -5278,7 +5300,7 @@ void Mob::BuffModifyDurationBySpellID(uint16 spell_id, int32 newDuration)
|
||||
buffs[i].ticsremaining = newDuration;
|
||||
if(IsClient())
|
||||
{
|
||||
CastToClient()->SendBuffDurationPacket(buffs[i].spellid, buffs[i].ticsremaining, buffs[i].casterlevel);
|
||||
CastToClient()->SendBuffDurationPacket(buffs[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user