Skip to content

Commit

Permalink
[Bug Fix] Patch for recent change to DEATH (#4032)
Browse files Browse the repository at this point in the history
  • Loading branch information
noudess authored Jan 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent f98c79f commit 5377bb3
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions zone/attack.cpp
Original file line number Diff line number Diff line change
@@ -2454,6 +2454,8 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
}
}

auto* killer = GetHateDamageTop(this);

entity_list.RemoveFromTargets(this, p_depop);

if (p_depop) {
@@ -2509,7 +2511,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
Mob* give_exp = hate_list.GetDamageTopOnHateList(this);

if (give_exp) {
give_exp = killer_mob;
give_exp = killer;
}

if (give_exp && give_exp->HasOwner()) {
@@ -2795,18 +2797,18 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
(!is_merchant || allow_merchant_corpse) &&
(
(
killer_mob &&
killer &&
(
killer_mob->IsClient() ||
killer->IsClient() ||
(
killer_mob->HasOwner() &&
killer_mob->GetUltimateOwner()->IsClient()
killer->HasOwner() &&
killer->GetUltimateOwner()->IsClient()
) ||
(
killer_mob->IsNPC() &&
killer_mob->CastToNPC()->GetSwarmInfo() &&
killer_mob->CastToNPC()->GetSwarmInfo()->GetOwner() &&
killer_mob->CastToNPC()->GetSwarmInfo()->GetOwner()->IsClient()
killer->IsNPC() &&
killer->CastToNPC()->GetSwarmInfo() &&
killer->CastToNPC()->GetSwarmInfo()->GetOwner() &&
killer->CastToNPC()->GetSwarmInfo()->GetOwner()->IsClient()
)
)
) ||
@@ -2815,13 +2817,13 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
)
)
) {
if (killer_mob) {
if (killer_mob->GetOwner() != 0 && killer_mob->GetOwner()->IsClient()) {
killer_mob = killer_mob->GetOwner();
if (killer) {
if (killer->GetOwner() != 0 && killer->GetOwner()->IsClient()) {
killer = killer->GetOwner();
}

if (killer_mob->IsClient() && !killer_mob->CastToClient()->GetGM()) {
CheckTrivialMinMaxLevelDrop(killer_mob);
if (killer->IsClient() && !killer->CastToClient()->GetGM()) {
CheckTrivialMinMaxLevelDrop(killer);
}
}

@@ -2854,10 +2856,10 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
SetID(0);
ApplyIllusionToCorpse(illusion_spell_id, corpse);

if (killer_mob && killer_mob->IsClient()) {
corpse->AllowPlayerLoot(killer_mob, 0);
if (killer_mob->IsGrouped()) {
Group* g = entity_list.GetGroupByClient(killer_mob->CastToClient());
if (killer && killer->IsClient()) {
corpse->AllowPlayerLoot(killer, 0);
if (killer->IsGrouped()) {
Group* g = entity_list.GetGroupByClient(killer->CastToClient());
if (g) {
uint8 slot_id = 0;

@@ -2869,8 +2871,8 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
slot_id++;
}
}
} else if (killer_mob->IsRaidGrouped()) {
Raid* r = entity_list.GetRaidByClient(killer_mob->CastToClient());
} else if (killer->IsRaidGrouped()) {
Raid* r = entity_list.GetRaidByClient(killer->CastToClient());
if (r) {
uint8 slot_id = 0;

0 comments on commit 5377bb3

Please sign in to comment.