dbc

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 24 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ITEM_ENCHANTMENT_NONE             int = 0
	ITEM_ENCHANTMENT_COMBAT_SPELL     int = 1
	ITEM_ENCHANTMENT_DAMAGE           int = 2
	ITEM_ENCHANTMENT_EQUIP_SPELL      int = 3
	ITEM_ENCHANTMENT_RESISTANCE       int = 4
	ITEM_ENCHANTMENT_STAT             int = 5
	ITEM_ENCHANTMENT_TOTEM            int = 6
	ITEM_ENCHANTMENT_USE_SPELL        int = 7
	ITEM_ENCHANTMENT_PRISMATIC_SOCKET int = 8
	ITEM_ENCHANTMENT_RELIC_RANK       int = 9
	ITEM_ENCHANTMENT_APPLY_BONUS      int = 11
	ITEM_ENCHANTMENT_RELIC_EVIL       int = 12 // Scaling relic +ilevel, see enchant::initialize_relic
)
View Source
const (
	ITEM_BONUS_STAT               int = 2  // Value_0 the ITEM_MOD stat, Value_1 its allocation per 10000 of the item's random property points.
	ITEM_BONUS_SUFFIX             int = 5  // Value_0 the ItemNameDescription the item's name ends with.
	ITEM_BONUS_ITEM_EFFECT        int = 23 // Value_0 the ItemEffect whose spell the item gains.
	ITEM_BONUS_REDUCED_CASTER_DPS int = 54 // No value: a weapon with the list deals the REDUCED_CASTER_DPS share of its damage table.
)

ItemBonus.Type values of the rows a random suffix's bonus list carries.

View Source
const (
	ITEM_SPELLTRIGGER_ON_USE          int = 0 // use after equip cooldown
	ITEM_SPELLTRIGGER_ON_EQUIP        int = 1
	ITEM_SPELLTRIGGER_CHANCE_ON_HIT   int = 2
	ITEM_SPELLTRIGGER_SOULSTONE       int = 4
	ITEM_SPELLTRIGGER_ON_NO_DELAY_USE int = 5 // no equip cooldown
	ITEM_SPELLTRIGGER_LEARN_SPELL_ID  int = 6
)
View Source
const (
	ITEM_CLASS_CONSUMABLE = iota
	ITEM_CLASS_CONTAINER
	ITEM_CLASS_WEAPON = dbcenums.ITEM_CLASS_WEAPON
	ITEM_CLASS_GEM    = iota
	ITEM_CLASS_ARMOR
	ITEM_CLASS_REAGENT
	ITEM_CLASS_PROJECTILE
	ITEM_CLASS_TRADE_GOODS
	ITEM_CLASS_GENERIC
	ITEM_CLASS_RECIPE
	ITEM_CLASS_MONEY
	ITEM_CLASS_QUIVER
	ITEM_CLASS_QUEST
	ITEM_CLASS_KEY
	ITEM_CLASS_PERMANENT
	ITEM_CLASS_MISC
)
View Source
const (
	ITEM_SUBCLASS_WEAPON_AXE = iota
	ITEM_SUBCLASS_WEAPON_AXE2
	ITEM_SUBCLASS_WEAPON_BOW
	ITEM_SUBCLASS_WEAPON_GUN
	ITEM_SUBCLASS_WEAPON_MACE
	ITEM_SUBCLASS_WEAPON_MACE2
	ITEM_SUBCLASS_WEAPON_POLEARM
	ITEM_SUBCLASS_WEAPON_SWORD
	ITEM_SUBCLASS_WEAPON_SWORD2
	ITEM_SUBCLASS_WEAPON_WARGLAIVE
	ITEM_SUBCLASS_WEAPON_STAFF
	ITEM_SUBCLASS_WEAPON_EXOTIC
	ITEM_SUBCLASS_WEAPON_EXOTIC2
	ITEM_SUBCLASS_WEAPON_FIST
	ITEM_SUBCLASS_WEAPON_MISC
	ITEM_SUBCLASS_WEAPON_DAGGER
	ITEM_SUBCLASS_WEAPON_THROWN
	ITEM_SUBCLASS_WEAPON_SPEAR
	ITEM_SUBCLASS_WEAPON_CROSSBOW
	ITEM_SUBCLASS_WEAPON_WAND
	ITEM_SUBCLASS_WEAPON_FISHING_POLE
)
View Source
const (
	ITEM_SUBCLASS_ARMOR_MISC = iota
	ITEM_SUBCLASS_ARMOR_CLOTH
	ITEM_SUBCLASS_ARMOR_LEATHER
	ITEM_SUBCLASS_ARMOR_MAIL
	ITEM_SUBCLASS_ARMOR_PLATE
	ITEM_SUBCLASS_ARMOR_COSMETIC
	ITEM_SUBCLASS_ARMOR_SHIELD
	ITEM_SUBCLASS_ARMOR_LIBRAM
	ITEM_SUBCLASS_ARMOR_IDOL
	ITEM_SUBCLASS_ARMOR_TOTEM
	ITEM_SUBCLASS_ARMOR_SIGIL
	ITEM_SUBCLASS_ARMOR_RELIC
)
View Source
const (
	ITEM_SUBCLASS_CONSUMABLE = iota
	ITEM_SUBCLASS_POTION
	ITEM_SUBCLASS_ELIXIR
	ITEM_SUBCLASS_FLASK
	ITEM_SUBCLASS_SCROLL
	ITEM_SUBCLASS_FOOD
	ITEM_SUBCLASS_ITEM_ENHANCEMENT
	ITEM_SUBCLASS_BANDAGE
	ITEM_SUBCLASS_CONSUMABLE_OTHER
)
View Source
const (
	INVTYPE_NON_EQUIP = iota
	INVTYPE_HEAD
	INVTYPE_NECK
	INVTYPE_SHOULDERS
	INVTYPE_BODY
	INVTYPE_CHEST
	INVTYPE_WAIST
	INVTYPE_LEGS
	INVTYPE_FEET
	INVTYPE_WRISTS
	INVTYPE_HANDS
	INVTYPE_FINGER
	INVTYPE_TRINKET
	INVTYPE_WEAPON
	INVTYPE_SHIELD
	INVTYPE_RANGED
	INVTYPE_CLOAK
	INVTYPE_2HWEAPON
	INVTYPE_BAG
	INVTYPE_TABARD
	INVTYPE_ROBE
	INVTYPE_WEAPONMAINHAND
	INVTYPE_WEAPONOFFHAND
	INVTYPE_HOLDABLE
	INVTYPE_AMMO
	INVTYPE_THROWN
	INVTYPE_RANGEDRIGHT
	INVTYPE_QUIVER
	INVTYPE_RELIC
	INVTYPE_MAX
)
View Source
const (
	TRADE_GOODS_EXPLOSIVES = 2
	// The game files' shared cooldown category for explosives, 60 s.
	EXPLOSIVES_SPELL_CATEGORY = 24
	// The categories potions, food, drink and conjured items (healthstones, mana gems, runes, Thistle
	// Tea) share their cooldown through.
	POTION_SPELL_CATEGORY   = 4
	FOOD_SPELL_CATEGORY     = 11
	DRINK_SPELL_CATEGORY    = 59
	CONJURED_SPELL_CATEGORY = 1153
)
View Source
const (
	ITEM_MOD_MANA                     = 0
	ITEM_MOD_HEALTH                   = 1
	ITEM_MOD_AGILITY                  = 3
	ITEM_MOD_STRENGTH                 = 4
	ITEM_MOD_INTELLECT                = 5
	ITEM_MOD_SPIRIT                   = 6
	ITEM_MOD_STAMINA                  = 7
	ITEM_MOD_DEFENSE_SKILL_RATING     = 12
	ITEM_MOD_DODGE_RATING             = 13
	ITEM_MOD_PARRY_RATING             = 14
	ITEM_MOD_BLOCK_RATING             = 15
	ITEM_MOD_HIT_MELEE_RATING         = 16
	ITEM_MOD_HIT_RANGED_RATING        = 17
	ITEM_MOD_HIT_SPELL_RATING         = 18
	ITEM_MOD_CRIT_MELEE_RATING        = 19
	ITEM_MOD_CRIT_RANGED_RATING       = 20
	ITEM_MOD_CRIT_SPELL_RATING        = 21
	ITEM_MOD_HIT_TAKEN_MELEE_RATING   = 22
	ITEM_MOD_HIT_TAKEN_RANGED_RATING  = 23
	ITEM_MOD_HIT_TAKEN_SPELL_RATING   = 24
	ITEM_MOD_CRIT_TAKEN_MELEE_RATING  = 25
	ITEM_MOD_CRIT_TAKEN_RANGED_RATING = 26
	ITEM_MOD_CRIT_TAKEN_SPELL_RATING  = 27
	ITEM_MOD_HASTE_MELEE_RATING       = 28
	ITEM_MOD_HASTE_RANGED_RATING      = 29
	ITEM_MOD_HASTE_SPELL_RATING       = 30
	ITEM_MOD_HIT_RATING               = 31
	ITEM_MOD_CRIT_RATING              = 32
	ITEM_MOD_HIT_TAKEN_RATING         = 33
	ITEM_MOD_CRIT_TAKEN_RATING        = 34
	ITEM_MOD_RESILIENCE_RATING        = 35
	ITEM_MOD_HASTE_RATING             = 36
	ITEM_MOD_EXPERTISE_RATING         = 37
	ITEM_MOD_ATTACK_POWER             = 38
	ITEM_MOD_RANGED_ATTACK_POWER      = 39
	ITEM_MOD_FERAL_ATTACK_POWER       = 40
	ITEM_MOD_SPELL_HEALING_DONE       = 41
	ITEM_MOD_SPELL_DAMAGE_DONE        = 42
	ITEM_MOD_MANA_REGENERATION        = 43
	ITEM_MOD_ARMOR_PENETRATION_RATING = 44
	ITEM_MOD_SPELL_POWER              = 45
	ITEM_MOD_HEALTH_REGEN             = 46
	ITEM_MOD_SPELL_PENETRATION        = 47
	ITEM_MOD_BLOCK_VALUE              = 48
	ITEM_MOD_MAX                      = 49

	// Indices above ITEM_MOD_MAX that the Forever game files actually put on items.
	// 50-56 are standard (wowdev.wiki/Stat_Types); 50 is already handled below.
	// 83+ has no upstream definition -- the canonical enum stops at 74 -- so these
	// were identified from self-labelling test items and enchant rows in the game files.
	ITEM_MOD_EXTRA_ARMOR       = 50
	ITEM_MOD_FIRE_RESISTANCE   = 51
	ITEM_MOD_FROST_RESISTANCE  = 52
	ITEM_MOD_HOLY_RESISTANCE   = 53
	ITEM_MOD_SHADOW_RESISTANCE = 54
	ITEM_MOD_NATURE_RESISTANCE = 55
	ITEM_MOD_ARCANE_RESISTANCE = 56

	ITEM_MOD_WEAPON_DAMAGE = 83
	ITEM_MOD_HOLY_DAMAGE   = 84
	ITEM_MOD_FIRE_DAMAGE   = 85
	ITEM_MOD_NATURE_DAMAGE = 86
	ITEM_MOD_FROST_DAMAGE  = 87
	ITEM_MOD_SHADOW_DAMAGE = 88
	ITEM_MOD_ARCANE_DAMAGE = 89

	// Weapon skill, one id per skill, budgeted like the other stats. 18505 Mugger's Belt states 96 and its
	// tooltip reads "Increased Daggers +1"; 14551 Edgemaster's Handguards states 93, 96 and 103 and reads +1
	// Axes, Daggers and Swords. No item states 95, 97, 99 or 102, so their skills are unknown.
	ITEM_MOD_TWO_HANDED_AXES_SKILL   = 90
	ITEM_MOD_TWO_HANDED_MACES_SKILL  = 91
	ITEM_MOD_TWO_HANDED_SWORDS_SKILL = 92
	ITEM_MOD_AXES_SKILL              = 93
	ITEM_MOD_BOWS_SKILL              = 94
	ITEM_MOD_DAGGERS_SKILL           = 96
	ITEM_MOD_FIST_WEAPONS_SKILL      = 98
	ITEM_MOD_MACES_SKILL             = 100
	ITEM_MOD_POLEARMS_SKILL          = 101
	ITEM_MOD_SWORDS_SKILL            = 103

	// Spell penetration on one school, in points of the target's resistance: 21516 Dagger of Spell
	// Penetration - Fire 150 Resist (TEST) budgets 150 of 119, and 21518's Frost twin 150 of 121.
	ITEM_MOD_FIRE_SPELL_PENETRATION  = 119
	ITEM_MOD_FROST_SPELL_PENETRATION = 121

	ITEM_MOD_ALL_RESISTANCES = 124

	// Attack power against one creature type: 13209 Seal of the Dawn states 128 and reads "+78 Attack
	// Power against Undead", the 78 its equip spell 23930 states for both melee and ranged attack power.
	// No item states 130.
	ITEM_MOD_ATTACK_POWER_VS_HUMANOID   = 125
	ITEM_MOD_ATTACK_POWER_VS_ELEMENTAL  = 126
	ITEM_MOD_ATTACK_POWER_VS_DEMON      = 127
	ITEM_MOD_ATTACK_POWER_VS_UNDEAD     = 128
	ITEM_MOD_ATTACK_POWER_VS_DRAGONKIN  = 129
	ITEM_MOD_ATTACK_POWER_VS_BEAST      = 131
	ITEM_MOD_ATTACK_POWER_VS_MECHANICAL = 132

	// Spell damage against one creature type: 19812 Rune of the Dawn states 136 and reads "Increases
	// damage done to Undead by magical spells and effects by up to 46", the 46 its equip spell 24198 states.
	ITEM_MOD_SPELL_DAMAGE_VS_HUMANOID  = 133
	ITEM_MOD_SPELL_DAMAGE_VS_ELEMENTAL = 134
	ITEM_MOD_SPELL_DAMAGE_VS_DEMON     = 135
	ITEM_MOD_SPELL_DAMAGE_VS_UNDEAD    = 136
	ITEM_MOD_SPELL_DAMAGE_VS_DRAGONKIN = 137
)
View Source
const (
	BIND_NONE                        = 0
	BIND_ON_ACQUIRE                  = 1
	BIND_ON_EQUIP                    = 2
	BIND_ON_USE                      = 3
	BIND_QUEST                       = 4
	BIND_UNUSED_1                    = 5
	BIND_UNUSED_2                    = 6
	BIND_WOW_ACCOUNT                 = 7
	BIND_BNET_ACCOUNT                = 8
	BIND_BNET_ACCOUNT_UNTIL_EQUIPPED = 9
)
View Source
const (
	ITEM_SUBCLASS_BIT_ARMOR_NONE    = 0x00000000
	ITEM_SUBCLASS_BIT_ARMOR_MISC    = 0x00000001
	ITEM_SUBCLASS_BIT_ARMOR_CLOTH   = 0x00000002
	ITEM_SUBCLASS_BIT_ARMOR_LEATHER = 0x00000004
	ITEM_SUBCLASS_BIT_ARMOR_MAIL    = 0x00000008
	ITEM_SUBCLASS_BIT_ARMOR_PLATE   = 0x00000010
	ITEM_SUBCLASS_BIT_ARMOR_BUCKLER = 0x00000020 // (Unused)
	ITEM_SUBCLASS_BIT_ARMOR_SHIELD  = 0x00000040
	ITEM_SUBCLASS_BIT_ARMOR_LIBRAM  = 0x00000080
	ITEM_SUBCLASS_BIT_ARMOR_IDOL    = 0x00000100
	ITEM_SUBCLASS_BIT_ARMOR_TOTEM   = 0x00000200
	ITEM_SUBCLASS_BIT_ARMOR_SIGIL   = 0x00000400
)

