dodumap

package module
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2025 License: GPL-3.0 Imports: 15 Imported by: 11

README

dodumap

Mapping raw Dofus data to a more usable format.

go get -u github.com/dofusdude/dodumap

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Languages = []string{"fr", "en", "de", "es", "it", "pt"}
View Source
var LanguagesUnity = []string{"fr", "en", "de", "es", "pt"}

Functions

func CleanJSON

func CleanJSON(jsonStr string) string

func ConditionWithOperator

func ConditionWithOperator(input string, operator string, langs *map[string]LangDict, out *MappedMultilangCondition, data *JSONGameData) bool

func ConditionWithOperatorUnity added in v0.4.0

func ConditionWithOperatorUnity(input string, operator string, langs *map[string]LangDictUnity, out *MappedMultilangCondition, data *JSONGameDataUnity) bool

func DeleteDamageFormatter

func DeleteDamageFormatter(input string) string

func DeleteDamageFormatterUnity added in v0.4.0

func DeleteDamageFormatterUnity(input string) string

func DeleteReplacer

func DeleteReplacer(input string) string

func ElementFromCode

func ElementFromCode(codeUndef string) int

func LoadPersistedElements

func LoadPersistedElements(persistenceDir string, release string, majorVersion int) error

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func NumSpellFormatter

func NumSpellFormatter(input string, lang string, gameData *JSONGameData, langs *map[string]LangDict, diceNum *int, diceSide *int, value *int, effectNameId int, numIsSpell bool, useDice bool, frNumSigned *int, frSideSigned *int) (string, int)

NumSpellFormatter returns info about min max with in. -1 "only_min", -2 "no_min_max"

func NumSpellFormatterUnity added in v0.4.0

func NumSpellFormatterUnity(input string, lang string, gameData *JSONGameDataUnity, langs *map[string]LangDictUnity, diceNum *int, diceSide *int, value *int, effectNameId int, numIsSpell bool, useDice bool, frNumSigned *int, frSideSigned *int) (string, int)

func ParseCondition

func ParseCondition(condition string, langs *map[string]LangDict, data *JSONGameData) ([]MappedMultilangCondition, *ConditionTreeNodeMapped)

func ParseEffects

func ParseEffects(data *JSONGameData, allEffects [][]*JSONGameItemPossibleEffect, langs *map[string]LangDict) [][]MappedMultilangEffect

func ParseEffectsUnity added in v0.4.0

func ParseEffectsUnity(data *JSONGameDataUnity, allEffects [][]*JSONGameItemPossibleEffectUnity, langs *map[string]LangDictUnity) [][]*MappedMultilangEffect

func ParseItemCombo added in v0.2.1

func ParseItemCombo(rawEffects [][]*JSONGameItemPossibleEffect, effects [][]MappedMultilangEffect) [][]MappedMultilangSetEffect

func ParseItemComboUnity added in v0.4.0

func ParseItemComboUnity(effects [][]*MappedMultilangEffect) map[int][]MappedMultilangEffect

func ParseRawDataPart

func ParseRawDataPart[T HasId](fileSource string, result chan map[int]T, dir string)

func ParseRawDataPartUnity added in v0.4.0

func ParseRawDataPartUnity[T HasId](fileSource string, result chan map[int]T, dir string)

func ParseRawLanguages

func ParseRawLanguages(dir string) map[string]LangDict

func ParseRawLanguagesUnity added in v0.4.0

func ParseRawLanguagesUnity(dir string) map[string]LangDictUnity

func ParseSigness

func ParseSigness(input string) (bool, bool)

func ParseSignessUnity added in v0.5.2

func ParseSignessUnity(input string) (bool, bool)

func PersistElements

func PersistElements(elementPath string, itemTypePath string) error

func PrepareAndCreateRangeRegex

func PrepareAndCreateRangeRegex(input string, extract bool) (string, *regexp.Regexp)

func PrepareAndCreateRangeRegexUnity added in v0.4.0

func PrepareAndCreateRangeRegexUnity(input string, extract bool) (string, *regexp.Regexp)

func PrepareTextForRegex

func PrepareTextForRegex(input string) string

func PrintTree added in v0.1.1

func PrintTree(node *ConditionTreeNode, level int)

func SingularPluralFormatter

func SingularPluralFormatter(input string, amount int, lang string) string

func SingularPluralFormatterUnity added in v0.4.0

func SingularPluralFormatterUnity(input string, amount int, lang string) string

Types

type ConditionTreeNode added in v0.1.1

type ConditionTreeNode struct {
	Value    string
	Type     NodeType
	Children []*ConditionTreeNode
}

func ParseExpression added in v0.1.1

func ParseExpression(exp string) *ConditionTreeNode

func (*ConditionTreeNode) AddChild added in v0.1.1

func (n *ConditionTreeNode) AddChild(child *ConditionTreeNode)

AddChild adds a child node

type ConditionTreeNodeMapped added in v0.1.1

type ConditionTreeNodeMapped struct {
	Value     *MappedMultilangCondition  `json:"value"`
	IsOperand bool                       `json:"is_operand"`
	Relation  *string                    `json:"relation"` // "and" or "or"
	Children  []*ConditionTreeNodeMapped `json:"children"`
}

func ParseConditionUnity added in v0.4.0

func ParseConditionUnity(condition string, langs *map[string]LangDictUnity, data *JSONGameDataUnity) *ConditionTreeNodeMapped

type HasId

type HasId interface {
	GetID() int
}

type HasMerge added in v0.4.0

type HasMerge[A any, B any] interface {
	Merge(other B) A
}

type JSONGameAlamanaxCalendar added in v0.2.0

type JSONGameAlamanaxCalendar struct {
	Id         int   `json:"id"`
	DescId     int   `json:"descId"`
	NameId     int   `json:"nameId"`
	NpcId      int   `json:"npcId"`
	BonusesIds []int `json:"bonusesIds"`
}

