Batch #14943 by ragnarok-clanker: no function's compiled code changes; checked with 741 compiled unit(s), including every includer of Source/ActorPickNode.h, Source/Client/Browser/BrowserClientSite.h, Source/Client/Browser/BrowserPopupDispatch.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Mode/CMode.h, Source/Client/Mode/ModeDragState.h, Source/Client/Replay.h, Source/Client/Session.h, Source/Client/Stove/StoveMgr.h, Source/Contents/AchievementMgr.h, Source/Contents/ActorNameCard.h, Source/Contents/Actors/CharacterRender.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/GrannyGameActor.h, Source/Contents/Actors/GroundScope.h, Source/Contents/Actors/Item.h, Source/Contents/Actors/Npc.h, Source/Contents/Actors/Pc.h, Source/Contents/Actors/RenderObjectState.h, Source/Contents/Actors/Skill.h, Source/Contents/AdventureGuideMgr.h, Source/Contents/Camera/Camera.h, Source/Contents/Camera/CameraState.h, Source/Contents/CashEmotionMgr.h, Source/Contents/Configuration/GameSettingsMgr.h, Source/Contents/EffectResourceSwitcher.h, Source/Contents/Effects/AMachineEffect.h, Source/Contents/Effects/AcidifiedThrow.h, Source/Contents/Effects/AxeBoomerang.h, Source/Contents/Effects/BlastForge.h, Source/Contents/Effects/CaneOfEvilEyeEffect.h, Source/Contents/Effects/CharacterParticleBundle.h, Source/Contents/Effects/CloudKillEffect.h, Source/Contents/Effects/Effect.h, Source/Contents/Effects/EffectActor.h, Source/Contents/Effects/EffectEmitter.h, Source/Contents/Effects/EffectMaker.h, Source/Contents/Effects/EffectPrimitiveState.h, Source/Contents/Effects/FuumaShouakuEffect.h, Source/Contents/Effects/GravityControlEffect.h, Source/Contents/Effects/HealSpEffect.h, Source/Contents/Effects/Level99Effect.h, Source/Contents/Effects/MapChainEffect.h, Source/Contents/Effects/MonsterSkillEffects.h, Source/Contents/Effects/MsgEffect.h, Source/Contents/Effects/NyanggrassEffect.h, Source/Contents/Effects/Particle.h, Source/Contents/Effects/PowderingEffect.h, Source/Contents/Effects/RagEffectState.h, Source/Contents/Effects/RectUpEffect.h, Source/Contents/Effects/ShadowExceedEffect.h, Source/Contents/Effects/SkillEffects.h, Source/Contents/Effects/SpriteParticle.h, Source/Contents/Effects/StormCannonEffect.h, Source/Contents/Effects/ThrowEffects.h, Source/Contents/EntryQueueMgr.h, Source/Contents/EquipmentResourceMgr.h, Source/Contents/FlyingShipRouteInfo.h, Source/Contents/Ground/GroundGeometry.h, Source/Contents/GuildInfo.h, Source/Contents/Items/ItemDescription.h, Source/Contents/Items/ItemInfo.h, Source/Contents/MapSkyMgr.h, Source/Contents/Messenger/MessengerWindows.h, Source/Contents/Models/ModelNode.h, Source/Contents/NavigationManager.h, Source/Contents/Party/AdventurerAgencyMgr.h, Source/Contents/RDamageVar.h, Source/Contents/RenewQuestMgr.h, Source/Contents/ReputeMgr.h, Source/Contents/RodexMailStore.h, Source/Contents/RouletteMgr.h, Source/Contents/Schedule/Schedule.h, Source/Contents/SignBoard/SignBoard.h, Source/Contents/Skills/ClientSkills.h, Source/Contents/Skills/PlayerSkillBundle.h, Source/Contents/Skills/SkillInfo.h, Source/Contents/SpriteLayerDrawing.h, Source/Contents/TipBoxTitles.h, Source/Contents/UserData/AccountLinkedUserDataMgr.h, Source/Contents/UserData/NormalItemSlots.h, Source/Contents/World/World.h, Source/Contents/WorldView/WorldViewData.h, Source/Render/Primitives/LightmappedPrimitive.h, Source/Render/Primitives/RenderPrimitive.h, Source/Render/Renderer.h, Source/Render/Textures/SpritePixels.h, Source/Render/Textures/Texture.h, Source/Resource/EZeffectResource.h, Source/Resource/Models/AnimatedModelResource.h, Source/Resource/Models/GrannyModelResource.h, Source/Resource/Sprites/ActionResource.h, Source/Resource/World/GroundResource.h, Source/Resource/World/WorldResource.h, Source/Resource/XmlNode.h, Source/UI/AdventureGuide/UIAdventureGuide.h, Source/UI/Buttons/UIBmpRadioBtn.h, Source/UI/Buttons/UIDescriptRace.h, Source/UI/Buttons/UIItemTagButton.h, Source/UI/Buttons/UISlotBmpButton.h, Source/UI/Buttons/UISpriteButton.h, Source/UI/Buttons/UITVTextButton.h, Source/UI/Buttons/UITextureButton.h, Source/UI/CashEmotion/UICashEmotionListWnd.h, Source/UI/CashEmotion/UICashEmotionPack.h, Source/UI/CashShop/UICashShopWnd.h, Source/UI/Chat/UIChatRoomMakeWnd.h, Source/UI/Chat/UIChatRoomTitle.h, Source/UI/Chat/UINewChatWnd.h, Source/UI/Chat/UISubChatHisWnd.h, Source/UI/Chat/UISubChatMiniWnd.h, Source/UI/Chat/UIWhisperWnd.h, Source/UI/Clan/UIClanWnd.h, Source/UI/Dialogs/UIBookWnd.h, Source/UI/Dialogs/UIChooseWarpWnd.h, Source/UI/Dialogs/UIMenuWnd.h, Source/UI/Dialogs/UIMiniMapWnd.h, Source/UI/Dialogs/UIMinimapZoomWnd.h, Source/UI/Dialogs/UINpcEditDialogWnd.h, Source/UI/Dialogs/UIPasswordWnd.h, Source/UI/Dialogs/UISayDialogWnd.h, Source/UI/Dialogs/UISelectCartWnd.h, Source/UI/Dialogs/UITipboxWnd.h, Source/UI/Edit/UIEditBoxEx.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Edit/UIEditCtrl_Currency.h, Source/UI/Edit/UIItemTagCtrl.h, Source/UI/Enchant/EnchantUI.h, Source/UI/Exchange/UIExchangeUI.h, Source/UI/FrameSkin.h, Source/UI/GameSettings/GameSettingsUI.h, Source/UI/Gauges/UIPcGage.h, Source/UI/Guild/UIGuildHelperWnd.h, Source/UI/Guild/UIGuildWnd.h, Source/UI/Guild/UIGuild_Storage_Log.h, Source/UI/Item/UIEquipmentPropertiesWnd.h, Source/UI/Item/UIItemBaseWnd.h, Source/UI/Item/UIItemPurchaseWnd.h, Source/UI/Item/UIItemSellWnd2.h, Source/UI/Item/UIItemShopWnd.h, Source/UI/Item/UIItemShopWnd2.h, Source/UI/Item/UIItemStoreFindWnd.h, Source/UI/Item/UIItemStoreSubWnd.h, Source/UI/Item/UIItemStoreWnd.h, Source/UI/Item/UIItemWnd.h, Source/UI/Item/UIMerchantItemLogWnd.h, Source/UI/Item/UIParaItemShopWnd.h, Source/UI/Items/UICardItemIllustWnd.h, Source/UI/Items/UIEquipWnd.h, Source/UI/Items/UIExchangeWnd.h, Source/UI/Items/UIGameItem.h, Source/UI/Items/UIItemCollectionWnd.h, Source/UI/Items/UIItemIdentifyWnd.h, Source/UI/Items/UIItemParamChangeDisplayWnd.h, Source/UI/Items/UISwapEquipmentWnd.h, Source/UI/Layout/WindowGeometry.h, Source/UI/Lists/UIChatHisBox.h, Source/UI/Lists/UIComboBoxV2Wnd.h, Source/UI/Lists/UIImgMenu.h, Source/UI/Lists/UIListBoxID.h, Source/UI/Lists/UIListBoxTemplate.h, Source/UI/Lists/UIMemberListBox.h, Source/UI/Lists/UITabControl.h, Source/UI/Lists/UITagListBox.h, Source/UI/Lists/UITreeView.h, Source/UI/Menu/UIMenuIconWnd.h, Source/UI/Navigation/UINavigationV4Wnd.h, Source/UI/ProbabilityTable/UIProbabilityTable.h, Source/UI/Quest/UIQuestDisplay.h, Source/UI/Quest/UIRenewQuestUI.h, Source/UI/Quest/UIRenewQuestWnd.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/Rodex/UIRodexInboxWnd.h, Source/UI/RuneSystem/UIRuneSystemWindows.h, Source/UI/RuneSystem/UIRuneSystemWnd.h, Source/UI/Shop/UIMerchantItemMyShopWnd.h, Source/UI/Shop/UIMerchantItemPurchaseMSGWnd.h, Source/UI/Shop/UIMerchantItemPurchaseWnd.h, Source/UI/Shop/UIMerchantItemShopWnd.h, Source/UI/Shop/UIMerchantMirrorItemWnd.h, Source/UI/Shop/UIMerchantShopMakeWnd.h, Source/UI/Shop/UIMerchantShopTitle.h, Source/UI/Skill/UISkillDescribeWnd.h, Source/UI/Skill/UISkillListWnd.h, Source/UI/SkillDelayInfo/SkillDelayInfo.h, Source/UI/StylingShop/UIStylingShopWnd.h, Source/UI/Text/CreateLineInfo.h, Source/UI/Text/UIAchWnd.h, Source/UI/Text/UIBalloonText.h, Source/UI/Text/UINameBalloonText.h, Source/UI/Text/UIStaticTextControl.h, Source/UI/Text/UIString.h, Source/UI/Text/UITextViewerControl.h, Source/UI/UIBarGraph.h, Source/UI/UIBartermarketWnd.h, Source/UI/UIChangeMaterialWnd.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/UILapineScrollBar.h, Source/UI/UIMacroBlackListCheckWnd.h, Source/UI/UIMacroDetectorWnd.h, Source/UI/UIMacroReport.h, Source/UI/UIMacroUserInfoWnd.h, Source/UI/UIPreviewEquipWnd.h, Source/UI/UIRefiningWnd.h, Source/UI/UIScrollWnd.h, Source/UI/UISlotBitmap.h, Source/UI/Window/FuncDrawWNDChar.h, Source/UI/Window/UIBattleMsgOptionWnd.h, Source/UI/Window/UIChatRoomWnd.h, Source/UI/Window/UICollectionSystemWnd.h, Source/UI/Window/UIControl.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UIHotKeyWnd.h, Source/UI/Window/UIJobListWnd.h, Source/UI/Window/UILoginOTPWnd.h, Source/UI/Window/UILoginWnd.h, Source/UI/Window/UIMakeCharWnd.h, Source/UI/Window/UIMonsterDisplayWnd.h, Source/UI/Window/UIMonsterInfoWnd.h, Source/UI/Window/UINavigationHelpWnd.h, Source/UI/Window/UINavigationWnd.h, Source/UI/Window/UINewMakeCharWnd.h, Source/UI/Window/UINewSelectCharWnd.h, Source/UI/Window/UINoticeWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIRegisterMgr.h, Source/UI/Window/UIRoMapWnd.h, Source/UI/Window/UIRodexContentsWnd.h, Source/UI/Window/UISecondCostumeWnd.h, Source/UI/Window/UISeekPartyMBWnd.h, Source/UI/Window/UISeekPartyWnd.h, Source/UI/Window/UISelCharForUServerWnd.h, Source/UI/Window/UISerachStoreInfoWnd.h, Source/UI/Window/UITransMenuWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/UIWindowMgr.inl, Source/Utility/Lexicon/LexiconSerializer.h.
384 lines
10 KiB
C++
384 lines
10 KiB
C++
#include "Contents/Skills/PlayerSkillBundle.h"
|
|
#include "UI/Window/UIEnums.h"
|
|
#include "UI/Window/WindowId.h"
|
|
#include "Contents/Skills/SkillId.h"
|
|
#include "Client/Session.h"
|
|
#include "UI/Window/UIWindow.h"
|
|
#include "UI/Window/WindowManagerWindows.h"
|
|
|
|
#include <algorithm>
|
|
|
|
bool IsIndexedSkill(int id);
|
|
|
|
// INLINED
|
|
std::size_t SkillIdHash::operator()(std::uint32_t id) const {
|
|
return std::hash<std::uint32_t>()(id);
|
|
}
|
|
|
|
// INLINED
|
|
CPlayerSkillBundle::lcEXCInfo::lcEXCInfo() {
|
|
}
|
|
|
|
// OFFSET: 0x00770A30
|
|
// FUNCTION: fn_08260
|
|
CPlayerSkillBundle::lcEXCInfo::~lcEXCInfo() = default;
|
|
|
|
// OFFSET: 0x0076FB70
|
|
// FUNCTION: fn_08253
|
|
CPlayerSkillBundle::CPlayerSkillBundle() : index(8) {
|
|
}
|
|
|
|
// OFFSET: 0x00770830
|
|
// FUNCTION: fn_08258
|
|
CPlayerSkillBundle::~CPlayerSkillBundle() = default;
|
|
|
|
// OFFSET: 0x00773390
|
|
// FUNCTION: fn_08309
|
|
void CPlayerSkillBundle::Add(const CSkillInfo& value) {
|
|
this->skills.push_back(value);
|
|
if (IsIndexedSkill(value.id)) {
|
|
this->index[value.id] = this->Find(value.id);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00771160
|
|
// FUNCTION: fn_08272
|
|
void CPlayerSkillBundle::Remove(std::uint32_t id) {
|
|
const auto entry = std::find_if(this->skills.begin(), this->skills.end(),
|
|
[id](const CSkillInfo& value) { return value.id == id; });
|
|
if (entry == this->skills.end()) {
|
|
return;
|
|
}
|
|
|
|
const auto indexed = this->index.find(entry->id);
|
|
if (indexed != this->index.end()) {
|
|
this->index.erase(indexed);
|
|
}
|
|
|
|
this->skills.erase(entry);
|
|
}
|
|
|
|
// OFFSET: 0x007715B0
|
|
// FUNCTION: fn_08279
|
|
CSkillInfo* CPlayerSkillBundle::Find(std::uint32_t id) {
|
|
const auto entry = std::find_if(this->skills.begin(), this->skills.end(),
|
|
[id](const CSkillInfo& value) { return id == value.id; });
|
|
return entry != this->skills.end() ? &*entry : nullptr;
|
|
}
|
|
|
|
__declspec(noinline) std::uint32_t ResolveSkillId(std::uint32_t id);
|
|
|
|
// OFFSET: 0x00CACF20
|
|
// FUNCTION: fn_21049
|
|
std::uint32_t ResolveSkillId(std::uint32_t id) {
|
|
if (g_session.GetUnknown8134() != 1 || (id != 6578 && id != 6579)) {
|
|
return id;
|
|
}
|
|
|
|
CSkillInfo* skill;
|
|
if (g_session.HasSkillEffect(1717) && g_session.m_skillBundle.FindIndexed(6580, skill) && skill->IsValid()) {
|
|
return 6580;
|
|
}
|
|
|
|
if (g_session.HasSkillEffect(1716) && g_session.m_skillBundle.FindIndexed(6579, skill) && skill->IsValid()) {
|
|
return 6579;
|
|
}
|
|
|
|
return id;
|
|
}
|
|
|
|
// OFFSET: 0x007716B0
|
|
// FUNCTION: fn_08280
|
|
CSkillInfo CPlayerSkillBundle::Lookup(std::uint32_t id) {
|
|
if (this->skills.empty()) {
|
|
return CSkillInfo(-1);
|
|
}
|
|
|
|
const std::uint32_t key = id == 6578 || id == 6579 ? ResolveSkillId(id) : id;
|
|
const auto entry = this->index.find(key);
|
|
if (entry != this->index.end() && entry->second->IsValid()) {
|
|
return *entry->second;
|
|
}
|
|
|
|
const auto found = std::find_if(this->skills.begin(), this->skills.end(),
|
|
[id](const CSkillInfo& value) { return value.id == id; });
|
|
if (found != this->skills.end()) {
|
|
return *found;
|
|
}
|
|
|
|
return CSkillInfo(-1);
|
|
}
|
|
|
|
// OFFSET: 0x007717F0
|
|
// FUNCTION: fn_08281
|
|
bool CPlayerSkillBundle::FindIndexed(std::uint32_t id, CSkillInfo*& output) {
|
|
const auto entry = this->index.find(id);
|
|
if (entry == this->index.end()) {
|
|
return false;
|
|
}
|
|
|
|
output = entry->second;
|
|
return true;
|
|
}
|
|
|
|
// OFFSET: 0x00770EC0
|
|
// FUNCTION: fn_08269
|
|
bool CPlayerSkillBundle::UpdatePending(const CSkillInfo& value) {
|
|
for (CSkillInfo& entry : this->pending) {
|
|
if (value.id == entry.id) {
|
|
entry.level = value.level;
|
|
entry.id = value.id;
|
|
entry.spCost = value.spCost;
|
|
entry.upgradable = value.upgradable;
|
|
entry.apCost = value.apCost;
|
|
|
|
return false;
|
|
}
|
|
}
|
|
|
|
this->pending.push_back(value);
|
|
return true;
|
|
}
|
|
|
|
// OFFSET: 0x00771880
|
|
// FUNCTION: fn_08282
|
|
CSkillInfo CPlayerSkillBundle::Pending(std::uint32_t id) {
|
|
if (this->pending.empty()) {
|
|
return CSkillInfo(-1);
|
|
}
|
|
|
|
const auto entry = std::find_if(this->pending.begin(), this->pending.end(),
|
|
[id](const CSkillInfo& value) { return value.id == id; });
|
|
if (entry != this->pending.end()) {
|
|
return *entry;
|
|
}
|
|
|
|
return CSkillInfo(-1);
|
|
}
|
|
|
|
// OFFSET: 0x00771560
|
|
// FUNCTION: fn_08277
|
|
CSkillInfo* CPlayerSkillBundle::FindExtra(std::uint32_t id) {
|
|
const auto entry = std::find_if(this->extra.begin(), this->extra.end(),
|
|
[id](const CSkillInfo& value) { return id == value.id; });
|
|
return entry != this->extra.end() ? &*entry : nullptr;
|
|
}
|
|
|
|
// OFFSET: 0x00771450
|
|
// FUNCTION: fn_08275
|
|
void CPlayerSkillBundle::ClearExtra() {
|
|
this->extra.clear();
|
|
this->extraIds.clear();
|
|
}
|
|
|
|
// OFFSET: 0x007713E0
|
|
// FUNCTION: fn_08274
|
|
void CPlayerSkillBundle::AddExtra(const CSkillInfo& value) {
|
|
this->extraIds.push_back(value.id);
|
|
if (UIWindow* window = g_windowMgr.LookupWindow(WID_SKILLLISTWND)) {
|
|
window->SendMsg(nullptr, UM_REFRESH_EXTRA_SKILL_TAB, 0, 0, 0, 0);
|
|
}
|
|
|
|
this->extra.push_back(value);
|
|
}
|
|
|
|
// OFFSET: 0x007714A0
|
|
// FUNCTION: fn_08276
|
|
bool CPlayerSkillBundle::RemoveExtra(std::uint32_t id) {
|
|
for (auto entry = this->extra.begin(); entry != this->extra.end(); ++entry) {
|
|
if (id != entry->id) {
|
|
continue;
|
|
}
|
|
|
|
this->extra.erase(entry);
|
|
const auto item = std::find(this->extraIds.begin(), this->extraIds.end(), id);
|
|
if (item != this->extraIds.end()) {
|
|
this->extraIds.erase(item);
|
|
if (UIWindow* window = g_windowMgr.LookupWindow(WID_SKILLLISTWND)) {
|
|
window->SendMsg(nullptr, UM_REFRESH_EXTRA_SKILL_TAB, 0, 0, 0, 0);
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
// OFFSET: 0x00771590
|
|
// FUNCTION: fn_08278
|
|
void CPlayerSkillBundle::NumberExtra() {
|
|
unsigned number = 0;
|
|
|
|
for (auto entry = this->extra.begin(); entry != this->extra.end(); ++entry, ++number) {
|
|
entry->treePosition = number;
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00771C00
|
|
// FUNCTION: fn_08288
|
|
void CPlayerSkillBundle::AddGrouped(int group, const CSkillInfo& value) {
|
|
this->groups[group].push_back(value);
|
|
}
|
|
|
|
// OFFSET: 0x00771D20
|
|
// FUNCTION: fn_08289
|
|
void CPlayerSkillBundle::ClearGroups() {
|
|
this->groups.clear();
|
|
}
|
|
|
|
// OFFSET: 0x00771D50
|
|
// FUNCTION: fn_08290
|
|
CSkillInfo* CPlayerSkillBundle::FindGrouped(std::uint32_t id) {
|
|
for (auto group = this->groups.begin(); group != this->groups.end(); ++group) {
|
|
for (CSkillInfo& value : group->second) {
|
|
if (value.id == id) {
|
|
return &value;
|
|
}
|
|
}
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
// OFFSET: 0x00771DA0
|
|
// FUNCTION: fn_08291
|
|
std::list<CSkillInfo>& CPlayerSkillBundle::Group(int group) {
|
|
static std::list<CSkillInfo> missing;
|
|
const auto entry = this->groups.find(group);
|
|
return entry != this->groups.end() ? entry->second : missing;
|
|
}
|
|
|
|
// OFFSET: 0x00771F30
|
|
// FUNCTION: fn_08292
|
|
std::size_t CPlayerSkillBundle::GroupSize(int group) const {
|
|
const auto entry = this->groups.find(group);
|
|
return entry != this->groups.end() ? entry->second.size() : 0;
|
|
}
|
|
|
|
// OFFSET: 0x00771F80
|
|
// FUNCTION: fn_08293
|
|
int CPlayerSkillBundle::GroupedLevel(std::uint32_t id) {
|
|
const CSkillInfo* value = this->FindGrouped(id);
|
|
return value ? value->level : 0;
|
|
}
|
|
|
|
// OFFSET: 0x00771980
|
|
// FUNCTION: fn_08284
|
|
bool CPlayerSkillBundle::HasHigherLevel(std::uint32_t id) {
|
|
const CSkillInfo* value = this->FindGrouped(id);
|
|
return value ? value->level > value->learnedLevel : false;
|
|
}
|
|
|
|
// OFFSET: 0x00770F20
|
|
// FUNCTION: fn_08270
|
|
void CPlayerSkillBundle::RecordLevelChange(const CSkillInfo& value) {
|
|
if (value.level == 0) {
|
|
return;
|
|
}
|
|
|
|
CSkillInfo* previous = this->FindGrouped(value.id);
|
|
if (!previous || previous->level >= value.level) {
|
|
return;
|
|
}
|
|
|
|
lcEXCInfo change;
|
|
change.previous = previous->level;
|
|
change.target = value.level;
|
|
this->levelChanges[static_cast<int>(previous->id)] = change;
|
|
this->changed[static_cast<int>(previous->id)] = true;
|
|
}
|
|
|
|
// OFFSET: 0x00771250
|
|
// FUNCTION: fn_08273
|
|
std::pair<bool, int> CPlayerSkillBundle::PreviousLevel(int id) const {
|
|
const auto entry = this->levelChanges.find(id);
|
|
const bool found = entry != this->levelChanges.end();
|
|
return found ? std::make_pair(true, entry->second.previous) : std::make_pair(false, 0);
|
|
}
|
|
|
|
// OFFSET: 0x00771FC0
|
|
// FUNCTION: fn_08295
|
|
void CPlayerSkillBundle::ApplyLevelChange(CSkillInfo& value) {
|
|
const int id = static_cast<int>(value.id);
|
|
const auto entry = this->levelChanges.find(id);
|
|
if (entry != this->levelChanges.end()) {
|
|
lcEXCInfo& change = entry->second;
|
|
if (value.level == change.previous || change.target < value.level) {
|
|
this->removals.push_back(id);
|
|
} else if (change.previous < value.level && value.level < change.target) {
|
|
change.previous = value.level;
|
|
value.level = change.target;
|
|
}
|
|
}
|
|
|
|
for (int removed : this->removals) {
|
|
const auto change = this->levelChanges.find(removed);
|
|
if (change != this->levelChanges.end()) {
|
|
this->levelChanges.erase(change);
|
|
const auto flag = this->changed.find(removed);
|
|
if (flag != this->changed.end()) {
|
|
this->changed.erase(flag);
|
|
}
|
|
}
|
|
}
|
|
|
|
this->removals.clear();
|
|
}
|
|
|
|
// OFFSET: 0x00770FD0
|
|
// FUNCTION: fn_08271
|
|
void CPlayerSkillBundle::ClearLevelChanges() {
|
|
this->levelChanges.clear();
|
|
this->changed.clear();
|
|
this->removals.clear();
|
|
}
|
|
|
|
// OFFSET: 0x00771920
|
|
// FUNCTION: fn_08283
|
|
void CPlayerSkillBundle::MarkLevelChanges() {
|
|
for (auto entry = this->changed.begin(); entry != this->changed.end(); ++entry) {
|
|
entry->second = true;
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00771AF0
|
|
// FUNCTION: fn_08286
|
|
void CPlayerSkillBundle::ResetFirstLevelChange() {
|
|
const auto entry = this->levelChanges.begin();
|
|
if (entry != this->levelChanges.end()) {
|
|
entry->second.previous = 0;
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00771FA0
|
|
// FUNCTION: fn_08294
|
|
void CPlayerSkillBundle::SetUnknownValue(int id, int value) {
|
|
if (static_cast<unsigned>(id) - 1u <= 0x1F3D) {
|
|
this->skillValues[id] = value;
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00771B40
|
|
// FUNCTION: fn_08287
|
|
void CPlayerSkillBundle::ForEachGrouped(std::function<bool(CSkillInfo*)> callback) {
|
|
for (auto group = this->groups.begin(); group != this->groups.end(); ++group) {
|
|
for (CSkillInfo& value : group->second) {
|
|
if (!callback(&value)) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x007719B0
|
|
// FUNCTION: fn_08285
|
|
bool IsIndexedSkill(int id) {
|
|
switch (id) {
|
|
case AT_FERAL_CLAW:
|
|
case AT_ALPHA_CLAW:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|