--- Armor constants (EquippedItemClass = 4) ---

View Source
const (
	OffHandValue = 65
	ShieldValue1 = 96
	ShieldValue2 = 64
)
View Source
const (
	SkillLineDefense     = 95
	SkillLineFeralCombat = 3014
)
View Source
const BASE_LEVEL = 60
View Source
const ITEM_SUBCLASS_WEAPON_INVALID = 31
View Source
const MAX_SCALING_LEVEL = 100
View Source
const POWER_TYPE_MANA int = 0

Power type in EffectMiscValue_0 of A_MOD_INCREASE_ENERGY. Only mana maps to a stat.

View Source
const UPGRADE_SYSTEM_ACTIVE = false

Variables

The auras through which an equip spell answers a hit: the proc triggers, the retaliation of a damage shield, and the dummy a server-side proc hangs off.

View Source
var MapArmorSubclassToArmorType = map[int]proto.ArmorType{
	ITEM_SUBCLASS_ARMOR_CLOTH:   proto.ArmorType_ArmorTypeCloth,
	ITEM_SUBCLASS_ARMOR_LEATHER: proto.ArmorType_ArmorTypeLeather,
	ITEM_SUBCLASS_ARMOR_MAIL:    proto.ArmorType_ArmorTypeMail,
	ITEM_SUBCLASS_ARMOR_PLATE:   proto.ArmorType_ArmorTypePlate,
	0:                           proto.ArmorType_ArmorTypeUnknown,
}
View Source
var MapInventoryTypeToEnchantMetaType = map[InventoryTypeFlag]EnchantMetaType{
	HEAD:     {ItemType: proto.ItemType_ItemTypeHead, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	NECK:     {ItemType: proto.ItemType_ItemTypeNeck, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	SHOULDER: {ItemType: proto.ItemType_ItemTypeShoulder, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	CHEST:    {ItemType: proto.ItemType_ItemTypeChest, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	WAIST:    {ItemType: proto.ItemType_ItemTypeWaist, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	LEGS:     {ItemType: proto.ItemType_ItemTypeLegs, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	FEET:     {ItemType: proto.ItemType_ItemTypeFeet, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	WRIST:    {ItemType: proto.ItemType_ItemTypeWrist, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	HAND:     {ItemType: proto.ItemType_ItemTypeHands, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	FINGER:   {ItemType: proto.ItemType_ItemTypeFinger, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	TRINKET:  {ItemType: proto.ItemType_ItemTypeTrinket, WeaponType: proto.WeaponType_WeaponTypeUnknown},

	WEAPON_MAIN_HAND: {ItemType: proto.ItemType_ItemTypeWeapon, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	WEAPON_OFF_HAND:  {ItemType: proto.ItemType_ItemTypeWeapon, WeaponType: proto.WeaponType_WeaponTypeShield},
	RANGED:           {ItemType: proto.ItemType_ItemTypeRanged, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	CLOAK:            {ItemType: proto.ItemType_ItemTypeBack, WeaponType: proto.WeaponType_WeaponTypeUnknown},
	TWO_H_WEAPON:     {ItemType: proto.ItemType_ItemTypeWeapon, WeaponType: proto.WeaponType_WeaponTypeUnknown},
}
View Source
var MapInventoryTypeToItemType = map[int]proto.ItemType{
	0:                      proto.ItemType_ItemTypeUnknown,
	INVTYPE_HEAD:           proto.ItemType_ItemTypeHead,
	INVTYPE_NECK:           proto.ItemType_ItemTypeNeck,
	INVTYPE_SHOULDERS:      proto.ItemType_ItemTypeShoulder,
	INVTYPE_CHEST:          proto.ItemType_ItemTypeChest,
	INVTYPE_WAIST:          proto.ItemType_ItemTypeWaist,
	INVTYPE_LEGS:           proto.ItemType_ItemTypeLegs,
	INVTYPE_FEET:           proto.ItemType_ItemTypeFeet,
	INVTYPE_WRISTS:         proto.ItemType_ItemTypeWrist,
	INVTYPE_HANDS:          proto.ItemType_ItemTypeHands,
	INVTYPE_FINGER:         proto.ItemType_ItemTypeFinger,
	INVTYPE_TRINKET:        proto.ItemType_ItemTypeTrinket,
	INVTYPE_WEAPON:         proto.ItemType_ItemTypeWeapon,
	INVTYPE_SHIELD:         proto.ItemType_ItemTypeWeapon,
	INVTYPE_RANGED:         proto.ItemType_ItemTypeRanged,
	INVTYPE_CLOAK:          proto.ItemType_ItemTypeBack,
	INVTYPE_2HWEAPON:       proto.ItemType_ItemTypeWeapon,
	INVTYPE_BAG:            proto.ItemType_ItemTypeUnknown,
	INVTYPE_TABARD:         proto.ItemType_ItemTypeUnknown,
	INVTYPE_ROBE:           proto.ItemType_ItemTypeChest,
	INVTYPE_WEAPONMAINHAND: proto.ItemType_ItemTypeWeapon,
	INVTYPE_WEAPONOFFHAND:  proto.ItemType_ItemTypeWeapon,
	INVTYPE_HOLDABLE:       proto.ItemType_ItemTypeWeapon,
	INVTYPE_AMMO:           proto.ItemType_ItemTypeUnknown,
	INVTYPE_THROWN:         proto.ItemType_ItemTypeRanged,
	INVTYPE_RANGEDRIGHT:    proto.ItemType_ItemTypeRanged,
	INVTYPE_QUIVER:         proto.ItemType_ItemTypeRanged,
	INVTYPE_RELIC:          proto.ItemType_ItemTypeRanged,
}
View Source
var MapWeaponSubClassToWeaponType = map[int]proto.WeaponType{
	ITEM_SUBCLASS_WEAPON_AXE:          proto.WeaponType_WeaponTypeAxe,
	ITEM_SUBCLASS_WEAPON_AXE2:         proto.WeaponType_WeaponTypeAxe,
	ITEM_SUBCLASS_WEAPON_BOW:          proto.WeaponType_WeaponTypeUnknown,
	ITEM_SUBCLASS_WEAPON_GUN:          proto.WeaponType_WeaponTypeUnknown,
	ITEM_SUBCLASS_WEAPON_MACE:         proto.WeaponType_WeaponTypeMace,
	ITEM_SUBCLASS_WEAPON_MACE2:        proto.WeaponType_WeaponTypeMace,
	ITEM_SUBCLASS_WEAPON_POLEARM:      proto.WeaponType_WeaponTypePolearm,
	ITEM_SUBCLASS_WEAPON_SWORD:        proto.WeaponType_WeaponTypeSword,
	ITEM_SUBCLASS_WEAPON_SWORD2:       proto.WeaponType_WeaponTypeSword,
	ITEM_SUBCLASS_WEAPON_WARGLAIVE:    proto.WeaponType_WeaponTypePolearm,
	ITEM_SUBCLASS_WEAPON_STAFF:        proto.WeaponType_WeaponTypeStaff,
	ITEM_SUBCLASS_WEAPON_EXOTIC:       proto.WeaponType_WeaponTypeUnknown,
	ITEM_SUBCLASS_WEAPON_EXOTIC2:      proto.WeaponType_WeaponTypeUnknown,
	ITEM_SUBCLASS_WEAPON_FIST:         proto.WeaponType_WeaponTypeFist,
	ITEM_SUBCLASS_WEAPON_MISC:         proto.WeaponType_WeaponTypeUnknown,
	ITEM_SUBCLASS_WEAPON_DAGGER:       proto.WeaponType_WeaponTypeDagger,
	ITEM_SUBCLASS_WEAPON_THROWN:       proto.WeaponType_WeaponTypeUnknown,
	ITEM_SUBCLASS_WEAPON_SPEAR:        proto.WeaponType_WeaponTypePolearm,
	ITEM_SUBCLASS_WEAPON_CROSSBOW:     proto.WeaponType_WeaponTypeUnknown,
	ITEM_SUBCLASS_WEAPON_WAND:         proto.WeaponType_WeaponTypeUnknown,
	ITEM_SUBCLASS_WEAPON_FISHING_POLE: proto.WeaponType_WeaponTypeUnknown,
}

Functions

func AddEquipSpellStats

func AddEquipSpellStats(outStats *stats.Stats, pseudoStats []float64, spellID int) (addedStats bool, addedPseudoStats bool)

Adds what an equip spell states that no stat index carries, and reports whether it added to each of the two: to outStats the defense skill and flat block value - 24148 (Presence of Might) states A_MOD_SKILL 7 on the Defense skill line and A_MOD_BLOCK_VALUE_FLAT 15 - and to pseudoStats, indexed by proto.PseudoStat and skipped where nil, the percents for hit, crit, block, dodge, parry and attack and cast speed. Only auras on the wearer count: Atiesh's 28142 is a party aura and reaches the sim as a raid buff. A spell EquipSpellFolds leaves to run time adds nothing. A FoldRanged effect adds to the ranged percents alone, as the total the character sheet shows.

func ClassNameFromDBC

func ClassNameFromDBC(dbc DbcClass) string

func ConvertEffectAuraToStatIndex

func ConvertEffectAuraToStatIndex(effectAura EffectAuraType, effectMisc int) proto.Stat

func ConvertModRatingFlagToRatingStat

func ConvertModRatingFlagToRatingStat(flag int) proto.Stat

The rating stat a combat rating mask names, read bit by bit through spelldata.RatingStats, so a mask of only ranged bits names none. The callers read one stat per aura, so a mask naming two different stats names none either; no game files aura carries one.

func ConvertResistanceFlagToResistanceStat

func ConvertResistanceFlagToResistanceStat(flag int) proto.Stat

func ConvertSpellDamageFlagToSchoolDamageStat

func ConvertSpellDamageFlagToSchoolDamageStat(flag int) proto.Stat

func ConvertTargetResistanceFlagToPenetrationStat

func ConvertTargetResistanceFlagToPenetrationStat(flag int) proto.Stat

See core.SpellSchool.PiercingStat; a mask without a stat returns -1.

func EffectStats

func EffectStats(effect *proto.ItemEffect) map[int32]float64

The stats an effect grants. A stacking effect grants nothing through the aura its trigger applies - the stats it is named after live on the aura that accumulates - so an empty scaling option is not the same as no stats, and no caller may read ScalingOptions directly to answer this question.

func EquipSpellFolds

func EquipSpellFolds(spellID int) bool

Whether an equip spell folds into the stats of the item or enchant carrying it: it does unless an effect of it is FoldRuntime. Every such spell on an item or enchant is a single hit, crit or rating aura, so the whole spell goes one way.

func GetClassesFromClassMask

func GetClassesFromClassMask(mask int) []proto.Class

func GetFactionRestrictionFromRaceMask

func GetFactionRestrictionFromRaceMask(mask int64) proto.UIItem_FactionRestriction

Restricts an item to one side when every playable race its AllowableRace mask names belongs to that side. A mask that names both sides, or no playable race, restricts nothing.

func GetItemEffectSpellTooltip

func GetItemEffectSpellTooltip(itemID int, buffId int) (string, int)

func GetProfession

func GetProfession(id int) proto.Profession

func GetRacesFromRaceMask

func GetRacesFromRaceMask(mask int64) []proto.Race

The playable races an AllowableRace mask names, or none where it names every one of them.

func GetRepLevel

func GetRepLevel(minReputation int) proto.RepLevel

func InitDBC

func InitDBC() error

func IsTemporaryEnchantEffect

func IsTemporaryEnchantEffect(effect dbcenums.SpellEffectType) bool

func ItemEffectTypes

func ItemEffectTypes(itemID int32) ([]proto.AreaType, []proto.MobType, []proto.CreatureFamily)

The terrain areas, mob types and creature groups an item's effects and stats state a bonus in or against, which the gear picker filters by: the areas a spell requires or is stronger in, the mob types a versus aura or a creature type stat counts against. A tooltip states the rest, the creature groups among them, which no row holds (tooltipTargets). Every item effect counts, whatever triggers it, with each spell its trigger chain reaches. A spell that requires a single zone names no terrain area, and one that can only hit a mob type (TargetCreatureType: a stun, a charm) states no bonus against it.

func MapBonusStatIndexToPiercingSchool

func MapBonusStatIndexToPiercingSchool(index int) (stats.SchoolIndex, bool)

The school a spell penetration stat pierces, which the sim keeps outside the stat array.

func MapBonusStatIndexToStat

func MapBonusStatIndexToStat(index int) (proto.Stat, bool)

func MapBonusStatIndexToStats

func MapBonusStatIndexToStats(index int) ([]proto.Stat, bool)

MapBonusStatIndexToStats is MapBonusStatIndexToStat for callers that have to cope with one index granting several stats. Every index maps to exactly one stat except 38, 45 and 124. An enchant row whose argument is wrong is corrected before it gets here (enchantEffectArgFixes).

func MapMainStatToStat

func MapMainStatToStat(index int) (proto.Stat, bool)

Ref: https://wowdev.wiki/Stat_Types

func MapResistanceToStat

func MapResistanceToStat(index int) (proto.Stat, bool)

func MergeItemEffectsForAllStates

func MergeItemEffectsForAllStates(parsed *proto.UIItem) []*proto.ItemEffect

Parses a UIItem and loops through Scaling Options for that item.

func NullFloat

func NullFloat(arr []float64) []float64

func ParseItemEffects

func ParseItemEffects(itemID, itemLevel int) []*proto.ItemEffect

func RangedRatingPercents

func RangedRatingPercents(mask int, rating float64) map[proto.PseudoStat]float64

The ranged offset percents a combat rating mask of ranged bits alone grants, from rating points.

func ReadGzipFile

func ReadGzipFile(filename string) ([]byte, error)

func ResolveTriggered

func ResolveTriggered(spellID int, matches func(*spelldata.Spell) bool) int32

The first spell of the store on the trigger chain from spellID, spellID itself included, that matches, or 0. A spell the store does not carry ends its branch.

func WriteGzipFile

func WriteGzipFile(filePath string, data []byte) error

Types

type ArmorLocation

type ArmorLocation struct {
	Id       int
	Modifier [5]float64
}

type ClassMask

type ClassMask uint32
const (
	WARRIOR      ClassMask = 0x1
	PALADIN      ClassMask = 0x2
	HUNTER       ClassMask = 0x4
	ROGUE        ClassMask = 0x8
	PRIEST       ClassMask = 0x10
	DEATH_KNIGHT ClassMask = 0x20
	SHAMAN       ClassMask = 0x40
	MAGE         ClassMask = 0x80
	WARLOCK      ClassMask = 0x100
	MONK         ClassMask = 0x200
	DRUID        ClassMask = 0x400
	DEMON_HUNTER ClassMask = 0x800
	EVOKER       ClassMask = 0x1000
)

func (ClassMask) Has

func (c ClassMask) Has(flag ClassMask) bool

type Consumable

type Consumable struct {
	Id                 int             // Item ID
	Name               string          // Item name
	ItemLevel          int             // Item level
	RequiredLevel      int             // Required level to use
	ClassId            int             // Item class ID (should be 0 for consumables)
	SubClassId         ConsumableClass // Item subclass ID
	IconFileDataID     int             // Icon file data ID
	SpellCategoryID    int             // Spell category ID
	SpellCategoryFlags int             // Spell category flags
	ItemEffects        []int           // Item effect IDs
	ClassMask          int
	RaceMask           int64
	RequiredSkill      int
	RequiredSkillRank  int
	RequiredHoliday    int // ItemSparse.RequiredHoliday, 0 when the item names no world event.
	TemporaryEnchant   TemporaryEnchant
}

func (*Consumable) GetNonStatEffectIds

func (consumable *Consumable) GetNonStatEffectIds() []int32

func (*Consumable) GetStatModifiers

func (consumable *Consumable) GetStatModifiers() *stats.Stats

func (*Consumable) OnUseEffects

func (c *Consumable) OnUseEffects() []*proto.ItemEffect

The spell each on-use row casts, with the cooldowns and category the item states for it.

func (*Consumable) SharesExplosivesCategory

func (c *Consumable) SharesExplosivesCategory() bool

Whether an on-use row shares the explosives' category 24.

func (*Consumable) ToMap

func (c *Consumable) ToMap() map[string]any

func (*Consumable) ToProto

func (c *Consumable) ToProto() *proto.Consumable

ToProto converts the Consumable to a proto representation.

type ConsumableClass

type ConsumableClass int
const (
	EXPLOSIVES_AND_DEVICES ConsumableClass = iota
	POTION
	ELIXIR
	FLASK
	SCROLL
	FOOD
	ITEM_ENHANCEMENT
	BANDAGE
	OTHER
	HERB
	DEVICE ConsumableClass = 14
)

func (ConsumableClass) ToProto

func (s ConsumableClass) ToProto() proto.ConsumableType

type DBC

type DBC struct {
	Items                  map[int]Item                       // Item ID
	Enchants               map[int]Enchant                    // Index in the raw SpellItemEnchantment list
	EnchantsByEffectId     map[int]Enchant                    // ItemEchantment ID
	SpellEffects           map[int]map[int]SpellEffect        // Search by spellID and effect index
	SpellEffectsById       map[int]SpellEffect                // Search by effectid
	Spells                 map[int]Spell                      // Search by spellId
	RandomSuffix           map[int]RandomSuffix               // Item level
	ItemDamageTable        map[string]map[int]ItemDamageTable // By Table name and item level
	RandomPropertiesByIlvl map[int]RandomPropAllocationMap
	ItemArmorQuality       map[int]ItemArmorQuality
	ItemArmorShield        map[int]ItemArmorShield
	ItemArmorTotal         map[int]ItemArmorTotal
	ArmorLocation          map[int]ArmorLocation
	SpellScalings          map[int]SpellScaling
	Consumables            map[int]Consumable     // Item ID
	ItemEffects            map[int]ItemEffect     // Effect ID
	ItemEffectsByParentID  map[int][]ItemEffect   // ParentItemID
	ItemSetSpells          map[int][]ItemSetSpell // Item set ID
	ShieldBlockValues      map[int]ShieldBlock
	// contains filtered or unexported fields
}

func GetDBC

func GetDBC() *DBC

GetDBC returns the DBC singleton instance

func NewDBC

func NewDBC() *DBC

func (*DBC) LoadArmorLocation

func (d *DBC) LoadArmorLocation(filename string) error

func (*DBC) LoadItemArmorQuality

func (d *DBC) LoadItemArmorQuality(filename string) error

func (*DBC) LoadItemArmorShield

func (d *DBC) LoadItemArmorShield(filename string) error

func (*DBC) LoadItemArmorTotal

func (d *DBC) LoadItemArmorTotal(filename string) error

func (*DBC) LoadShieldBlockValues

func (dbc *DBC) LoadShieldBlockValues() error

func (*DBC) LoadSpellScaling

func (dbc *DBC) LoadSpellScaling() error

func (*DBC) ReducedCasterWeaponDPS

func (d *DBC) ReducedCasterWeaponDPS(item *Item, itemLevel int) (float64, bool)

The DPS the weapon deals with a random suffix that reduces caster DPS: the share of its table cell, whatever the item's own flags.

func (*DBC) ShieldBlockValue

func (dbc *DBC) ShieldBlockValue(class proto.ItemQuality, level int) float64

func (*DBC) SpellEffectsInOrder

func (d *DBC) SpellEffectsInOrder(spellID int) []SpellEffect

Returns the effects of a spell ordered by effect index, or nil if it has none. The slice is shared with every other caller, so it is to be read and not written to.

func (*DBC) WeaponDPS

func (d *DBC) WeaponDPS(item *Item, itemLevel int) (float64, bool)

The DPS the weapon deals as the game files flag it; false when the game files have no table cell for it.

type DamageEffect

type DamageEffect struct {
	SpellID          int     // spell that deals the damage
	SchoolMask       int32   // DBC school mask of the damage spell
	DefenseType      int32   // SpellCategories.DefenseType of the damage spell, which picks its hit table and crit multiplier
	BonusCoefficient float64 // spell power coefficient
}

Describes a direct-damage effect reached from an item or enchant effect chain. Damage procs carry no stats, so the stat-based resolution in ParseStatEffect returns nothing for them and the effect is dropped before it is ever reported.

func ResolveDamageEffect

func ResolveDamageEffect(spellID int) *DamageEffect

Walks the trigger chain below spellID and returns the first direct damage effect it reaches, or nil if the chain deals no flat damage.

type DataLoadError

type DataLoadError struct {
	Source   string
	DataType string
	Reason   string
}

func (DataLoadError) Error

func (e DataLoadError) Error() string

type DbcClass

type DbcClass struct {
	ProtoClass proto.Class
	ID         int
}

type EffectAuraType

type EffectAuraType = dbcenums.EffectAuraType

type Enchant

type Enchant struct {
	EffectId           int
	Name               string
	SpellId            int
	ItemId             int
	ProfessionId       int
	Effects            []int
	EffectPoints       []int
	EffectArgs         []int
	IsWeaponEnchant    bool
	InventoryType      InventoryTypeFlag
	SubClassMask       int
	ClassMask          int
	FDID               int
	Quality            ItemQuality
	RequiredProfession int
	EffectName         string
	IsLive             bool
	Lvl                int
	RecipeItemIds      []int // The items that teach the enchant's spell.
}

func (*Enchant) ProcSlots

func (enchant *Enchant) ProcSlots() []EnchantProcSlot

Every combat spell (Effect 1) and every equip spell (Effect 3) answering a hit, one per slot.

func (*Enchant) ToProto

func (enchant *Enchant) ToProto() *proto.UIEnchant

func (*Enchant) ToProtoWithSlots

func (enchant *Enchant) ToProtoWithSlots() (*proto.UIEnchant, []EnchantProcSlot)

type EnchantMetaType

type EnchantMetaType struct {
	ItemType   proto.ItemType
	WeaponType proto.WeaponType
}

type EnchantProcSlot

type EnchantProcSlot struct {
	SpellID int
	// A combat spell (Effect 1), which the game casts off the weapon's hit rather than through a
	// proc mask.
	IsCombatSpell bool
	// The chance in percent a combat spell slot states for it, 0 where it states none.
	ChancePct int
	// What the slot applies: the combat spell itself, or the spell its equip aura triggers.
	AppliesSpellID int
	// The effect entry the slot's spell resolves to, where it resolves stats.
	Effect *proto.ItemEffect
}

A spell an enchant slot casts off a hit, or hangs a listener on.

type EquipFold

type EquipFold uint8

Where one effect of an equip spell goes in the data of the item or enchant carrying it.

const (
	// The effect's stat, on every channel it names.
	FoldStats EquipFold = iota
	// Ranged attacks alone: a hit or crit aura bound to ranged weapons alone, or a rating mask of
	// ranged bits alone, as the ranged percents.
	FoldRanged
	// Applied at run time, where the attack's own weapon decides: any other hit or crit aura the parse
	// binds to a weapon, a rating aura bound to any weapon, whose mask the fold would read as a rating
	// on every channel, a damage done aura bound to any weapon, and any aura held while equipped.
	FoldRuntime
)

func EquipEffectFold

func EquipEffectFold(effect SpellEffect) EquipFold

The fold of a game files effect, read off its row in the spell store. An effect of a spell the store does not carry names no weapon.

type ImplicitTarget

type ImplicitTarget int

SpellEffect.ImplicitTarget_0, restricted to the values a buff or debuff aura reaches its targets by. Table: SpellEffect, column ImplicitTarget.

const (
	TARGET_UNIT_CASTER            ImplicitTarget = 1
	TARGET_UNIT_TARGET_ENEMY      ImplicitTarget = 6
	TARGET_UNIT_SRC_AREA_ENEMY    ImplicitTarget = 15
	TARGET_UNIT_CASTER_AREA_PARTY ImplicitTarget = 20
	TARGET_UNIT_TARGET_ALLY       ImplicitTarget = 21
	TARGET_SRC_CASTER             ImplicitTarget = 22
	TARGET_UNIT_TARGET_ANY        ImplicitTarget = 25
	TARGET_UNIT_CASTER_AREA_RAID  ImplicitTarget = 56
	TARGET_UNIT_TARGET_RAID       ImplicitTarget = 57
	TARGET_153                    ImplicitTarget = 153
)

type InventoryTypeFlag

type InventoryTypeFlag uint32
const (
	HEAD             InventoryTypeFlag = 0x2
	NECK             InventoryTypeFlag = 0x4
	SHOULDER         InventoryTypeFlag = 0x8
	BODY             InventoryTypeFlag = 0x10
	CHEST            InventoryTypeFlag = 0x20
	WAIST            InventoryTypeFlag = 0x40
	LEGS             InventoryTypeFlag = 0x80
	FEET             InventoryTypeFlag = 0x100
	WRIST            InventoryTypeFlag = 0x200
	HAND             InventoryTypeFlag = 0x400
	FINGER           InventoryTypeFlag = 0x800
	TRINKET          InventoryTypeFlag = 0x1000
	MAIN_HAND        InventoryTypeFlag = 0x2000
	OFF_HAND         InventoryTypeFlag = 0x4000
	RANGED           InventoryTypeFlag = 0x8000
	CLOAK            InventoryTypeFlag = 0x10000
	TWO_H_WEAPON     InventoryTypeFlag = 0x20000
	BAG              InventoryTypeFlag = 0x40000
	TABARD           InventoryTypeFlag = 0x80000
	ROBE             InventoryTypeFlag = 0x100000
	WEAPON_MAIN_HAND InventoryTypeFlag = 0x200000
	WEAPON_OFF_HAND  InventoryTypeFlag = 0x400000
	HOLDABLE         InventoryTypeFlag = 0x800000
	AMMO             InventoryTypeFlag = 0x1000000
	THROWN           InventoryTypeFlag = 0x2000000
	RANGED_RIGHT     InventoryTypeFlag = 0x4000000
	QUIVER           InventoryTypeFlag = 0x8000000
	RELIC            InventoryTypeFlag = 0x10000000
)

func (InventoryTypeFlag) Has

type Item

type Item struct {
	Id                    int
	Name                  string
	InventoryType         int
	ItemDelay             int
	OverallQuality        ItemQuality
	DmgVariance           float64
	ItemLevel             int
	RequiredLevel         int
	ItemClass             int
	ItemSubClass          int
	StatAlloc             []float64
	BonusStat             []int
	ArmorValue            int
	FireResistance        int
	NatureResistance      int
	FrostResistance       int
	ShadowResistance      int
	ArcaneResistance      int
	Flags0                ItemStaticFlags0
	Flags1                ItemStaticFlags1
	Flags2                ItemStaticFlags2
	Flags3                ItemStaticFlags3
	Flags4                ItemStaticFlags4
	FDID                  int
	ItemSetName           string
	ItemSetId             int
	ClassMask             int
	RaceMask              int64
	QualityModifier       float64
	DamageType            int // ItemSparse.DamageType, the weapon's school in the game files' order.
	RandomSuffixOptions   []int32
	BonusAmountCalculated []float64
	NameDescription       string // Contains information for i.E. Thunderforging. Normal = Thunderforged, HC = Heroic Thunderforged
	UpgradeID             int
	UpgradePath           []int
	LimitCategory         int
	Bonding               int
	EquipWeaponSkills     []*proto.WeaponSkillValue // The weapon skills of the equip spells folded into the item (foldEquipWeaponSkills).
}

func (*Item) ApproximateScaleCoeff

func (item *Item) ApproximateScaleCoeff(currIlvl int, newIlvl int) float64

func (*Item) GetArmorValue

func (item *Item) GetArmorValue(itemLevel int) int

GetArmorValue computes base armor from the item level tables, since the game files carry no armor value on the item: ItemArmorShield by quality for a shield, otherwise ItemArmorTotal for the armor type, scaled by ItemArmorQuality and the slot's ArmorLocation modifier. A robe takes the chest row.

func (*Item) GetBlockValue

func (item *Item) GetBlockValue(itemLevel int) float64

func (*Item) GetHP5

func (item *Item) GetHP5(itemLevel int) int32

func (*Item) GetMobTypeStats

func (item *Item) GetMobTypeStats(itemLevel int) []*proto.MobTypeStats

One entry per mob type, in the order the item first states each.

func (*Item) GetRandPropPoints

func (item *Item) GetRandPropPoints(itemLevel int) int32

func (*Item) GetRandomSuffixType

func (item *Item) GetRandomSuffixType() int

func (*Item) GetScaledStat

func (item *Item) GetScaledStat(index int, itemLevel int) float64

func (*Item) GetSpellSchool

func (item *Item) GetSpellSchool() proto.SpellSchool

func (*Item) GetStats

func (item *Item) GetStats(itemLevel int) *stats.Stats

func (*Item) GetWeaponQualityModifier

func (item *Item) GetWeaponQualityModifier() float64

The per-item damage offset for weapons. Armor carries a QualityModifier too, which gives no armor in game (R-0052).

func (*Item) GetWeaponSkills

func (item *Item) GetWeaponSkills(itemLevel int) []*proto.WeaponSkillValue

func (*Item) GetWeaponTypes

func (item *Item) GetWeaponTypes() (proto.WeaponType, proto.HandType, proto.RangedWeaponType)

func (*Item) ParseItemFlags

func (item *Item) ParseItemFlags(uiItem *proto.UIItem)

func (*Item) ToScaledUIItem

func (item *Item) ToScaledUIItem(itemLevel int) *proto.UIItem

func (*Item) ToUIItem

func (item *Item) ToUIItem() *proto.UIItem

func (*Item) WeaponDamage

func (item *Item) WeaponDamage(dps float64) (float64, float64)

The equipped damage range from a damage table cell, rounded as the game shows it.

func (*Item) WeaponDmgMax

func (item *Item) WeaponDmgMax(itemLevel int) float64

func (*Item) WeaponDmgMin

func (item *Item) WeaponDmgMin(itemLevel int) float64

func (*Item) WeaponDps

func (item *Item) WeaponDps(itemLevel int) float64

type ItemArmorQuality

type ItemArmorQuality struct {
	ItemLevel int
	Quality   []float64 // len 7
}

type ItemArmorShield

type ItemArmorShield struct {
	ItemLevel int
	Quality   []float64 // len 7
}

type ItemArmorTotal

type ItemArmorTotal struct {
	ItemLevel int
	Cloth     float64
	Leather   float64
	Mail      float64
	Plate     float64
}

type ItemDamageTable

type ItemDamageTable struct {
	ItemLevel int
	Quality   []float64
}

type ItemEffect

type ItemEffect struct {
	ID                   int // Effect ID
	LegacySlotIndex      int // Legacy slot index
	TriggerType          int // Trigger type
	Charges              int // Number of charges
	CoolDownMSec         int // Cooldown in milliseconds
	CategoryCoolDownMSec int // Category cooldown in milliseconds
	SpellCategoryID      int // Spell category ID
	MaxCumulativeStacks  int // Max cumulative stacks
	SpellID              int // Spell ID
	ChrSpecializationID  int // Character specialization ID
	ParentItemID         int // Parent item ID
}

ItemEffect represents an item effect in the game.

func GetItemEffect

func GetItemEffect(effectId int) ItemEffect

func GetItemEffectForBuffID

func GetItemEffectForBuffID(itemID int, buffId int) *ItemEffect

func (*ItemEffect) ToMap

func (e *ItemEffect) ToMap() map[string]any

ToMap returns a generic representation of the effect.

func (*ItemEffect) ToProto

func (e *ItemEffect) ToProto(itemLevel int) (*proto.ItemEffect, bool)

type ItemQuality

type ItemQuality int
const (
	JUNK      ItemQuality = 0
	COMMON    ItemQuality = 1
	UNCOMMON  ItemQuality = 2
	RARE      ItemQuality = 3
	EPIC      ItemQuality = 4
	LEGENDARY ItemQuality = 5
	ARTIFACT  ItemQuality = 6
	HEIRLOOM  ItemQuality = 7
)

func (ItemQuality) ToProto

func (raw ItemQuality) ToProto() proto.ItemQuality

type ItemSetSpell

type ItemSetSpell struct {
	ItemSetID     int // Item set ID
	Threshold     int // Pieces worn
	SpellID       int // Spell ID
	RequiredSkill int // The skill line the set's ItemSet row gates its bonuses on, 0 for none
}

A spell an item set grants once enough of its pieces are worn.

type ItemStaticFlags0

type ItemStaticFlags0 uint32
const (
	NO_PICKUP                         ItemStaticFlags0 = 0x00000001
	CONJURED                          ItemStaticFlags0 = 0x00000002
	HAS_LOOT_TABLE                    ItemStaticFlags0 = 0x00000004
	HEROIC_TOOLTIP                    ItemStaticFlags0 = 0x00000008
	DEPRECATED                        ItemStaticFlags0 = 0x00000010
	NO_USER_DESTROY                   ItemStaticFlags0 = 0x00000020
	PLAYER_CAST                       ItemStaticFlags0 = 0x00000040
	NO_EQUIP_COOLDOWN                 ItemStaticFlags0 = 0x00000080
	MULTI_LOOT_QUEST                  ItemStaticFlags0 = 0x00000100
	GIFT_WRAP                         ItemStaticFlags0 = 0x00000200
	USES_RESOURCES                    ItemStaticFlags0 = 0x00000400
	MULTI_DROP                        ItemStaticFlags0 = 0x00000800
	IN_GAME_REFUND                    ItemStaticFlags0 = 0x00001000
	PETITION                          ItemStaticFlags0 = 0x00002000
	HAS_TEXT                          ItemStaticFlags0 = 0x00004000
	NO_DISENCHANT                     ItemStaticFlags0 = 0x00008000
	REAL_DURATION                     ItemStaticFlags0 = 0x00010000
	NO_CREATOR                        ItemStaticFlags0 = 0x00020000
	PROSPECTABLE                      ItemStaticFlags0 = 0x00040000
	UNIQUE_EQUIPPABLE                 ItemStaticFlags0 = 0x00080000
	DISABLE_AURA_QUOTAS               ItemStaticFlags0 = 0x00100000
	IGNORE_DEFAULT_ARENA_RESTRICTIONS ItemStaticFlags0 = 0x00200000
	NO_DURABILITY_LOSS                ItemStaticFlags0 = 0x00400000
	USEABLE_WHILE_SHAPESHIFTED        ItemStaticFlags0 = 0x00800000
	HAS_QUEST_GLOW                    ItemStaticFlags0 = 0x01000000
	HIDE_UNUSABLE_RECIPE              ItemStaticFlags0 = 0x02000000
	NOT_USABLE_IN_ARENA               ItemStaticFlags0 = 0x04000000
	BOUND_TO_ACCOUNT                  ItemStaticFlags0 = 0x08000000
	NO_REAGENT_COST                   ItemStaticFlags0 = 0x10000000
	MILLABLE                          ItemStaticFlags0 = 0x20000000
	REPORT_TO_GUILD_CHAT              ItemStaticFlags0 = 0x40000000
	DONT_USE_DYNAMIC_DROP_CHANCE      ItemStaticFlags0 = 0x80000000
)

func (ItemStaticFlags0) Has

type ItemStaticFlags1

type ItemStaticFlags1 uint32
const (
	HORDE_SPECIFIC                        ItemStaticFlags1 = 0x00000001
	ALLIANCE_SPECIFIC                     ItemStaticFlags1 = 0x00000002
	DONT_IGNORE_BUY_PRICE                 ItemStaticFlags1 = 0x00000004
	ONLY_CASTER_ROLL_NEED                 ItemStaticFlags1 = 0x00000008
	ONLY_NON_CASTER_ROLL_NEED             ItemStaticFlags1 = 0x00000010
	EVERYONE_CAN_ROLL_NEED                ItemStaticFlags1 = 0x00000020
	CANNOT_TRADE_BIND_ON_PICKUP           ItemStaticFlags1 = 0x00000040
	CAN_TRADE_BIND_ON_PICKUP              ItemStaticFlags1 = 0x00000080
	CAN_ONLY_ROLL_GREED                   ItemStaticFlags1 = 0x00000100
	CASTER_WEAPON                         ItemStaticFlags1 = 0x00000200
	DELETE_ON_LOGIN                       ItemStaticFlags1 = 0x00000400
	INTERNAL_ITEM                         ItemStaticFlags1 = 0x00000800
	NO_VENDOR_VALUE                       ItemStaticFlags1 = 0x00001000
	SHOW_BEFORE_DISCOVERED                ItemStaticFlags1 = 0x00002000
	OVERRIDE_GOLD_COST                    ItemStaticFlags1 = 0x00004000
	IGNORE_DEFAULT_RATED_BG_RESTRICTIONS  ItemStaticFlags1 = 0x00008000
	NOT_USABLE_IN_RATED_BG                ItemStaticFlags1 = 0x00010000
	BNET_ACCOUNT_TRADE_OK                 ItemStaticFlags1 = 0x00020000
	CONFIRM_BEFORE_USE                    ItemStaticFlags1 = 0x00040000
	REEVALUATE_BONDING_ON_TRANSFORM       ItemStaticFlags1 = 0x00080000
	NO_TRANSFORM_ON_CHARGE_DEPLETION      ItemStaticFlags1 = 0x00100000
	NO_ALTER_ITEM_VISUAL                  ItemStaticFlags1 = 0x00200000
	NO_SOURCE_FOR_ITEM_VISUAL             ItemStaticFlags1 = 0x00400000
	IGNORE_QUALITY_FOR_ITEM_VISUAL_SOURCE ItemStaticFlags1 = 0x00800000
	NO_DURABILITY                         ItemStaticFlags1 = 0x01000000
	ROLE_TANK                             ItemStaticFlags1 = 0x02000000
	ROLE_HEALER                           ItemStaticFlags1 = 0x04000000
	ROLE_DAMAGE                           ItemStaticFlags1 = 0x08000000
	CAN_DROP_IN_CHALLENGE_MODE            ItemStaticFlags1 = 0x10000000
	NEVER_STACK_IN_LOOT_UI                ItemStaticFlags1 = 0x20000000
	DISENCHANT_TO_LOOT_TABLE              ItemStaticFlags1 = 0x40000000
	CAN_BE_PLACED_IN_REAGENT_BANK         ItemStaticFlags1 = 0x80000000
)

func (ItemStaticFlags1) Has

type ItemStaticFlags2

type ItemStaticFlags2 uint32
const (
	DONT_DESTROY_ON_QUEST_ACCEPT                        ItemStaticFlags2 = 0x00000001
	CAN_BE_UPGRADED                                     ItemStaticFlags2 = 0x00000002
	UPGRADE_FROM_ITEM_OVERRIDES_DROP_UPGRADE            ItemStaticFlags2 = 0x00000004
	ALWAYS_FREE_FOR_ALL_IN_LOOT                         ItemStaticFlags2 = 0x00000008
	HIDE_ITEM_UPGRADES_IF_NOT_UPGRADED                  ItemStaticFlags2 = 0x00000010
	UPDATE_NPC_INTERACTIONS_WHEN_PICKED_UP              ItemStaticFlags2 = 0x00000020
	DOESNT_LEAVE_PROGRESSIVE_WIN_HISTORY                ItemStaticFlags2 = 0x00000040
	IGNORE_ITEM_HISTORY_TRACKER                         ItemStaticFlags2 = 0x00000080
	IGNORE_ITEM_LEVEL_CAP_IN_PVP                        ItemStaticFlags2 = 0x00000100
	DISPLAY_AS_HEIRLOOM                                 ItemStaticFlags2 = 0x00000200
	SKIP_USE_CHECK_ON_PICKUP                            ItemStaticFlags2 = 0x00000400
	NO_LOOT_OVERFLOW_MAIL                               ItemStaticFlags2 = 0x00000800
	DONT_DISPLAY_IN_GUILD_NEWS                          ItemStaticFlags2 = 0x00001000
	TRIAL_OF_THE_GLADIATOR_GEAR                         ItemStaticFlags2 = 0x00002000
	REQUIRES_STACK_CHANGE_LOG                           ItemStaticFlags2 = 0x00004000
	TOY                                                 ItemStaticFlags2 = 0x00008000
	SUPPRESS_NAME_SUFFIXES                              ItemStaticFlags2 = 0x00010000
	PUSH_LOOT                                           ItemStaticFlags2 = 0x00020000
	DONT_REPORT_LOOT_LOG_TO_PARTY                       ItemStaticFlags2 = 0x00040000
	ALWAYS_ALLOW_DUAL_WIELD                             ItemStaticFlags2 = 0x00080000
	OBLITERATABLE                                       ItemStaticFlags2 = 0x00100000
	ACTS_AS_TRANSMOG_HIDDEN_VISUAL_OPTION               ItemStaticFlags2 = 0x00200000
	EXPIRE_ON_WEEKLY_RESET                              ItemStaticFlags2 = 0x00400000
	DOESNT_SHOW_UP_IN_TRANSMOG_UI_UNTIL_COLLECTED       ItemStaticFlags2 = 0x00800000
	CAN_STORE_ENCHANTS                                  ItemStaticFlags2 = 0x01000000
	HIDE_QUEST_ITEM_FROM_OBJECT_TOOLTIP                 ItemStaticFlags2 = 0x02000000
	DO_NOT_TOAST                                        ItemStaticFlags2 = 0x04000000
	IGNORE_CREATION_CONTEXT_FOR_PROGRESSIVE_WIN_HISTORY ItemStaticFlags2 = 0x08000000
	FORCE_ALL_SPECS_FOR_ITEM_HISTORY                    ItemStaticFlags2 = 0x10000000
	SAVE_AFTER_CONSUME                                  ItemStaticFlags2 = 0x20000000
	LOOT_CONTAINER_SAVES_PLAYER_STATE                   ItemStaticFlags2 = 0x40000000
	NO_VOID_STORAGE                                     ItemStaticFlags2 = 0x80000000
)

func (ItemStaticFlags2) Has

type ItemStaticFlags3

type ItemStaticFlags3 uint32
const (
	IMMEDIATELY_TRIGGER_ON_USE_BINDING_EFFECTS    ItemStaticFlags3 = 0x00000001
	ALWAYS_DISPLAY_ITEM_LEVEL_IN_TOOLTIP          ItemStaticFlags3 = 0x00000002
	DISPLAY_RANDOM_ADDITIONAL_STATS_IN_TOOLTIP    ItemStaticFlags3 = 0x00000004
	ACTIVATE_ON_EQUIP_EFFECTS_WHEN_TRANSMOGRIFIED ItemStaticFlags3 = 0x00000008
	ENFORCE_TRANSMOG_WITH_CHILD_ITEM              ItemStaticFlags3 = 0x00000010
	SCRAPABLE                                     ItemStaticFlags3 = 0x00000020
	BYPASS_REP_REQUIREMENTS_FOR_TRANSMOG          ItemStaticFlags3 = 0x00000040
	DISPLAY_ONLY_ON_DEFINED_RACES                 ItemStaticFlags3 = 0x00000080
	REGULATED_COMMODITY                           ItemStaticFlags3 = 0x00000100
	CREATE_LOOT_IMMEDIATELY                       ItemStaticFlags3 = 0x00000200
	GENERATE_LOOT_SPEC_ITEM                       ItemStaticFlags3 = 0x00000400
	HIDDEN_IN_REWARD_SUMMARIES                    ItemStaticFlags3 = 0x00000800
	DISALLOW_WHILE_LEVEL_LINKED                   ItemStaticFlags3 = 0x00001000
	DISALLOW_ENCHANT                              ItemStaticFlags3 = 0x00002000
	SQUISH_USING_ITEM_LEVEL_AS_PLAYER_LEVEL       ItemStaticFlags3 = 0x00004000
	ALWAYS_SHOW_SELL_PRICE_IN_TOOLTIP             ItemStaticFlags3 = 0x00008000
	COSMETIC_ITEM                                 ItemStaticFlags3 = 0x00010000
	NO_SPELL_EFFECT_TOOLTIP_PREFIXES              ItemStaticFlags3 = 0x00020000
	IGNORE_COSMETIC_COLLECTION_BEHAVIOR           ItemStaticFlags3 = 0x00040000
	NPC_ONLY                                      ItemStaticFlags3 = 0x00080000
	NOT_RESTORABLE                                ItemStaticFlags3 = 0x00100000
	DONT_DISPLAY_AS_CRAFTING_REAGENT              ItemStaticFlags3 = 0x00200000
	DISPLAY_REAGENT_QUALITY_AS_CRAFTED_QUALITY    ItemStaticFlags3 = 0x00400000
	NO_SALVAGE                                    ItemStaticFlags3 = 0x00800000
	RECRAFTABLE                                   ItemStaticFlags3 = 0x01000000
	CC_TRINKET                                    ItemStaticFlags3 = 0x02000000
	KEEP_THROUGH_FACTION_CHANGE                   ItemStaticFlags3 = 0x04000000
	NOT_MULTICRAFTABLE                            ItemStaticFlags3 = 0x08000000
	DONT_REPORT_LOOT_LOG_TO_SELF                  ItemStaticFlags3 = 0x10000000
	SEND_TELEMETRY_ON_USE                         ItemStaticFlags3 = 0x20000000
)

func (ItemStaticFlags3) Has

type ItemStaticFlags4

type ItemStaticFlags4 uint32
const (
	REDUCED_CASTER_DPS   ItemStaticFlags4 = 0x00000100
	CASTER_SPELL_POWER   ItemStaticFlags4 = 0x00000200
	CASTER_HEALING_POWER ItemStaticFlags4 = 0x00000400
)

func (ItemStaticFlags4) Has

type ItemSubClass

type ItemSubClass int
const (
	OneHandedAxes    ItemSubClass = 1 << 0  // 1    from "One-Handed Axes" (SubClassID 0)
	TwoHandedAxes    ItemSubClass = 1 << 1  // 2    from "Two-Handed Axes" (SubClassID 1)
	Bows             ItemSubClass = 1 << 2  // 4    from "Bows" (SubClassID 2)
	Guns             ItemSubClass = 1 << 3  // 8    from "Guns" (SubClassID 3)
	OneHandedMaces   ItemSubClass = 1 << 4  // 16   from "One-Handed Maces" (SubClassID 4)
	TwoHandedMaces   ItemSubClass = 1 << 5  // 32   from "Two-Handed Maces" (SubClassID 5)
	Polearms         ItemSubClass = 1 << 6  // 64   from "Polearms" (SubClassID 6)
	OneHandedSwords  ItemSubClass = 1 << 7  // 128  from "One-Handed Swords" (SubClassID 7)
	TwoHandedSwords  ItemSubClass = 1 << 8  // 256  from "Two-Handed Swords" (SubClassID 8)
	Relic            ItemSubClass = 1 << 9  // 512  from "Relic" (SubClassID 9)
	Staves           ItemSubClass = 1 << 10 // 1024 from "Staves" (SubClassID 10)
	OneHandedExotics ItemSubClass = 1 << 11 // 2048 from "One-Handed Exotics" (SubClassID 11)
	TwoHandedExotics ItemSubClass = 1 << 12 // 4096 from "Two-Handed Exotics" (SubClassID 12)
	FistWeapons      ItemSubClass = 1 << 13 // 8192 from "Fist Weapons" (SubClassID 13)
	Daggers          ItemSubClass = 1 << 15 // 32768 from "Daggers" (SubClassID 15)
)

Define each item subclass as a bit flag (only those with a name).

type ParseError

type ParseError struct {
	Source string
	Field  string
	Reason string
}

func (ParseError) Error

func (e ParseError) Error() string

type Race

type Race int
const (
	Human    Race = 1 << 0  // 1
	Orc      Race = 1 << 1  // 2
	Dwarf    Race = 1 << 2  // 4
	NightElf Race = 1 << 3  // 8
	Undead   Race = 1 << 4  // 16
	Tauren   Race = 1 << 5  // 32
	Gnome    Race = 1 << 6  // 64
	Troll    Race = 1 << 7  // 128
	Goblin   Race = 1 << 8  // 256
	BloodElf Race = 1 << 9  // 512
	Draenei  Race = 1 << 10 // 1024

	HighOrderSkyborne  Race = 1 << 32
	WindshaperSkyborne Race = 1 << 33

	AlliedRaces Race = Human | Dwarf | NightElf | Gnome | Draenei | HighOrderSkyborne
	HordeRaces  Race = Undead | Orc | Tauren | Troll | Goblin | BloodElf | WindshaperSkyborne
)

Define each race as a bit flag Table: ChrRaces

func (Race) Matches

func (race Race) Matches(other Race) bool

Returns whether there is any overlap between the given masks.

type RandomPropAllocation

type RandomPropAllocation struct {
	Epic0     int32 `json:"Epic_0"`
	Epic1     int32 `json:"Epic_1"`
	Epic2     int32 `json:"Epic_2"`
	Epic3     int32 `json:"Epic_3"`
	Epic4     int32 `json:"Epic_4"`
	Superior0 int32 `json:"Superior_0"`
	Superior1 int32 `json:"Superior_1"`
	Superior2 int32 `json:"Superior_2"`
	Superior3 int32 `json:"Superior_3"`
	Superior4 int32 `json:"Superior_4"`
	Good0     int32 `json:"Good_0"`
	Good1     int32 `json:"Good_1"`
	Good2     int32 `json:"Good_2"`
	Good3     int32 `json:"Good_3"`
	Good4     int32 `json:"Good_4"`
}

type RandomPropAllocationMap

type RandomPropAllocationMap map[proto.ItemQuality][5]int32

type RandomPropAllocationsByIlvl

type RandomPropAllocationsByIlvl map[int]RandomPropAllocationMap

type RandomSuffix

type RandomSuffix struct {
	ID               int
	Name             string
	Stats            []RandomSuffixStat
	EquipSpells      []int // The spells of the list's ITEM_BONUS_ITEM_EFFECT rows.
	ReducedCasterDps bool  // The list carries an ITEM_BONUS_REDUCED_CASTER_DPS row: a weapon with it deals a caster weapon's share of its damage table.
}

A random suffix is one bonus list of an item's bonus tree; its ID is the bonus list's.

func (RandomSuffix) ToProto

func (raw RandomSuffix) ToProto() *proto.ItemRandomSuffix

type RandomSuffixStat

type RandomSuffixStat struct {
	ItemMod    int
	Allocation int // Per 10000 of the item's random property points.
}

type ShieldBlock

type ShieldBlock struct {
	Level  int
	Values map[proto.ItemQuality]float64
}

type Spell

type Spell struct {
	NameLang              string
	ID                    int32
	SchoolMask            int32
	Speed                 float32
	LaunchDelay           float32
	MinDuration           float32
	MaxScalingLevel       int
	MinScalingLevel       int32
	ScalesFromItemLevel   int32
	SpellLevel            int
	BaseLevel             int32
	MaxLevel              int
	MaxPassiveAuraLevel   int32
	Cooldown              int32
	GCD                   int32
	MinRange              float32
	MaxRange              float32
	Attributes            []int
	CategoryFlags         int32
	MaxCharges            int32
	ChargeRecoveryTime    int32
	CategoryTypeMask      int32
	Category              int32
	DefenseType           int32 // SpellCategories.DefenseType: 0 none, 1 magic, 2 melee, 3 ranged
	Duration              int32
	ProcChance            float32
	ProcCharges           int32
	ProcTypeMask          []int
	ProcCategoryRecovery  int32
	CategoryRecoveryTime  int32
	EquippedItemClass     int32
	EquippedItemInvTypes  int32
	EquippedItemSubclass  int32
	CastTimeMin           float32
	SpellClassMask        []int
	SpellClassSet         int32
	AuraInterruptFlags    []int
	ChannelInterruptFlags []int
	ShapeshiftMask        []int
	Description           string
	Variables             string
	MaxCumulativeStacks   int32
	MaxTargets            int32
	RequiredAreasID       int32
	IconPath              string
}

func (*Spell) CanProcFromProcs

func (s *Spell) CanProcFromProcs() bool

Reports whether the listener aura also fires from hits of triggered spells that lack ATTR_EX_3_NOT_A_PROC. Emitted as ProcTrigger.CanProcFromProcs.

func (*Spell) CannotCrit

func (s *Spell) CannotCrit() bool

Reports whether the spell is barred from critically striking. Seal of Light, Judgement of Wisdom, Sweeping Strikes and Vampiric Embrace are the shape: effects that resolve at a flat amount in game. A damage proc built from one of these has to roll an outcome that cannot crit, or it gains crit damage the game never gives it.

func (*Spell) HasAttributeAt

func (s *Spell) HasAttributeAt(index int, flag uint32) bool

func (*Spell) IsWeaponProcAura

func (s *Spell) IsWeaponProcAura() bool

Reports whether the listener aura, although not a weapon proc, ignores hits that suppress weapon procs. Emitted as SpellFlagsExclude: SpellFlagSuppressWeaponProcs.

func (*Spell) NotAProc

func (s *Spell) NotAProc() bool

Reports whether a triggered spell's hits count as ability hits to aura listeners rather than as proc hits. A damage proc built from a spell without it gets SpellFlagProc.

func (*Spell) OnlyProcsFromClassAbilities

func (s *Spell) OnlyProcsFromClassAbilities() bool

Reports whether the spell only procs from class abilities rather than from any hit.

func (*Spell) ScalesWithItemLevel

func (s *Spell) ScalesWithItemLevel() bool

Reports whether the spell's effect amounts come from the item level of the item carrying it rather than from a class curve. On such an effect EffectBasePoints is a stale snapshot and only the scaling coefficient resolves the real amount.

func (*Spell) SuppressesWeaponProcs

func (s *Spell) SuppressesWeaponProcs() bool

Reports whether weapon procs ignore this spell's hits.

type SpellEffect

type SpellEffect struct {
	ID                             int
	DifficultyID                   int
	EffectIndex                    int
	EffectType                     SpellEffectType
	EffectAmplitude                float64
	EffectAttributes               int
	EffectAura                     EffectAuraType
	EffectAuraPeriod               int
	EffectBasePoints               float64
	EffectBonusCoefficient         float64
	EffectChainAmplitude           float64
	EffectChainTargets             int
	EffectDieSides                 float64
	EffectItemType                 int
	EffectMechanic                 int
	EffectPointsPerResource        float64
	EffectPosFacing                float64
	EffectRealPointsPerLevel       float64
	EffectTriggerSpell             int
	BonusCoefficientFromAP         float64
	PvpMultiplier                  float64
	Coefficient                    float64
	Variance                       float64
	ResourceCoefficient            float64
	GroupSizeBasePointsCoefficient float64
	// Grouped properties parsed from JSON strings:
	EffectMiscValues      []int     // from EffectMiscValue_0, EffectMiscValue_1
	EffectMinRange        []float64 // from EffectRadiusIndex_0, EffectRadiusIndex_1
	EffectMaxRange        []float64
	EffectSpellClassMasks []int // from EffectSpellClassMask_0, EffectSpellClassMask_1, EffectSpellClassMask_2, EffectSpellClassMask_3
	ImplicitTargets       []int // from ImplicitTarget_0, ImplicitTarget_1
	SpellID               int
	ScalingType           int
}

func GetSpellEffectRecursive

func GetSpellEffectRecursive(spellIDToMatch int, spellEffects map[int]SpellEffect) *SpellEffect

Walks the trigger chain below the given effects and returns the effect that triggers spellIDToMatch, or nil. Effects are visited in index order and a branch that does not contain the match no longer aborts the search of its siblings, which is what hid any buff reachable only through a later effect.

Takes the effects rather than a spell ID because that is what the call sites hold; everything below the first level goes through the chain walker.

func (*SpellEffect) CalcCoefficientStatValue

func (effect *SpellEffect) CalcCoefficientStatValue(ilvl int) float64

func (*SpellEffect) CastsItsTrigger

func (effect *SpellEffect) CastsItsTrigger() bool

Reports whether a chain walk may follow the effect to its trigger. A removal names the aura it removes, and the conditional auras cast theirs only at a stack count or a power or health threshold the walk does not check.

func (*SpellEffect) ClassFlag

func (data *SpellEffect) ClassFlag(index uint) uint32

func (*SpellEffect) GetRadiusMax

func (s *SpellEffect) GetRadiusMax() float64

func (*SpellEffect) GetRadiusMin

func (s *SpellEffect) GetRadiusMin() float64

func (*SpellEffect) GetScalingValue

func (effect *SpellEffect) GetScalingValue(ilvl int) float64

func (*SpellEffect) GrantsStats

func (effect *SpellEffect) GrantsStats() bool

Reports whether the effect's aura is one of the types that can carry stats.

func (*SpellEffect) HitsAnEnemy

func (effect *SpellEffect) HitsAnEnemy() bool

Whether either implicit target is an enemy. What such an aura changes is the enemy's, never a stat of the wearer.

func (*SpellEffect) IsDirectDamageEffect

func (effect *SpellEffect) IsDirectDamageEffect() bool

func (*SpellEffect) IsDummy

func (effect *SpellEffect) IsDummy() bool

Reports whether the aura resolves to nothing on its own. Either it applies in game as a marker, or its real behaviour is server-scripted and not present in DBC at all.

func (*SpellEffect) IsPeriodicDamageEffect

func (effect *SpellEffect) IsPeriodicDamageEffect() bool

func (*SpellEffect) IsProcTrigger

func (effect *SpellEffect) IsProcTrigger() bool

Reports whether the aura fires when its owner procs: one that casts another spell, with or without an amount, or one that deals its own damage and names no spell below it. The first two are the same edge for walking a trigger chain; the walk stops at the third.

func (*SpellEffect) ParseStatEffect

func (effect *SpellEffect) ParseStatEffect(scalesWithIlvl bool, ilvl int) (stats.Stats, bool)

The stats the effect grants, and whether it granted any. The caller needs the two apart: an effect that resolves to nothing is the signal to keep walking down the trigger chain, and "all zeroes" is a legitimate resolution for an aura this does not model.

func (*SpellEffect) ScalingClass

func (s *SpellEffect) ScalingClass() proto.Class

func (*SpellEffect) ToProto

func (se *SpellEffect) ToProto() *proto.SpellEffect

type SpellEffectType

type SpellEffectType = dbcenums.SpellEffectType

The game files' spell enums live in sim/core/dbcenums, which the sim reads as well. The aliases keep the field types of this package's rows spelled as its own.

type SpellItemEnchantmentFlags

type SpellItemEnchantmentFlags uint32
const (
	SOULBOUND SpellItemEnchantmentFlags = 0x00000001
)

func (SpellItemEnchantmentFlags) Has

type SpellScaling

type SpellScaling struct {
	Level  int
	Values map[proto.Class]float64
}

type SpellSchool

type SpellSchool int
const (
	PHYSICAL SpellSchool = 1 << iota // 0x1
	HOLY                             // 0x2
	FIRE                             // 0x4
	NATURE                           // 0x8
	FROST                            // 0x10
	SHADOW                           // 0x20
	ARCANE                           // 0x40

	ALL_SPELL_DAMAGE = HOLY | FIRE | NATURE | FROST | SHADOW | ARCANE // 126

	SPELL_PENETRATION = FIRE | NATURE | FROST | SHADOW | ARCANE // 0x7C
)

func (SpellSchool) Has

func (f SpellSchool) Has(flag SpellSchool) bool

type TemporaryEnchant

type TemporaryEnchant struct {
	ID      int
	Effects [3]int
	Points  [3]int
	Args    [3]int
	// SpellCastingRequirements.RequiredAreasID of the spells the slots name: the area group outside
	// which they do nothing. 0 when they work everywhere.
	RequiredAreasID int
}

The SpellItemEnchantment row a consumable's temporary enchant (Effect 54, or the imbue Effect 360) applies, by its three slots. ID is 0 when the consumable enchants nothing.

func (TemporaryEnchant) ToProto

func (t TemporaryEnchant) ToProto() *proto.SimEnchant

The enchant as the enchant table reads a permanent one: stats and pseudo stats from its stat, resistance and equip spell slots, and its flat weapon damage. A combat spell slot that states a chance adds the spell it casts off the enchanted weapon's hits, by its id alone; the store writes the chance onto that spell's row.

type ValidationError

type ValidationError struct {
	Type  string
	ID    int
	Field string
	Msg   string
}

func (ValidationError) Error

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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