func (JSONGameAlamanaxCalendar) GetID added in v0.2.0

func (i JSONGameAlamanaxCalendar) GetID() int

type JSONGameAlamanaxCalendarUnity added in v0.4.0

type JSONGameAlamanaxCalendarUnity struct {
	Id         int                        `json:"id"`
	DescId     string                     `json:"descId"` // int
	NameId     int                        `json:"nameId"`
	NpcId      int                        `json:"npcId"`
	BonusesIds JSONGameUnityAnkamaIdArray `json:"bonusesIds"`
}

func (JSONGameAlamanaxCalendarUnity) GetID added in v0.4.0

type JSONGameArea

type JSONGameArea struct {
	Id              int                `json:"id"`
	NameId          int                `json:"nameId"`
	SuperAreaId     int                `json:"superAreaId"`
	ContainHouses   bool               `json:"containHouses"`
	ContainPaddocks bool               `json:"containPaddocks"`
	Bounds          JSONGameAreaBounds `json:"bounds"`
	WorldmapId      int                `json:"worldmapId"`
	HasWorldMap     bool               `json:"hasWorldMap"`
}

func (JSONGameArea) GetID

func (i JSONGameArea) GetID() int

type JSONGameAreaBounds

type JSONGameAreaBounds struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

type JSONGameAreaUnity added in v0.4.0

type JSONGameAreaUnity struct {
	Id              int                `json:"id"`
	NameId          int                `json:"nameId"`
	SuperAreaId     int                `json:"superAreaId"`
	ContainHouses   int                `json:"containHouses"`   // bool
	ContainPaddocks int                `json:"containPaddocks"` // bool
	Bounds          JSONGameAreaBounds `json:"bounds"`
	WorldmapId      int                `json:"worldmapId"`
	HasWorldMap     int                `json:"hasWorldMap"` // bool
}

func (JSONGameAreaUnity) GetID added in v0.4.0

func (i JSONGameAreaUnity) GetID() int

type JSONGameBonus

type JSONGameBonus struct {
	Amount        int   `json:"amount"`
	Id            int   `json:"id"`
	CriterionsIds []int `json:"criterionsIds"`
	Type          int   `json:"type"`
}

func (JSONGameBonus) GetID

func (i JSONGameBonus) GetID() int

type JSONGameBonusUnity added in v0.4.0

type JSONGameBonusUnity struct {
	Amount        int                        `json:"amount"`
	Id            int                        `json:"id"`
	CriterionsIds JSONGameUnityAnkamaIdArray `json:"criterionsIds"`
	Type          int                        `json:"type"`
}

func (JSONGameBonusUnity) GetID added in v0.4.0

func (i JSONGameBonusUnity) GetID() int

type JSONGameBreed

type JSONGameBreed struct {
	Id            int `json:"id"`
	ShortNameId   int `json:"shortNameId"`
	LongNameId    int `json:"longNameId"`
	DescriptionId int `json:"descriptionId"`
}

func (JSONGameBreed) GetID

func (i JSONGameBreed) GetID() int

type JSONGameBreedUnity added in v0.4.0

type JSONGameBreedUnity struct {
	Id                         int                        `json:"id"`
	ShortNameId                string                     `json:"shortNameId"` // int
	LongNameId                 string                     `json:"longNameId"`  // int
	DescriptionId              int                        `json:"descriptionId"`
	GameplayClassDescriptionId string                     `json:"gameplayClassDescriptionId"` // int
	GuideItemId                int                        `json:"guideItemId"`
	MaleArtwork                int                        `json:"maleArtwork"`
	FemaleArtwork              int                        `json:"femaleArtwork"`
	BreedSpellsId              JSONGameUnityAnkamaIdArray `json:"breedSpellsId"`
	BreedRolesId               JSONGameUnityArray[struct {
		BreedId       int `json:"breedId"`
		RoleId        int `json:"roleId"`
		DescriptionId int `json:"descriptionId"`
		Value         int `json:"value"`
		Order         int `json:"order"`
	}] `json:"breedRolesId"`
	Complexity int `json:"complexity"`
	SortIndex  int `json:"sortIndex"`
}

actually a playable class

func (JSONGameBreedUnity) GetID added in v0.4.0

func (i JSONGameBreedUnity) GetID() int

type JSONGameCoordinate added in v0.2.0

type JSONGameCoordinate struct {
	X int `json:"x"`
	Y int `json:"y"`
}

type JSONGameData

type JSONGameData struct {
	Items     map[int]JSONGameItem
	Sets      map[int]JSONGameSet
	ItemTypes map[int]JSONGameItemType

	Recipes map[int]JSONGameRecipe

	Mounts map[int]JSONGameMount

	MountFamilys map[int]JSONGameMountFamily
	// contains filtered or unexported fields
}

func ParseRawData

func ParseRawData(dir string) *JSONGameData

type JSONGameDataUnity added in v0.4.0

type JSONGameDataUnity struct {
	Items     map[int]JSONGameItemUnity
	Sets      map[int]JSONGameSetUnity
	ItemTypes map[int]JSONGameItemTypeUnity

	Recipes map[int]JSONGameRecipeUnity

	Mounts map[int]JSONGameMountUnity

	MountFamilys map[int]JSONGameMountFamilyUnity
	// contains filtered or unexported fields
}

func ParseRawDataUnity added in v0.4.0

func ParseRawDataUnity(dir string) *JSONGameDataUnity

type JSONGameEffect

type JSONGameEffect struct {
	Id                       int  `json:"id"`
	DescriptionId            int  `json:"descriptionId"`
	IconId                   int  `json:"iconId"`
	Characteristic           int  `json:"characteristic"`
	Category                 int  `json:"category"`
	UseDice                  bool `json:"useDice"`
	Active                   bool `json:"active"`
	TheoreticalDescriptionId int  `json:"theoreticalDescriptionId"`
	BonusType                int  `json:"bonusType"` // -1,0,+1
	ElementId                int  `json:"elementId"`
	UseInFight               bool `json:"useInFight"`
}

