From e93d8321017c7c3b80dc92fcb70a5b5175935aa2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 21 May 2024 17:01:37 +0800 Subject: [PATCH] 1 --- server/gameserver/ability.cc | 2 +- server/gameserver/buff/callfunc.cc | 25 +++++++++++++++++++++++++ server/gameserver/buff/callfunc.h | 4 +++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/server/gameserver/ability.cc b/server/gameserver/ability.cc index ab07d094..78fc484d 100644 --- a/server/gameserver/ability.cc +++ b/server/gameserver/ability.cc @@ -426,7 +426,7 @@ std::vector Ability::GMShowAttrs() } { std::vector tmp_strings; - int attr_id = 0; + int attr_id = kHVAT_Begin; for (auto& list : vattr_list_) { list_head* head = &list; list_head* pos = nullptr; diff --git a/server/gameserver/buff/callfunc.cc b/server/gameserver/buff/callfunc.cc index 20f599fd..8a9914eb 100644 --- a/server/gameserver/buff/callfunc.cc +++ b/server/gameserver/buff/callfunc.cc @@ -26,6 +26,7 @@ #include "bullet.h" #include "virtualbullet.h" #include "shot.h" +#include "entityfactory.h" #include "mt/Buff.h" #include "mt/Equip.h" @@ -265,6 +266,11 @@ void CallFuncBuff::Activate() RandAdd(); } break; + case BuffCallFunc_e::kShowExplosion: + { + ShowExplosion(); + } + break; default: { } @@ -1818,3 +1824,22 @@ void CallFuncBuff::RandAdd() } } } + +void CallFuncBuff::ShowExplosion() +{ + if (owner->dead || !meta->dead_valid()) { + return; + } + int explosion_effect = meta->GetBuffParam2(this); + float x = meta->GetBuffParam3(this); + float y = meta->GetBuffParam4(this); + float z = meta->GetBuffParam5(this); + Position center; + center.FromGlmVec3(glm::vec3(x, y, z)); + owner->room->frame_event.AddExplosionEx + (owner->GetWeakPtrRef(), + 0, + center, + explosion_effect, + 0); +} diff --git a/server/gameserver/buff/callfunc.h b/server/gameserver/buff/callfunc.h index 7f830f3f..41b63bb2 100644 --- a/server/gameserver/buff/callfunc.h +++ b/server/gameserver/buff/callfunc.h @@ -43,7 +43,8 @@ A8_DECLARE_CLASS_ENUM(BuffCallFunc_e, int, kOnBreakSkill = 43, kBreakSkill = 44, kBuffEffectCondAdd = 45, - kRandAdd = 46 + kRandAdd = 46, + kShowExplosion = 47, ); @@ -88,6 +89,7 @@ class CallFuncBuff : public Buff void BreakSkill(); void BuffEffectCondAdd(); void RandAdd(); + void ShowExplosion(); void InternalRangeHoldBuff(std::function get_center_func);