Documentation
¶
Index ¶
- Constants
- func ApplyVMToParsedSlot(vm *CharacterViewModel, slot *core.SaveSlot) error
- func ApplyVMToSlot(vm *CharacterViewModel, slotData []byte) error
- func ApplyWorldState(slot *core.SaveSlot, world *WorldPresetData) []string
- func ClearInventoryItems(slot *core.SaveSlot) (int, error)
- func ClearStorageItems(slot *core.SaveSlot) (int, error)
- func PresetItemToFinalID(item PresetItem) uint32
- func PresetItemsToItemsToAdd(items []PresetItem, isInventory bool) ([]core.ItemToAdd, []string)
- func UpdateMatchmakingLevel(slotData []byte, maxUpgrade uint8)
- func ValidatePreset(preset *CharacterPreset) []string
- type AoWAvailabilityEntry
- type ApplyOptions
- type CharacterPreset
- type CharacterPresetCore
- type CharacterViewModel
- type ItemViewModel
- type PresetAddSettings
- type PresetApplyResult
- type PresetItem
- type StatValidationResult
- type WorldPresetData
Constants ¶
const MaxLevel = 713
MaxLevel is the highest achievable level in Elden Ring (all 8 stats at 99).
const PlayerGameDataOffset = 0x15420
const PresetFormatVersion = 1
Variables ¶
This section is empty.
Functions ¶
func ApplyVMToParsedSlot ¶
func ApplyVMToParsedSlot(vm *CharacterViewModel, slot *core.SaveSlot) error
func ApplyVMToSlot ¶
func ApplyVMToSlot(vm *CharacterViewModel, slotData []byte) error
func ApplyWorldState ¶
func ApplyWorldState(slot *core.SaveSlot, world *WorldPresetData) []string
func PresetItemToFinalID ¶
func PresetItemToFinalID(item PresetItem) uint32
func PresetItemsToItemsToAdd ¶
func PresetItemsToItemsToAdd(items []PresetItem, isInventory bool) ([]core.ItemToAdd, []string)
func UpdateMatchmakingLevel ¶
UpdateMatchmakingLevel scans the inventory and updates the matchmaking weapon level. Located at PlayerGameDataOffset + 0x93 (0x154B3).
func ValidatePreset ¶
func ValidatePreset(preset *CharacterPreset) []string
Types ¶
type AoWAvailabilityEntry ¶ added in v1.0.0
type AoWAvailabilityEntry struct {
ItemID uint32 `json:"itemId"`
TotalCopies int `json:"totalCopies"`
AvailableCopies int `json:"availableCopies"`
UsedCopies int `json:"usedCopies"`
UsedByWeaponHandles []uint32 `json:"usedByWeaponHandles"`
IsMissing bool `json:"isMissing"`
}
AoWAvailabilityEntry aggregates per-itemID availability for a single Ash of War. Returned by App.GetAoWAvailability; one entry per distinct AoW itemID present in the slot. AoW items absent from the slot have no entry — the frontend treats absence as IsMissing.
type ApplyOptions ¶
type CharacterPreset ¶
type CharacterPreset struct {
FormatVersion int `json:"formatVersion"`
ExportedAt string `json:"exportedAt"`
AppVersion string `json:"appVersion"`
Character CharacterPresetCore `json:"character"`
Inventory []PresetItem `json:"inventory"`
Storage []PresetItem `json:"storage"`
AddSettings *PresetAddSettings `json:"addSettings,omitempty"`
World *WorldPresetData `json:"world,omitempty"`
}
func VMToPreset ¶
func VMToPreset(vm *CharacterViewModel, appVersion string) *CharacterPreset
type CharacterPresetCore ¶
type CharacterPresetCore struct {
Name string `json:"name"`
Class uint8 `json:"class"`
ClassName string `json:"className"`
Level uint32 `json:"level"`
Souls uint32 `json:"souls"`
Vigor uint32 `json:"vigor"`
Mind uint32 `json:"mind"`
Endurance uint32 `json:"endurance"`
Strength uint32 `json:"strength"`
Dexterity uint32 `json:"dexterity"`
Intelligence uint32 `json:"intelligence"`
Faith uint32 `json:"faith"`
Arcane uint32 `json:"arcane"`
TalismanSlots uint8 `json:"talismanSlots"`
ClearCount uint32 `json:"clearCount"`
MemoryStones uint32 `json:"memoryStones"`
}
type CharacterViewModel ¶
type CharacterViewModel struct {
Name string `json:"name"`
Level uint32 `json:"level"`
Souls uint32 `json:"souls"`
Class uint8 `json:"class"`
ClassName string `json:"className"`
Vigor uint32 `json:"vigor"`
Mind uint32 `json:"mind"`
Endurance uint32 `json:"endurance"`
Strength uint32 `json:"strength"`
Dexterity uint32 `json:"dexterity"`
Intelligence uint32 `json:"intelligence"`
Faith uint32 `json:"faith"`
Arcane uint32 `json:"arcane"`
TalismanSlots uint8 `json:"talismanSlots"`
ClearCount uint32 `json:"clearCount"`
ScadutreeBlessing uint8 `json:"scadutreeBlessing"`
ShadowRealmBlessing uint8 `json:"shadowRealmBlessing"`
MemoryStones uint32 `json:"memoryStones"`
Gender uint8 `json:"gender"`
SoulMemory uint32 `json:"soulMemory"`
Inventory []ItemViewModel `json:"inventory"`
Storage []ItemViewModel `json:"storage"`
Warnings []string `json:"warnings"`
StatValidation *StatValidationResult `json:"statValidation,omitempty"`
EventFlagsAvailable bool `json:"eventFlagsAvailable"`
ClassBaseStats map[string]uint32 `json:"classBaseStats"`
}
func MapParsedSlotToVM ¶
func MapParsedSlotToVM(slot *core.SaveSlot) (*CharacterViewModel, error)
func MapSlotToVM ¶
func MapSlotToVM(slotData []byte) (*CharacterViewModel, error)
func PresetToVM ¶
func PresetToVM(preset *CharacterPreset) *CharacterViewModel
func (*CharacterViewModel) ClampToClassMinimums ¶
func (vm *CharacterViewModel) ClampToClassMinimums(classID uint8)
ClampToClassMinimums ensures no attribute is below the starting class minimum. If classID is unknown, only applies the global [1, 99] clamp.
func (*CharacterViewModel) RecalculateLevel ¶
func (vm *CharacterViewModel) RecalculateLevel()
RecalculateLevel updates the character level based on current attributes. Formula: Level = Vigor + Mind + Endurance + Strength + Dexterity + Intelligence + Faith + Arcane - 79
func (*CharacterViewModel) ValidateStats ¶
func (vm *CharacterViewModel) ValidateStats()
ValidateStats ensures all attributes are within legal game limits (1-99).
func (*CharacterViewModel) ValidateStatsConsistency ¶
func (vm *CharacterViewModel) ValidateStatsConsistency(classID uint8) StatValidationResult
ValidateStatsConsistency performs class-aware validation of character stats. It checks:
- Each attribute >= starting class base stat
- Level == sum(attributes) - 79
- Level in [1, 713]
- Class ID is valid (0-9)
Returns validation result with errors (hard violations) and warnings (soft issues).
type ItemViewModel ¶
type ItemViewModel struct {
Handle uint32 `json:"handle"`
ID uint32 `json:"id"`
BaseID uint32 `json:"baseId"`
FamilyID uint32 `json:"familyId"` // ownership/counting family override (Crimson/Cerulean flask +0 base); 0 = none
Name string `json:"name"`
Category string `json:"category"` // broad type from handle prefix: "Weapon"/"Armor"/"Talisman"/"Item"/"Ash of War"
SubCategory string `json:"subCategory"` // main game tab: "tools", "key_items", "melee_armaments", ...
SubGroup string `json:"subGroup"` // sub-grouping within tab: "Sacred Flasks", "Daggers", ...
Quantity uint32 `json:"quantity"`
MaxInventory uint32 `json:"maxInventory"`
MaxStorage uint32 `json:"maxStorage"`
MaxUpgrade uint32 `json:"maxUpgrade"`
CurrentUpgrade uint32 `json:"currentUpgrade"`
IconPath string `json:"iconPath"`
Flags []string `json:"flags"`
ReadOnly bool `json:"readOnly"`
AoWID uint32 `json:"aowId"` // item ID of the AoW gem attached to this weapon (0 = none / not a weapon)
CanMountAoW bool `json:"canMountAoW"` // true iff gemMountType==2 (standard infusable weapon)
WepType uint16 `json:"wepType"` // weapon category integer from EquipParamWeapon (0 for non-weapons)
AoWCompatBitmask uint64 `json:"aowCompatBitmask"` // 36-bit canMountWep bitmask (non-zero for AoWs only)
}
type PresetAddSettings ¶
type PresetApplyResult ¶
type PresetItem ¶
type StatValidationResult ¶
type StatValidationResult struct {
Valid bool `json:"valid"`
Errors []string `json:"errors"`
Warnings []string `json:"warnings"`
}
StatValidationResult holds the results of class-aware stat validation.
type WorldPresetData ¶
type WorldPresetData struct {
Graces []uint32 `json:"graces,omitempty"`
Bosses []uint32 `json:"bosses,omitempty"`
SummoningPools []uint32 `json:"summoningPools,omitempty"`
Colosseums []uint32 `json:"colosseums,omitempty"`
MapFlags []uint32 `json:"mapFlags,omitempty"`
Cookbooks []uint32 `json:"cookbooks,omitempty"`
BellBearings []uint32 `json:"bellBearings,omitempty"`
Whetblades []uint32 `json:"whetblades,omitempty"`
Gestures []uint32 `json:"gestures,omitempty"`
Regions []uint32 `json:"regions,omitempty"`
WorldPickups []uint32 `json:"worldPickups,omitempty"`
}
func ExportWorldState ¶
func ExportWorldState(slot *core.SaveSlot) (*WorldPresetData, error)