func (JSONGameEffect) GetID

func (i JSONGameEffect) GetID() int

type JSONGameEffectUnity added in v0.4.0

type JSONGameEffectUnity struct {
	Id                       int    `json:"id"`
	DescriptionId            int    `json:"descriptionId"`
	IconId                   int    `json:"iconId"`
	Characteristic           int    `json:"characteristic"`
	Category                 int    `json:"category"`
	UseDice                  int    `json:"useDice"`                  // bool
	Active                   int    `json:"active"`                   // bool
	TheoreticalDescriptionId string `json:"theoreticalDescriptionId"` // and int inside a string lol
	BonusType                int    `json:"bonusType"`                // -1,0,+1
	ElementId                int    `json:"elementId"`
	UseInFight               int    `json:"useInFight"`  // bool
	IsInPercent              int    `json:"isInPercent"` // bool
}

func (JSONGameEffectUnity) GetID added in v0.4.0

func (i JSONGameEffectUnity) GetID() int

type JSONGameItem

type JSONGameItem struct {
	Id            int `json:"id"`
	TypeId        int `json:"typeId"`
	DescriptionId int `json:"descriptionId"`
	IconId        int `json:"iconId"`
	NameId        int `json:"nameId"`
	Level         int `json:"level"`

	PossibleEffects        []*JSONGameItemPossibleEffect `json:"possibleEffects"`
	RecipeIds              []int                         `json:"recipeIds"`
	Pods                   int                           `json:"realWeight"`
	ParseEffects           bool                          `json:"useDice"`
	EvolutiveEffectIds     []int                         `json:"evolutiveEffectIds"`
	DropMonsterIds         []int                         `json:"dropMonsterIds"`
	ItemSetId              int                           `json:"itemSetId"`
	Criteria               string                        `json:"criteria"`
	CriticalHitBonus       int                           `json:"criticalHitBonus"`
	TwoHanded              bool                          `json:"twoHanded"`
	MaxCastPerTurn         int                           `json:"maxCastPerTurn"`
	ApCost                 int                           `json:"apCost"`
	Range                  int                           `json:"range"`
	MinRange               int                           `json:"minRange"`
	CriticalHitProbability int                           `json:"criticalHitProbability"`
}

func (JSONGameItem) GetID

func (i JSONGameItem) GetID() int

type JSONGameItemPossibleEffect

type JSONGameItemPossibleEffect struct {
	EffectId     int `json:"effectId"`
	MinimumValue int `json:"diceNum"`
	MaximumValue int `json:"diceSide"`
	Value        int `json:"value"`

	BaseEffectId  int `json:"baseEffectId"`
	EffectElement int `json:"effectElement"`
	Dispellable   int `json:"dispellable"`
	SpellId       int `json:"spellId"`
	Duration      int `json:"duration"`
}

func (JSONGameItemPossibleEffect) GetID

func (i JSONGameItemPossibleEffect) GetID() int

type JSONGameItemPossibleEffectUnity added in v0.4.0

type JSONGameItemPossibleEffectUnity struct {
	EffectId     int `json:"effectId"`
	MinimumValue int `json:"diceNum"`
	MaximumValue int `json:"diceSide"`
	Value        int `json:"value"`

	BaseEffectId  int `json:"baseEffectId"`
	EffectElement int `json:"effectElement"`
	Dispellable   int `json:"dispellable"`
	SpellId       int `json:"spellId"`
	Duration      int `json:"duration"`
}

func (JSONGameItemPossibleEffectUnity) GetID added in v0.4.0

type JSONGameItemType

type JSONGameItemType struct {
	Id          int `json:"id"`
	NameId      int `json:"nameId"`
	SuperTypeId int `json:"superTypeId"`
	CategoryId  int `json:"categoryId"`
}

func (JSONGameItemType) GetID

func (i JSONGameItemType) GetID() int

type JSONGameItemTypeUnity added in v0.4.0

type JSONGameItemTypeUnity struct {
	Id          int `json:"id"`
	NameId      int `json:"nameId"`
	SuperTypeId int `json:"superTypeId"`
	CategoryId  int `json:"categoryId"`
	Plural      int `json:"plural"` // 0, 1
	Gender      int `json:"gender"` // 0, 1, 2
}

func (JSONGameItemTypeUnity) GetID added in v0.4.0

func (i JSONGameItemTypeUnity) GetID() int

type JSONGameItemUnity added in v0.4.0

type JSONGameItemUnity struct {
	Id            int `json:"id"`
	TypeId        int `json:"typeId"`
	DescriptionId int `json:"descriptionId"`
	IconId        int `json:"iconId"`
	NameId        int `json:"nameId"`
	Level         int `json:"level"`

	PossibleEffects        []*JSONGameItemPossibleEffectUnity `json:"possibleEffects"`
	RecipeIds              JSONGameUnityAnkamaIdArray         `json:"recipeIds"`
	Pods                   int                                `json:"realWeight"`
	EvolutiveEffectIds     JSONGameUnityAnkamaIdArray         `json:"evolutiveEffectIds"`
	DropMonsterIds         JSONGameUnityAnkamaIdArray         `json:"dropMonsterIds"`
	ItemSetId              int                                `json:"itemSetId"`
	Criteria               string                             `json:"criteria"`
	CriticalHitBonus       int                                `json:"criticalHitBonus"`
	MaxCastPerTurn         int                                `json:"maxCastPerTurn"`
	ApCost                 int                                `json:"apCost"`
	Range                  int                                `json:"range"`
	MinRange               int                                `json:"minRange"`
	CriticalHitProbability int                                `json:"criticalHitProbability"`
}

