From 884692756adb4b33b01ff55cedc1943b8bda666d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 3 Nov 2023 13:10:55 +0800 Subject: [PATCH] 1 --- server/gameserver/buff/cond_add.cc | 26 ++++++++++++++++++++++++++ server/gameserver/buff/cond_add.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/server/gameserver/buff/cond_add.cc b/server/gameserver/buff/cond_add.cc index 0273c1a2..bbacb104 100644 --- a/server/gameserver/buff/cond_add.cc +++ b/server/gameserver/buff/cond_add.cc @@ -54,6 +54,11 @@ void CondAddBuff::Activate() ProcShot(); } break; + case CondAddBuff_e::kFlyDestory: + { + ProcFlyDestory(); + } + break; default: { } @@ -375,3 +380,24 @@ void CondAddBuff::ProcShot() ) ); } + +void CondAddBuff::ProcFlyDestory() +{ + auto context = A8_MAKE_ANON_STRUCT_SHARED + ( + ); + + event_handlers_.push_back + ( + owner->GetTrigger()->AddListener + ( + kFlyHookDestoryEvent, + [this, context] + (const a8::Args& args) + { + if (!owner->dead) { + owner->TryAddBuff(owner, meta->_int_buff_param1, skill_meta); + } + }) + ); +} diff --git a/server/gameserver/buff/cond_add.h b/server/gameserver/buff/cond_add.h index 3298382c..1499dd02 100644 --- a/server/gameserver/buff/cond_add.h +++ b/server/gameserver/buff/cond_add.h @@ -12,6 +12,7 @@ A8_DECLARE_CLASS_ENUM(CondAddBuff_e, int, kLimitTimeKillTarget = 22, kReload = 23, kShot = 24, + kFlyDestory = 25, kEnd ); @@ -31,5 +32,6 @@ class CondAddBuff : public Buff void ProcLimitTimeKillTarget(); void ProcReload(); void ProcShot(); + void ProcFlyDestory(); };