diff --git a/server/gameserver/metadata.cc b/server/gameserver/metadata.cc index 33f2b11..3765b69 100644 --- a/server/gameserver/metadata.cc +++ b/server/gameserver/metadata.cc @@ -339,7 +339,7 @@ namespace MetaData return weapon_idx; } - bool Equip::Match(CondAddBuff_e cond, int val) + bool Equip::Match(CondAddBuff_e cond, int val, int val2) { switch (cond) { case kCondBuffUpdateWeaponId: @@ -357,7 +357,8 @@ namespace MetaData case kCondBuffUpdateWeaponType: case kCondBuffShotWeaponType: { - return val == i->equip_subtype(); + return val == i->equip_type() && + (val2 == 0 || val2 == i->equip_subtype()); } break; default: @@ -779,10 +780,12 @@ namespace MetaData param2 = a8::XValue(i->buff_param2()).GetDouble(); param3 = a8::XValue(i->buff_param3()).GetDouble(); param4 = a8::XValue(i->buff_param4()).GetDouble(); + param5 = a8::XValue(i->buff_param5()).GetDouble(); int_param1 = a8::XValue(i->buff_param1()); int_param2 = a8::XValue(i->buff_param2()); int_param3 = a8::XValue(i->buff_param3()); int_param4 = a8::XValue(i->buff_param4()); + int_param5 = a8::XValue(i->buff_param5()); { std::vector strings; a8::Split(i->child_buff(), strings, '|'); @@ -820,7 +823,7 @@ namespace MetaData } { std::vector strings; - a8::Split(i->buff_param4(), strings, ':'); + a8::Split(i->buff_param4(), strings, '|'); for (auto& str : strings) { param4_int_list.push_back(a8::XValue(str).GetInt()); } diff --git a/server/gameserver/metadata.h b/server/gameserver/metadata.h index af323b2..65e4428 100644 --- a/server/gameserver/metadata.h +++ b/server/gameserver/metadata.h @@ -88,7 +88,7 @@ namespace MetaData void Init(); int GetWeaponIdx(); - bool Match(CondAddBuff_e cond, int val); + bool Match(CondAddBuff_e cond, int val, int val2); }; struct EquipUpgrade @@ -203,10 +203,12 @@ namespace MetaData float param2 = 0.0f; float param3 = 0.0f; float param4 = 0.0f; + float param5 = 0.0f; int int_param1 = 0; int int_param2 = 0; int int_param3 = 0; int int_param4 = 0; + int int_param5 = 0; std::vector param1_int_list; std::vector param2_int_list; std::vector param3_int_list; diff --git a/server/gameserver/trigger.cc b/server/gameserver/trigger.cc index 1be22a5..c17430f 100644 --- a/server/gameserver/trigger.cc +++ b/server/gameserver/trigger.cc @@ -27,7 +27,9 @@ void Trigger::TakeonWeapon(Weapon* old_weapon, Weapon* new_weapon) (cond, [this, cond, weapon_meta] (Buff* buff, bool& stop) { - if (weapon_meta->Match((CondAddBuff_e)cond, buff->meta->int_param3)) { + if (weapon_meta->Match((CondAddBuff_e)cond, + buff->meta->int_param3, + buff->meta->int_param5)) { switch (buff->meta->int_param2) { case kWeaponOptTakeoff: case kWeaponOptKeep: @@ -53,7 +55,9 @@ void Trigger::TakeonWeapon(Weapon* old_weapon, Weapon* new_weapon) (cond, [this, cond, weapon_meta] (Buff* buff, bool& stop) { - if (weapon_meta->Match((CondAddBuff_e)cond, buff->meta->int_param3)) { + if (weapon_meta->Match((CondAddBuff_e)cond, + buff->meta->int_param3, + buff->meta->int_param5)) { switch (buff->meta->int_param2) { case kWeaponOptTakeon: { @@ -84,7 +88,9 @@ void Trigger::Shot(MetaData::Equip* weapon_meta) (cond, [this, cond, weapon_meta] (Buff* buff, bool& stop) { - if (weapon_meta->Match((CondAddBuff_e)cond, buff->meta->int_param2)) { + if (weapon_meta->Match((CondAddBuff_e)cond, + buff->meta->int_param2, + buff->meta->int_param5)) { AddBuffs(buff->meta->int_param1, buff->meta->param4_int_list); } }); diff --git a/server/tools/protobuild/metatable.proto b/server/tools/protobuild/metatable.proto index aff2154..611d72d 100755 --- a/server/tools/protobuild/metatable.proto +++ b/server/tools/protobuild/metatable.proto @@ -240,6 +240,7 @@ message Buff required string buff_param2 = 7; required string buff_param3 = 8; required string buff_param4 = 9; + optional string buff_param5 = 19; required float duration_time = 10; optional float buff_valueup = 11; required string immune_buffeffect_list = 12;