func (JSONGameItemUnity) GetID added in v0.4.0

func (i JSONGameItemUnity) GetID() int

type JSONGameItemUnityRaw added in v0.4.0

type JSONGameItemUnityRaw struct {
	Id            int `json:"id"`
	TypeId        int `json:"typeId"`
	DescriptionId int `json:"descriptionId"`
	IconId        int `json:"iconId"`
	NameId        int `json:"nameId"`
	Level         int `json:"level"`

	PossibleEffects        JSONGameUnityRefArray      `json:"possibleEffects"`
	RecipeIds              JSONGameUnityAnkamaIdArray `json:"recipeIds"`
	Pods                   int                        `json:"realWeight"`
	EvolutiveEffectIds     JSONGameUnityAnkamaIdArray `json:"evolutiveEffectIds"`
	DropMonsterIds         JSONGameUnityAnkamaIdArray `json:"dropMonsterIds"`
	ItemSetId              int                        `json:"itemSetId"`
	Criteria               string                     `json:"criteria"`
	CriticalHitBonus       int                        `json:"criticalHitBonus"`
	MaxCastPerTurn         int                        `json:"maxCastPerTurn"`
	ApCost                 int                        `json:"apCost"`
	Range                  int                        `json:"range"`
	MinRange               int                        `json:"minRange"`
	CriticalHitProbability int                        `json:"criticalHitProbability"`
}

func (JSONGameItemUnityRaw) GetID added in v0.4.0

func (i JSONGameItemUnityRaw) GetID() int

func (*JSONGameItemUnityRaw) Merge added in v0.4.0

type JSONGameMount

type JSONGameMount struct {
	Id       int                           `json:"id"`
	FamilyId int                           `json:"familyId"`
	NameId   int                           `json:"nameId"`
	Effects  []*JSONGameItemPossibleEffect `json:"effects"`
}

func (JSONGameMount) GetID

func (i JSONGameMount) GetID() int

type JSONGameMountFamily

type JSONGameMountFamily struct {
	Id      int    `json:"id"`
	NameId  int    `json:"nameId"`
	HeadUri string `json:"headUri"`
}

func (JSONGameMountFamily) GetID

func (i JSONGameMountFamily) GetID() int

type JSONGameMountFamilyUnity added in v0.4.0

type JSONGameMountFamilyUnity struct {
	Id      int    `json:"id"`
	NameId  int    `json:"nameId"`
	HeadUri string `json:"headUri"`
}

func (JSONGameMountFamilyUnity) GetID added in v0.4.0

func (i JSONGameMountFamilyUnity) GetID() int

type JSONGameMountUnity added in v0.4.0

type JSONGameMountUnity struct {
	Id            int                                `json:"id"`
	FamilyId      int                                `json:"familyId"`
	NameId        int                                `json:"nameId"`
	Effects       []*JSONGameItemPossibleEffectUnity `json:"effects"`
	CertificateId int                                `json:"certificateId"`
}

func (JSONGameMountUnity) GetID added in v0.4.0

func (i JSONGameMountUnity) GetID() int

type JSONGameMountUnityRaw added in v0.4.0

type JSONGameMountUnityRaw struct {
	Id            int                   `json:"id"`
	FamilyId      int                   `json:"familyId"`
	NameId        int                   `json:"nameId"`
	Effects       JSONGameUnityRefArray `json:"effects"`
	CertificateId int                   `json:"certificateId"`
}

func (JSONGameMountUnityRaw) GetID added in v0.4.0

func (i JSONGameMountUnityRaw) GetID() int

func (*JSONGameMountUnityRaw) Merge added in v0.4.0

type JSONGameNPC

type JSONGameNPC struct {
	Id             int     `json:"id"`
	NameId         int     `json:"nameId"`
	DialogMessages [][]int `json:"dialogMessages"`
	DialogReplies  [][]int `json:"dialogReplies"`
	Actions        []int   `json:"actions"`
}

func (JSONGameNPC) GetID

func (i JSONGameNPC) GetID() int

type JSONGameNPCUnity added in v0.4.0

type JSONGameNPCUnity struct {
	Id             int `json:"id"`
	NameId         int `json:"nameId"`
	DialogMessages JSONGameUnityArray[struct {
		Values JSONGameUnityAnkamaIdArray `json:"values"`
	}] `json:"dialogMessages"`
	DialogReplies JSONGameUnityArray[struct {
		Values JSONGameUnityAnkamaIdArray `json:"values"`
	}] `json:"dialogReplies"`
	Actions JSONGameUnityAnkamaIdArray `json:"actions"`
}

func (JSONGameNPCUnity) GetID added in v0.4.0

func (i JSONGameNPCUnity) GetID() int

type JSONGameQuest added in v0.2.0

type JSONGameQuest struct {
	Id             int    `json:"id"`
	NameId         int    `json:"nameId"`
	StepIds        []int  `json:"stepIds"`
	CategoryId     int    `json:"categoryId"`
	RepeatType     int    `json:"repeatType"`
	RepeatLimit    int    `json:"repeatLimit"`
	IsDungeonQuest bool   `json:"isDungeonQuest"`
	LevelMin       int    `json:"levelMin"`
	LevelMax       int    `json:"levelMax"`
	Followable     bool   `json:"followable"`
	IsPartyQuest   bool   `json:"isPartyQuest"`
	StartCriterion string `json:"startCriterion"`
}

func (JSONGameQuest) GetID added in v0.2.0

func (i JSONGameQuest) GetID() int

type JSONGameQuestCategory added in v0.2.0

type JSONGameQuestCategory struct {
	Id       int   `json:"id"`
	NameId   int   `json:"nameId"`
	Order    int   `json:"order"`
	QuestIds []int `json:"questIds"`
}

func (JSONGameQuestCategory) GetID added in v0.2.0

func (i JSONGameQuestCategory) GetID() int

