mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Send caster name in buff packets for UF+
Currently the names only show for inspecting via Target Window because we send buff packets in the wrong order and there is a dependency on them being correct for self that isn't present for target window.
This commit is contained in:
@@ -137,6 +137,15 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
buffs[buffslot].magic_rune = 0;
|
||||
buffs[buffslot].numhits = 0;
|
||||
|
||||
if (spells[spell_id].numhits > 0) {
|
||||
|
||||
int numhit = spells[spell_id].numhits;
|
||||
|
||||
numhit += numhit * caster->GetFocusEffect(focusFcLimitUse, spell_id) / 100;
|
||||
numhit += caster->GetFocusEffect(focusIncreaseNumHits, spell_id);
|
||||
buffs[buffslot].numhits = numhit;
|
||||
}
|
||||
|
||||
if (spells[spell_id].EndurUpkeep > 0)
|
||||
SetEndurUpkeep(true);
|
||||
|
||||
@@ -184,14 +193,6 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
}
|
||||
}
|
||||
|
||||
if(spells[spell_id].numhits > 0 && buffslot >= 0){
|
||||
|
||||
int numhit = spells[spell_id].numhits;
|
||||
|
||||
numhit += numhit*caster->GetFocusEffect(focusFcLimitUse, spell_id)/100;
|
||||
numhit += caster->GetFocusEffect(focusIncreaseNumHits, spell_id);
|
||||
buffs[buffslot].numhits = numhit;
|
||||
}
|
||||
|
||||
if (!IsPowerDistModSpell(spell_id))
|
||||
SetSpellPowerDistanceMod(0);
|
||||
|
||||
+7
-2
@@ -3309,8 +3309,8 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
|
||||
|
||||
buffs[emptyslot].spellid = spell_id;
|
||||
buffs[emptyslot].casterlevel = caster_level;
|
||||
if (caster && caster->IsClient())
|
||||
strcpy(buffs[emptyslot].caster_name, caster->GetName());
|
||||
if (caster && !caster->IsAura()) // maybe some other things we don't want to ...
|
||||
strcpy(buffs[emptyslot].caster_name, caster->GetCleanName());
|
||||
else
|
||||
memset(buffs[emptyslot].caster_name, 0, 64);
|
||||
buffs[emptyslot].casterid = caster ? caster->GetID() : 0;
|
||||
@@ -5548,6 +5548,8 @@ void Client::SendBuffNumHitPacket(Buffs_Struct &buff, int slot)
|
||||
bi->entries[0].spell_id = buff.spellid;
|
||||
bi->entries[0].tics_remaining = buff.ticsremaining;
|
||||
bi->entries[0].num_hits = buff.numhits;
|
||||
strn0cpy(bi->entries[0].caster, buff.caster_name, 64);
|
||||
bi->name_lengths = strlen(bi->entries[0].caster);
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
@@ -5633,6 +5635,7 @@ EQApplicationPacket *Mob::MakeBuffsPacket(bool for_target)
|
||||
else
|
||||
buff->type = 0;
|
||||
|
||||
buff->name_lengths = 0; // hacky shit
|
||||
uint32 index = 0;
|
||||
for(int i = 0; i < buff_count; ++i)
|
||||
{
|
||||
@@ -5642,6 +5645,8 @@ EQApplicationPacket *Mob::MakeBuffsPacket(bool for_target)
|
||||
buff->entries[index].spell_id = buffs[i].spellid;
|
||||
buff->entries[index].tics_remaining = buffs[i].ticsremaining;
|
||||
buff->entries[index].num_hits = buffs[i].numhits;
|
||||
strn0cpy(buff->entries[index].caster, buffs[i].caster_name, 64);
|
||||
buff->name_lengths += strlen(buff->entries[index].caster);
|
||||
++index;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user