mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
[Bug Fix] Fix duplicate and missing messages due to innate in spells (#2170)
* [Bug Fix] Fix duplicate and missing messages due to innate skill in spells. * Seperate spell and melee damage range and skip * Refine when innate messages are produced. * Fix magic # (replace with constant)
This commit is contained in:
parent
0e96099b3d
commit
f3e5423677
@ -3675,7 +3675,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
|
||||
|
||||
//we used to do a message to the client, but its gone now.
|
||||
// emote goes with every one ... even npcs
|
||||
entity_list.MessageClose(this, true, RuleI(Range, SpellMessages), Chat::Emote, "%s beams a smile at %s", attacker->GetCleanName(), GetCleanName());
|
||||
entity_list.MessageClose(this, false, RuleI(Range, SpellMessages), Chat::Emote, "%s beams a smile at %s", attacker->GetCleanName(), GetCleanName());
|
||||
}
|
||||
|
||||
// If a client pet is damaged while sitting, stand, fix sit button,
|
||||
@ -4021,20 +4021,47 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
|
||||
// we don't send them here.
|
||||
if (!FromDamageShield) {
|
||||
|
||||
entity_list.QueueCloseClients(
|
||||
this, /* Sender */
|
||||
outapp, /* packet */
|
||||
true, /* Skip Sender */
|
||||
RuleI(Range, SpellMessages),
|
||||
skip, /* Skip this mob */
|
||||
true, /* Packet ACK */
|
||||
filter /* eqFilterType filter */
|
||||
);
|
||||
// Determine message range based on spell/other-damage
|
||||
int range;
|
||||
if (IsValidSpell(spell_id)) {
|
||||
range = RuleI(Range, SpellMessages);
|
||||
}
|
||||
else {
|
||||
range = RuleI(Range, DamageMessages);
|
||||
}
|
||||
|
||||
//send the damage to ourself if we are a client
|
||||
if (IsClient()) {
|
||||
// If an "innate" spell, change to spell type to
|
||||
// produce a spell message. Send to everyone.
|
||||
// This fixes issues with npc-procs like 1002 and 918 which
|
||||
// need to spit out extra spell color.
|
||||
if (IsValidSpell(spell_id) && skill_used == EQ::skills::SkillTigerClaw) {
|
||||
a->type = DamageTypeSpell;
|
||||
entity_list.QueueCloseClients(
|
||||
this, /* Sender */
|
||||
outapp, /* packet */
|
||||
false, /* Skip Sender */
|
||||
range, /* distance packet travels at the speed of sound */
|
||||
0, /* don't skip anyone on spell */
|
||||
true, /* Packet ACK */
|
||||
filter /* eqFilterType filter */
|
||||
);
|
||||
}
|
||||
else {
|
||||
//I dont think any filters apply to damage affecting us
|
||||
CastToClient()->QueuePacket(outapp);
|
||||
if (IsClient()) {
|
||||
CastToClient()->QueuePacket(outapp);
|
||||
}
|
||||
|
||||
// Otherwise, send normal spell or melee message to observers.
|
||||
entity_list.QueueCloseClients(
|
||||
this, /* Sender */
|
||||
outapp, /* packet */
|
||||
true, /* Skip Sender */
|
||||
range, /* distance packet travels at the speed of sound */
|
||||
(IsValidSpell(spell_id) && skill_used != EQ::skills::SkillTigerClaw) ? 0 : skip,
|
||||
true, /* Packet ACK */
|
||||
filter /* eqFilterType filter */
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3509,8 +3509,6 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes
|
||||
if (!IsValidSpell(spell_id))
|
||||
return false;
|
||||
|
||||
bool is_damage_or_lifetap_spell = IsDamageSpell(spell_id) || IsLifetapSpell(spell_id);
|
||||
|
||||
if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id) && !IsEffectInSpell(spell_id, SE_BindSight)) {
|
||||
if(!IsClient() || !CastToClient()->GetGM()) {
|
||||
MessageString(Chat::SpellFailure, SPELL_NO_HOLD);
|
||||
@ -4107,9 +4105,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes
|
||||
if(IsClient()) // send to caster
|
||||
CastToClient()->QueuePacket(action_packet);
|
||||
}
|
||||
// send to people in the area, ignoring caster and target
|
||||
//live dosent send this to anybody but the caster
|
||||
//entity_list.QueueCloseClients(spelltar, action_packet, true, 200, this, true, spelltar->IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS);
|
||||
|
||||
message_packet = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
|
||||
CombatDamage_Struct *cd = (CombatDamage_Struct *)message_packet->pBuffer;
|
||||
cd->target = action->target;
|
||||
@ -4121,7 +4117,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes
|
||||
cd->hit_pitch = action->hit_pitch;
|
||||
cd->damage = 0;
|
||||
|
||||
if(!IsEffectInSpell(spell_id, SE_BindAffinity) && !is_damage_or_lifetap_spell){
|
||||
if (!IsLifetapSpell(spell_id) && !IsEffectInSpell(spell_id, SE_BindAffinity) && !IsAENukeSpell(spell_id) && !IsDamageSpell(spell_id)) {
|
||||
entity_list.QueueCloseClients(
|
||||
spelltar, /* Sender */
|
||||
message_packet, /* Packet */
|
||||
@ -4131,18 +4127,6 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes
|
||||
true, /* Packet ACK */
|
||||
(spellOwner->IsClient() ? FilterPCSpells : FilterNPCSpells) /* Message Filter Type: (8 or 9) */
|
||||
);
|
||||
} else if (is_damage_or_lifetap_spell) {
|
||||
// Sends the client owner a message like "%T staggers"
|
||||
if (spellOwner->IsClient()) {
|
||||
spellOwner->CastToClient()->QueuePacket(message_packet, true,
|
||||
Mob::CLIENT_CONNECTINGALL, FilterPCSpells);
|
||||
}
|
||||
// Show the "you feel your life force drain away" on target client...
|
||||
if (IsLifetapSpell(spell_id) && spelltar->IsClient()) {
|
||||
spelltar->CastToClient()->QueuePacket(message_packet, true,
|
||||
Mob::CLIENT_CONNECTINGALL,
|
||||
(spellOwner->IsClient() ? FilterPCSpells : FilterNPCSpells));
|
||||
}
|
||||
}
|
||||
safe_delete(action_packet);
|
||||
safe_delete(message_packet);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user