type JSONGameQuestCategoryUnity added in v0.4.0

type JSONGameQuestCategoryUnity struct {
	Id       int                        `json:"id"`
	NameId   int                        `json:"nameId"`
	Order    int                        `json:"order"`
	QuestIds JSONGameUnityAnkamaIdArray `json:"questIds"`
}

func (JSONGameQuestCategoryUnity) GetID added in v0.4.0

func (i JSONGameQuestCategoryUnity) GetID() int

type JSONGameQuestObjective added in v0.2.0

type JSONGameQuestObjective struct {
	Id         int                    `json:"id"`
	Coords     JSONGameCoordinate     `json:"coords"`
	MapId      int                    `json:"mapId"`
	Parameters JSONGameQuestParameter `json:"parameters"`
	StepId     int                    `json:"stepId"`
	TypeId     int                    `json:"typeId"`
}

func (JSONGameQuestObjective) GetID added in v0.2.0

func (i JSONGameQuestObjective) GetID() int

type JSONGameQuestObjectiveUnity added in v0.4.0

type JSONGameQuestObjectiveUnity struct {
	Id         int                         `json:"id"`
	Coords     JSONGameCoordinate          `json:"coords"`
	MapId      int                         `json:"mapId"`
	Parameters JSONGameQuestParameterUnity `json:"parameters"`
	StepId     int                         `json:"stepId"`
	TypeId     int                         `json:"typeId"`
}

func (JSONGameQuestObjectiveUnity) GetID added in v0.4.0

func (i JSONGameQuestObjectiveUnity) GetID() int

type JSONGameQuestParameter added in v0.2.0

type JSONGameQuestParameter struct {
	DungeonOnly bool `json:"dungeonOnly"`
	NumParams   int  `json:"numParams"`
	Parameter0  int  `json:"parameter0"`
	Parameter1  int  `json:"parameter1"`
	Parameter2  int  `json:"parameter2"`
	Parameter3  int  `json:"parameter3"`
	Parameter4  int  `json:"parameter4"`
}

type JSONGameQuestParameterUnity added in v0.4.0

type JSONGameQuestParameterUnity struct {
	DungeonOnly int `json:"dungeonOnly"` // bool
	NumParams   int `json:"numParams"`
	Parameter0  int `json:"parameter0"`
	Parameter1  int `json:"parameter1"`
	Parameter2  int `json:"parameter2"`
	Parameter3  int `json:"parameter3"`
	Parameter4  int `json:"parameter4"`
}

type JSONGameQuestStep added in v0.2.0

type JSONGameQuestStep struct {
	Id            int     `json:"id"`
	DescriptionId int     `json:"descriptionId"`
	DialogId      int     `json:"dialogId"`
	NameId        int     `json:"nameId"`
	OptimalLevel  int     `json:"optimalLevel"`
	Duration      float64 `json:"duration"`
	ObjectiveIds  []int   `json:"objectiveIds"`
	RewardsIds    []int   `json:"rewardsIds"`
	QuestId       int     `json:"questId"`
}

func (JSONGameQuestStep) GetID added in v0.2.0

func (i JSONGameQuestStep) GetID() int

type JSONGameQuestStepRewards added in v0.2.0

type JSONGameQuestStepRewards struct {
	Id                        int     `json:"id"`
	ExperienceRatio           float64 `json:"experienceRatio"`
	KamasRatio                float64 `json:"kamasRatio"`
	ItemsReward               [][]int `json:"itemsReward"`
	KamasScaleWithPlayerLevel bool    `json:"kamasScaleWithPlayerLevel"`
	LevelMax                  int     `json:"levelMax"`
	LevelMin                  int     `json:"levelMin"`
	//SpellsReward []int `json:"spellsReward"`
	//EmotesReward []int `json:"emotesReward"`
	//TitlesReward []int `json:"titlesReward"`
	StepId int `json:"stepId"`
}

func (JSONGameQuestStepRewards) GetID added in v0.2.0

func (i JSONGameQuestStepRewards) GetID() int

type JSONGameQuestStepRewardsUnity added in v0.4.0

type JSONGameQuestStepRewardsUnity struct {
	Id              int     `json:"id"`
	ExperienceRatio float64 `json:"experienceRatio"`
	KamasRatio      float64 `json:"kamasRatio"`
	ItemsReward     JSONGameUnityArray[struct {
		Values JSONGameUnityArray[int] `json:"values"`
	}] `json:"itemsReward"`
	KamasScaleWithPlayerLevel int `json:"kamasScaleWithPlayerLevel"` // bool
	LevelMax                  int `json:"levelMax"`
	LevelMin                  int `json:"levelMin"`
	//SpellsReward []int `json:"spellsReward"`
	//EmotesReward []int `json:"emotesReward"`
	//TitlesReward []int `json:"titlesReward"`
	StepId int `json:"stepId"`
}

func (JSONGameQuestStepRewardsUnity) GetID added in v0.4.0

type JSONGameQuestStepUnity added in v0.4.0

type JSONGameQuestStepUnity struct {
	Id            int                        `json:"id"`
	DescriptionId int                        `json:"descriptionId"`
	DialogId      int                        `json:"dialogId"`
	NameId        int                        `json:"nameId"`
	OptimalLevel  int                        `json:"optimalLevel"`
	Duration      float64                    `json:"duration"`
	ObjectiveIds  JSONGameUnityAnkamaIdArray `json:"objectiveIds"`
	RewardsIds    JSONGameUnityAnkamaIdArray `json:"rewardsIds"`
	QuestId       int                        `json:"questId"`
}

func (JSONGameQuestStepUnity) GetID added in v0.4.0

func (i JSONGameQuestStepUnity) GetID() int

type JSONGameQuestUnity added in v0.4.0

