mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-13 01:32:25 +00:00
Fix double damaging spell messages to non-attacked and non-attacker
With handling for client attacker and pets thanks to @noudess
This commit is contained in:
parent
3e98e60877
commit
60e194e32b
@ -3426,6 +3426,8 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
|||||||
bool isproc, int level_override)
|
bool isproc, int level_override)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
bool isDamageOrLifetapSpell = IsDamageSpell(spell_id) || IsLifetapSpell(spell_id);
|
||||||
|
|
||||||
// well we can't cast a spell on target without a target
|
// well we can't cast a spell on target without a target
|
||||||
if(!spelltar)
|
if(!spelltar)
|
||||||
{
|
{
|
||||||
@ -3967,9 +3969,6 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
|||||||
// send to people in the area, ignoring caster and target
|
// send to people in the area, ignoring caster and target
|
||||||
//live dosent send this to anybody but the caster
|
//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);
|
//entity_list.QueueCloseClients(spelltar, action_packet, true, 200, this, true, spelltar->IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS);
|
||||||
|
|
||||||
// TEMPORARY - this is the message for the spell.
|
|
||||||
// double message on effects that use ChangeHP - working on this
|
|
||||||
message_packet = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
|
message_packet = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
|
||||||
CombatDamage_Struct *cd = (CombatDamage_Struct *)message_packet->pBuffer;
|
CombatDamage_Struct *cd = (CombatDamage_Struct *)message_packet->pBuffer;
|
||||||
cd->target = action->target;
|
cd->target = action->target;
|
||||||
@ -3980,7 +3979,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
|||||||
cd->hit_heading = action->hit_heading;
|
cd->hit_heading = action->hit_heading;
|
||||||
cd->hit_pitch = action->hit_pitch;
|
cd->hit_pitch = action->hit_pitch;
|
||||||
cd->damage = 0;
|
cd->damage = 0;
|
||||||
if(!IsEffectInSpell(spell_id, SE_BindAffinity)){
|
if(!IsEffectInSpell(spell_id, SE_BindAffinity) && !isDamageOrLifetapSpell){
|
||||||
entity_list.QueueCloseClients(
|
entity_list.QueueCloseClients(
|
||||||
spelltar, /* Sender */
|
spelltar, /* Sender */
|
||||||
message_packet, /* Packet */
|
message_packet, /* Packet */
|
||||||
@ -3990,6 +3989,19 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
|||||||
true, /* Packet ACK */
|
true, /* Packet ACK */
|
||||||
(spelltar->IsClient() ? FilterPCSpells : FilterNPCSpells) /* Message Filter Type: (8 or 9) */
|
(spelltar->IsClient() ? FilterPCSpells : FilterNPCSpells) /* Message Filter Type: (8 or 9) */
|
||||||
);
|
);
|
||||||
|
} else if (isDamageOrLifetapSpell &&
|
||||||
|
(IsClient() ||
|
||||||
|
(HasOwner() &&
|
||||||
|
GetOwner()->IsClient()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
(HasOwner() ? GetOwner() : this)->CastToClient()->QueuePacket(
|
||||||
|
message_packet,
|
||||||
|
true,
|
||||||
|
Mob::CLIENT_CONNECTINGALL,
|
||||||
|
(spelltar->IsClient() ? FilterPCSpells : FilterNPCSpells)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
safe_delete(action_packet);
|
safe_delete(action_packet);
|
||||||
safe_delete(message_packet);
|
safe_delete(message_packet);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user