bool NFCEquipPropertyModule::CalEquipIntensifyProperty(const NFGUID& self, const NFGUID& xEquipGUID, NFDataList& xDataList) { NF_SHARE_PTR<NFIRecord> pBagRecord = m_pKernelModule->FindRecord(self, NFrame::Player::BagEquipList::ThisName()); if (nullptr == pBagRecord) { return false; } NF_SHARE_PTR<NFIRecord> pCommPropertyValueRecord = m_pKernelModule->FindRecord(self, NFrame::Player::CommValue::ThisName()); if (nullptr == pCommPropertyValueRecord) { return false; } NFDataList varFind; if (pBagRecord->FindObject(NFrame::Player::BagEquipList::GUID, xEquipGUID, varFind) != 1) { return false; } const int nRow = varFind.Int32(0); xDataList.Clear(); /////////////GemBase///////////////////////////////////////// const int nIntensify = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::IntensifyLevel); if (nIntensify <= 0) { return false; } const std::string& strEquipConfig = pBagRecord->GetString(nRow, NFrame::Player::BagEquipList::ConfigID); //const int nHeroType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::HeroTye()); const int nItemType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::ItemType()); const int nItemSubType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::ItemSubType()); if (nItemType != NFMsg::EItemType::EIT_EQUIP) { return false; } for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i) { xDataList.AddInt(0); } //conditional the item type to define what property to give double dwCoefficientAtk = 2.0; double dwCoefficientDef = 1.0; int nMAXHPValue = nIntensify * nIntensify; int nAttackValue = nIntensify * nIntensify; int nDefValue = nIntensify * nIntensify; if (nItemSubType == NFMsg::EGameEquipSubType::EQUIPTYPE_WEAPON) { nAttackValue *= dwCoefficientAtk; } else { nDefValue *= dwCoefficientDef; } xDataList.SetInt(NFrame::Player::CommValue::MAXHP, nMAXHPValue); xDataList.SetInt(NFrame::Player::CommValue::ATK_VALUE, nAttackValue); xDataList.SetInt(NFrame::Player::CommValue::DEF_VALUE, nDefValue); return true; }
bool NFCEquipPropertyModule::CalEquipElementProperty(const NFGUID& self, const NFGUID& xEquipGUID, NFDataList& xDataList) { NF_SHARE_PTR<NFIRecord> pBagRecord = m_pKernelModule->FindRecord(self, NFrame::Player::BagEquipList::ThisName()); if (nullptr == pBagRecord) { return false; } NF_SHARE_PTR<NFIRecord> pCommPropertyValueRecord = m_pKernelModule->FindRecord(self, NFrame::Player::CommValue::ThisName()); if (nullptr == pCommPropertyValueRecord) { return false; } NFDataList varFind; if (pBagRecord->FindObject(NFrame::Player::BagEquipList::GUID, xEquipGUID, varFind) != 1) { return false; } const int nRow = varFind.Int32(0); xDataList.Clear(); /////////////element///////////////////////////////////////// const std::string& strEquipConfig = pBagRecord->GetString(nRow, NFrame::Player::BagEquipList::ConfigID); //const int nHeroType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::HeroTye()); const int nItemType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::ItemType()); const int nItemSubType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::ItemSubType()); if (nItemType != NFMsg::EItemType::EIT_EQUIP) { return false; } for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i) { xDataList.AddInt(0); } //conditional the item type to define what property to give double dwCoefficientAtk = 2.0; double dwCoefficientDef = 1.0; int nFireLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel1_FIRE); int nLightLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel2_LIGHT); int nWindLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel3_Wind); int nIceLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel4_ICE); int nPoisonLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel5_POISON); int nWindValue = nWindLevel * nWindLevel; int nFireValue = nFireLevel * nFireLevel; int nLightValue = nLightLevel * nLightLevel; int nIceValue = nIceLevel * nIceLevel; int nPoisonValue = nPoisonLevel * nPoisonLevel; if (nItemSubType == NFMsg::EGameEquipSubType::EQUIPTYPE_WEAPON) { xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nWindValue * dwCoefficientAtk); xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nFireValue * dwCoefficientAtk); xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nLightValue * dwCoefficientAtk); xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nIceValue * dwCoefficientAtk); xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nPoisonValue * dwCoefficientAtk); } else { xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nWindValue * dwCoefficientDef); xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nFireValue * dwCoefficientDef); xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nLightValue * dwCoefficientDef); xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nIceValue * dwCoefficientDef); xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nPoisonValue * dwCoefficientDef); } return true; return true; }
bool NFCEquipPropertyModule::CalEquipGemProperty(const NFGUID& self, const NFGUID& xEquipGUID, NFDataList& xDataList) { NF_SHARE_PTR<NFIRecord> pBagRecord = m_pKernelModule->FindRecord(self, NFrame::Player::BagEquipList::ThisName()); if (nullptr == pBagRecord) { return false; } NF_SHARE_PTR<NFIRecord> pCommPropertyValueRecord = m_pKernelModule->FindRecord(self, NFrame::Player::CommValue::ThisName()); if (nullptr == pCommPropertyValueRecord) { return false; } NFDataList varFind; if (pBagRecord->FindObject(NFrame::Player::BagEquipList::GUID, xEquipGUID, varFind) != 1) { return false; } const int nRow = varFind.Int32(0); xDataList.Clear(); /////////////GemBase///////////////////////////////////////// int nSlotCount = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::SlotCount); if (nSlotCount <= 0) { return false; } for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i) { xDataList.AddInt(0); } for (int i = NFrame::Player::BagEquipList::InlayStone1; i <= NFrame::Player::BagEquipList::InlayStone10; ++i) { int nIndex = i - NFrame::Player::BagEquipList::InlayStone1; if (nIndex > nSlotCount) { break; } const std::string& strGemID = pBagRecord->GetString(nRow, i); if (strGemID.empty()) { continue; } const std::string& strGemEffectData = m_pElementModule->GetPropertyString(strGemID, NFrame::Item::EffectData()); if (strGemEffectData.empty()) { continue; } //one gem for (int j = 0; j < pCommPropertyValueRecord->GetCols(); ++j) { const std::string& strColTag = pCommPropertyValueRecord->GetColTag(j); int64_t nValue = m_pElementModule->GetPropertyInt(strGemEffectData, strColTag); int64_t nOldValue = xDataList.Int(j); xDataList.SetInt(j, nOldValue + nValue); } } return true; }