From f0e9712b6c11ab6492e586edcc02c4f0cc6c114b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 26 Oct 2023 10:50:29 +0800 Subject: [PATCH] 1 --- server/gameserver/creature.cc | 6 ++++++ server/gameserver/creature.h | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 863d5f3c..b982061e 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -3538,3 +3538,9 @@ void Creature::ClearIgnoreTarget() DelIgnoreTarget(id); } } + +void Creature::SetLastAttacker(CreatureWeakPtr& attacker) +{ + last_attacker_ = attacker; + last_beattack_frameno_ = room->GetFrameNo(); +} diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index d6483364..2bf4ed3e 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -374,6 +374,10 @@ class Creature : public MoveableEntity void DelIgnoreTarget(int target_uniid); bool IsIgnoreTarget(int target_uniid); void ClearIgnoreTarget(); + void SetLastAttacker(CreatureWeakPtr& attacker); + CreatureWeakPtr& GetLastAttacker() { return last_attacker_; } + long long GetLastBeAttackFrameNo() { return last_beattack_frameno_; } + int GetLastAttackerReviveTimes() { return last_attacker_revive_times_; } protected: virtual void OnBuffRemove(Buff& buff); @@ -461,6 +465,10 @@ private: std::map ignore_target_hash_; + CreatureWeakPtr last_attacker_; + int last_attacker_revive_times_ = 0; + long long last_beattack_frameno_; + friend class Buff; friend class AddInventoryBuff; friend class BePullBuff;