diff --git a/server/gameserver/ability.cc b/server/gameserver/ability.cc index 5e12b7e3..de0c30cf 100644 --- a/server/gameserver/ability.cc +++ b/server/gameserver/ability.cc @@ -225,6 +225,11 @@ void Ability::RecalcAttrAddition(int attr_id) } else if (IsValidHumanVirtualAttr(attr_id)) { std::get<0>(vattr_add_[attr_id - kHVAT_Begin]) = new_val; } + owner_.Get()->GetNetData()->RecalcMaxHP(); + owner_.Get()->GetNetData()->RecalcAttack(); + owner_.Get()->GetNetData()->RecalcDef(); + owner_.Get()->GetNetData()->RecalcBlock(); + owner_.Get()->GetNetData()->RecalcCrit(); } void Ability::RecalcAttrRuduce(int attr_id) @@ -275,6 +280,11 @@ void Ability::RecalcAttrRuduce(int attr_id) } else if (IsValidHumanVirtualAttr(attr_id)) { std::get<0>(vattr_dec_[attr_id - kHVAT_Begin]) = new_val; } + owner_.Get()->GetNetData()->RecalcMaxHP(); + owner_.Get()->GetNetData()->RecalcAttack(); + owner_.Get()->GetNetData()->RecalcDef(); + owner_.Get()->GetNetData()->RecalcBlock(); + owner_.Get()->GetNetData()->RecalcCrit(); } float Ability::GetAttrAddition(int attr_id) diff --git a/server/gameserver/commands.cc b/server/gameserver/commands.cc index 48a756ec..15ccee94 100644 --- a/server/gameserver/commands.cc +++ b/server/gameserver/commands.cc @@ -234,6 +234,10 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg) float value = a8::XValue(cmds[3]).GetDouble(); if (target) { target->GetAbility()->AddAttr(attr_id, value); + std::vector strings = target->GetAbility()->GMShowAttrs(); + for (auto& str : strings) { + SendDebugMsg("数值: " + str); + } } } } else if (cmd == "del_attr") { @@ -244,6 +248,10 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg) int idx = a8::XValue(cmds[3]); if (target) { target->GetAbility()->GMDelAttr(attr_id, idx); + std::vector strings = target->GetAbility()->GMShowAttrs(); + for (auto& str : strings) { + SendDebugMsg("数值: " + str); + } } } } else if (cmd == "clear_attr") { @@ -252,6 +260,10 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg) room->GetCreatureByUniId(a8::XValue(cmds[1]).GetInt()); if (target) { target->GetAbility()->GMClearAttr(); + std::vector strings = target->GetAbility()->GMShowAttrs(); + for (auto& str : strings) { + SendDebugMsg("数值: " + str); + } } } } else if (cmd == "show_attrs") {