type JSONGameQuestUnity struct {
	Id             int                        `json:"id"`
	NameId         int                        `json:"nameId"`
	StepIds        JSONGameUnityAnkamaIdArray `json:"stepIds"`
	CategoryId     int                        `json:"categoryId"`
	RepeatType     int                        `json:"repeatType"`
	RepeatLimit    int                        `json:"repeatLimit"`
	IsDungeonQuest int                        `json:"isDungeonQuest"` // bool
	LevelMin       int                        `json:"levelMin"`
	LevelMax       int                        `json:"levelMax"`
	Followable     int                        `json:"followable"`   // bool
	IsPartyQuest   int                        `json:"isPartyQuest"` // bool
	StartCriterion string                     `json:"startCriterion"`
}

func (JSONGameQuestUnity) GetID added in v0.4.0

func (i JSONGameQuestUnity) GetID() int

type JSONGameRecipe

type JSONGameRecipe struct {
	Id            int   `json:"resultId"`
	NameId        int   `json:"resultNameId"`
	TypeId        int   `json:"resultTypeId"`
	Level         int   `json:"resultLevel"`
	IngredientIds []int `json:"ingredientIds"`
	Quantities    []int `json:"quantities"`
	JobId         int   `json:"jobId"`
	SkillId       int   `json:"skillId"`
}

func (JSONGameRecipe) GetID

func (i JSONGameRecipe) GetID() int

type JSONGameRecipeUnity added in v0.4.0

type JSONGameRecipeUnity struct {
	Id            int                        `json:"resultId"`
	NameId        string                     `json:"resultNameId"` // int in a string
	TypeId        int                        `json:"resultTypeId"`
	Level         int                        `json:"resultLevel"`
	IngredientIds JSONGameUnityAnkamaIdArray `json:"ingredientIds"`
	Quantities    JSONGameUnityArray[int]    `json:"quantities"`
	JobId         int                        `json:"jobId"`
	SkillId       int                        `json:"skillId"`
}

func (JSONGameRecipeUnity) GetID added in v0.4.0

func (i JSONGameRecipeUnity) GetID() int

type JSONGameSet

type JSONGameSet struct {
	Id      int                             `json:"id"`
	ItemIds []int                           `json:"items"`
	NameId  int                             `json:"nameId"`
	Effects [][]*JSONGameItemPossibleEffect `json:"effects"`
}

func (JSONGameSet) GetID

func (i JSONGameSet) GetID() int

type JSONGameSetUnity added in v0.4.0

type JSONGameSetUnity struct {
	Id int `json:"id"`
	//BonusIsSecret int                        `json:"bonusIsSecret"` // always 0, maybe used in the future
	ItemIds []int                                `json:"items"`
	NameId  int                                  `json:"nameId"`
	Effects [][]*JSONGameItemPossibleEffectUnity `json:"effects"`
}

func (JSONGameSetUnity) GetID added in v0.4.0

func (i JSONGameSetUnity) GetID() int

type JSONGameSetUnityRaw added in v0.4.0

type JSONGameSetUnityRaw struct {
	Id int `json:"id"`
	//BonusIsSecret int                        `json:"bonusIsSecret"` // always 0, maybe used in the future
	ItemIds JSONGameUnityAnkamaIdArray `json:"items"`
	NameId  int                        `json:"nameId"`
	Effects JSONGameUnityArray[struct {
		Values JSONGameUnityRefArray `json:"values"`
	}] `json:"effects"`
}

func (JSONGameSetUnityRaw) GetID added in v0.4.0

func (i JSONGameSetUnityRaw) GetID() int

func (*JSONGameSetUnityRaw) Merge added in v0.4.0

type JSONGameSpell

type JSONGameSpell struct {
	Id            int   `json:"id"`
	NameId        int   `json:"nameId"`
	DescriptionId int   `json:"descriptionId"`
	TypeId        int   `json:"typeId"`
	Order         int   `json:"order"`
	IconId        int   `json:"iconId"`
	SpellLevels   []int `json:"spellLevels"`
}

func (JSONGameSpell) GetID

func (i JSONGameSpell) GetID() int

type JSONGameSpellType

type JSONGameSpellType struct {
	Id          int `json:"id"`
	LongNameId  int `json:"longNameId"`
	ShortNameId int `json:"shortNameId"`
}

func (JSONGameSpellType) GetID

func (i JSONGameSpellType) GetID() int

type JSONGameSpellUnity added in v0.4.0

type JSONGameSpellUnity struct {
	Id            int                        `json:"id"`
	NameId        int                        `json:"nameId"`
	DescriptionId int                        `json:"descriptionId"`
	TypeId        int                        `json:"typeId"`
	Order         int                        `json:"order"`
	IconId        int                        `json:"iconId"`
	SpellLevels   JSONGameUnityAnkamaIdArray `json:"spellLevels"`
}

func (JSONGameSpellUnity) GetID added in v0.4.0

func (i JSONGameSpellUnity) GetID() int

type JSONGameTitle added in v0.1.4

type JSONGameTitle struct {
	Id           int  `json:"id"`
	NameMaleId   int  `json:"nameMaleId"`
	NameFemaleId int  `json:"nameFemaleId"`
	Visible      bool `json:"visible"`
	CategoryId   int  `json:"categoryId"`
}

func (JSONGameTitle) GetID added in v0.1.4

func (i JSONGameTitle) GetID() int

type JSONGameTitleUnity added in v0.4.0

type JSONGameTitleUnity struct {
	Id           int    `json:"id"`
	NameMaleId   string `json:"nameMaleId"`   // int in a string
	NameFemaleId string `json:"nameFemaleId"` // int in a string
	Visible      int    `json:"visible"`      // bool
	CategoryId   int    `json:"categoryId"`
}

func (JSONGameTitleUnity) GetID added in v0.4.0

func (i JSONGameTitleUnity) GetID() int

type JSONGameUnityAnkamaIdArray added in v0.4.0

type JSONGameUnityAnkamaIdArray = JSONGameUnityArray[int]

type JSONGameUnityArray added in v0.4.0

type JSONGameUnityArray[T any] struct {
	Array []T `json:"Array"`
}

type JSONGameUnityRefArray added in v0.4.0

type JSONGameUnityRefArray = JSONGameUnityArray[JsonGameUnityRef]

type JSONLangDict

type JSONLangDict struct {
	Texts    map[string]string `json:"texts"`    // "1": "Account- oder Abohandel",
	IdText   map[string]int    `json:"idText"`   // "790745": 27679,
	NameText map[string]int    `json:"nameText"` // "ui.chat.check0": 65984
}

type JSONLangDictUnity added in v0.4.0

type JSONLangDictUnity struct {
	Texts map[string]string `json:"entries"` // "1": "Account- oder Abohandel",
}

type JsonGameUnityRef added in v0.4.0

type JsonGameUnityRef struct {
	Ref string `json:"rid"`
}

type JsonGameUnityRefLookup added in v0.4.0

type JsonGameUnityRefLookup[T any, A any] struct {
	Ref      map[int64]A
	AnkamaId map[int]T
}

func ParseRawDataPartUnityMulti added in v0.4.0

func ParseRawDataPartUnityMulti[T HasId, A any](fileSource string, dir string, selfType string, otherType *string) JsonGameUnityRefLookup[T, A]

type LangDict

type LangDict struct {
	Texts    map[int]string
	IdText   map[int]int
	NameText map[string]int
}

func ParseLangDict

func ParseLangDict(langCode string, dir string) LangDict

type LangDictUnity added in v0.4.0

type LangDictUnity struct {
	Texts map[int]string `json:"entries"` // 1: "Account- oder Abohandel",
}

func ParseLangDictUnity added in v0.4.0

func ParseLangDictUnity(langCode string, dir string) LangDictUnity

type MappedMultilangCharacteristic

type MappedMultilangCharacteristic struct {
	Value map[string]string `json:"value"`
	Name  map[string]string `json:"name"`
}

type MappedMultilangCondition

type MappedMultilangCondition struct {
	Element   string            `json:"element"`
	ElementId int               `json:"element_id"`
	Operator  string            `json:"operator"`
	Value     int               `json:"value"`
	Templated map[string]string `json:"templated"`
}

type MappedMultilangEffect

type MappedMultilangEffect struct {
	Min              int               `json:"min"`
	Max              int               `json:"max"`
	Type             map[string]string `json:"type"`
	MinMaxIrrelevant int               `json:"min_max_irrelevant"`
	Templated        map[string]string `json:"templated"`
	ElementId        int               `json:"element_id"`
	IsMeta           bool              `json:"is_meta"`
	Active           bool              `json:"active"`
}

type MappedMultilangItem

type MappedMultilangItem struct {
	AnkamaId               int                             `json:"ankama_id"`
	Type                   MappedMultilangItemType         `json:"type"`
	Description            map[string]string               `json:"description"`
	Name                   map[string]string               `json:"name"`
	Image                  string                          `json:"image"`
	Conditions             []MappedMultilangCondition      `json:"conditions"`
	ConditionTree          *ConditionTreeNodeMapped        `json:"condition_tree"`
	Level                  int                             `json:"level"`
	UsedInRecipes          []int                           `json:"used_in_recipes"`
	Characteristics        []MappedMultilangCharacteristic `json:"characteristics"`
	Effects                []MappedMultilangEffect         `json:"effects"`
	DropMonsterIds         []int                           `json:"dropMonsterIds"`
	CriticalHitBonus       int                             `json:"criticalHitBonus"`
	TwoHanded              bool                            `json:"twoHanded"`
	MaxCastPerTurn         int                             `json:"maxCastPerTurn"`
	ApCost                 int                             `json:"apCost"`
	Range                  int                             `json:"range"`
	MinRange               int                             `json:"minRange"`
	CriticalHitProbability int                             `json:"criticalHitProbability"`
	Pods                   int                             `json:"pods"`
	IconId                 int                             `json:"iconId"`
	ParentSet              MappedMultilangSetReverseLink   `json:"parentSet"`
	HasParentSet           bool                            `json:"hasParentSet"`
}

func MapItems

func MapItems(data *JSONGameData, langs *map[string]LangDict) []MappedMultilangItem

type MappedMultilangItemType

type MappedMultilangItemType struct {
	Id          int               `json:"id"`
	Name        map[string]string `json:"name"`
	ItemTypeId  int               `json:"itemTypeId"`
	SuperTypeId int               `json:"superTypeId"`
	CategoryId  int               `json:"categoryId"`
}

type MappedMultilangItemUnity added in v0.4.0

type MappedMultilangItemUnity struct {
	AnkamaId               int                             `json:"ankama_id"`
	Type                   MappedMultilangItemType         `json:"type"`
	Description            map[string]string               `json:"description"`
	Name                   map[string]string               `json:"name"`
	Image                  string                          `json:"image"`
	Conditions             *ConditionTreeNodeMapped        `json:"conditions"`
	Level                  int                             `json:"level"`
	UsedInRecipes          []int                           `json:"used_in_recipes"`
	Characteristics        []MappedMultilangCharacteristic `json:"characteristics"`
	Effects                []MappedMultilangEffect         `json:"effects"`
	DropMonsterIds         []int                           `json:"dropMonsterIds"`
	CriticalHitBonus       int                             `json:"criticalHitBonus"`
	MaxCastPerTurn         int                             `json:"maxCastPerTurn"`
	ApCost                 int                             `json:"apCost"`
	Range                  int                             `json:"range"`
	MinRange               int                             `json:"minRange"`
	CriticalHitProbability int                             `json:"criticalHitProbability"`
	Pods                   int                             `json:"pods"`
	IconId                 int                             `json:"iconId"`
	ParentSet              MappedMultilangSetReverseLink   `json:"parentSet"`
	HasParentSet           bool                            `json:"hasParentSet"`
}

changes: removed twoHanded and conditions

func MapItemsUnity added in v0.4.0

func MapItemsUnity(data *JSONGameDataUnity, langs *map[string]LangDictUnity) []MappedMultilangItemUnity

type MappedMultilangMount

type MappedMultilangMount struct {
	AnkamaId   int                     `json:"ankama_id"`
	Name       map[string]string       `json:"name"`
	FamilyId   int                     `json:"family_id"`
	FamilyName map[string]string       `json:"family_name"`
	Effects    []MappedMultilangEffect `json:"effects"`
}

func MapMounts

func MapMounts(data *JSONGameData, langs *map[string]LangDict) []MappedMultilangMount

func MapMountsUnity added in v0.4.0

func MapMountsUnity(data *JSONGameDataUnity, langs *map[string]LangDictUnity) []MappedMultilangMount

type MappedMultilangNPCAlmanax added in v0.2.0

type MappedMultilangNPCAlmanax struct {
	OfferingReceiver string   `json:"offeringReceiver"`
	Days             []string `json:"days"`
	Offering         struct {
		ItemId    int               `json:"itemId"`
		ItemName  map[string]string `json:"itemName"`
		Quantity  int               `json:"quantity"`
		ImageUrls struct {
			HD   string `json:"hd"`
			HQ   string `json:"hq"`
			SD   string `json:"sd"`
			Icon string `json:"icon"`
		}
	}
	Bonus       map[string]string `json:"bonus"`
	BonusType   map[string]string `json:"bonusType"`
	RewardKamas int               `json:"rewardKamas"`
}

func MapAlmanax added in v0.2.0

func MapAlmanax(data *JSONGameData, langs *map[string]LangDict) []MappedMultilangNPCAlmanax

type MappedMultilangNPCAlmanaxUnity added in v0.6.0

type MappedMultilangNPCAlmanaxUnity struct {
	OfferingReceiver string   `json:"offeringReceiver"`
	Days             []string `json:"days"`
	Offering         struct {
		ItemId         int               `json:"itemId"`
		ItemCategoryId int               `json:"itemCategoryId"`
		ItemName       map[string]string `json:"itemName"`
		Quantity       int               `json:"quantity"`
	} `json:"offering"`
	Bonus           map[string]string `json:"bonus"`
	BonusType       map[string]string `json:"bonusType"`
	RewardKamas     int               `json:"rewardKamas"`
	ExperienceRatio float64           `json:"experienceRatio"`
	OptimalLevel    int               `json:"optimalLevel"`
	Duration        float64           `json:"duration"`
}

func MapAlmanaxUnity added in v0.4.0

func MapAlmanaxUnity(data *JSONGameDataUnity, langs *map[string]LangDictUnity) []MappedMultilangNPCAlmanaxUnity

type MappedMultilangRecipe

type MappedMultilangRecipe struct {
	ResultId int                          `json:"result_id"`
	Entries  []MappedMultilangRecipeEntry `json:"entries"`
}

func MapRecipes

func MapRecipes(data *JSONGameData) []MappedMultilangRecipe

func MapRecipesUnity added in v0.4.0

func MapRecipesUnity(data *JSONGameDataUnity) []MappedMultilangRecipe

type MappedMultilangRecipeEntry

type MappedMultilangRecipeEntry struct {
	ItemId   int `json:"item_id"`
	Quantity int `json:"quantity"`
}

type MappedMultilangSet

type MappedMultilangSet struct {
	AnkamaId   int                          `json:"ankama_id"`
	Name       map[string]string            `json:"name"`
	ItemIds    []int                        `json:"items"`
	Effects    [][]MappedMultilangSetEffect `json:"effects"`
	Level      int                          `json:"level"`
	IsCosmetic bool                         `json:"is_cosmetic"`
}

func MapSets

func MapSets(data *JSONGameData, langs *map[string]LangDict) []MappedMultilangSet

type MappedMultilangSetEffect added in v0.2.1

type MappedMultilangSetEffect struct {
	Min              int               `json:"min"`
	Max              int               `json:"max"`
	Type             map[string]string `json:"type"`
	MinMaxIrrelevant int               `json:"min_max_irrelevant"`
	Templated        map[string]string `json:"templated"`
	ElementId        int               `json:"element_id"`
	IsMeta           bool              `json:"is_meta"`
	Active           bool              `json:"active"`
	ItemCombination  uint              `json:"item_combination"`
}
type MappedMultilangSetReverseLink struct {
	Id   int               `json:"id"`
	Name map[string]string `json:"name"`
}

type MappedMultilangSetUnity added in v0.4.0

type MappedMultilangSetUnity struct {
	AnkamaId              int                             `json:"ankama_id"`
	Name                  map[string]string               `json:"name"`
	ItemIds               []int                           `json:"items"`
	Effects               map[int][]MappedMultilangEffect `json:"effects"`
	Level                 int                             `json:"level"`
	ContainsCosmetics     bool                            `json:"contains_cosmetics"`
	ContainsCosmeticsOnly bool                            `json:"contains_cosmetics_only"`
}

func MapSetsUnity added in v0.4.0

func MapSetsUnity(data *JSONGameDataUnity, langs *map[string]LangDictUnity) []MappedMultilangSetUnity

type NodeType added in v0.1.1

type NodeType int

NodeType defines the type of a node - either an operator or an operand

const (
	Operand  NodeType = iota // like "a" in "a & b"
	Operator                 // like "&" in "a & b"
)

type PersistentStringKeysMap

type PersistentStringKeysMap struct {
	Entries *treebidimap.Map `json:"entries"`
	NextId  int              `json:"next_id"`
}
var (
	PersistedElements PersistentStringKeysMap
	PersistedTypes    PersistentStringKeysMap
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL