mage

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 9 Imported by: ? modules, 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 (
	DDBC_FireVulnerability int = iota
	DDBC_WintersChill
	DDBC_FirePower

	DDBC_Total
)

The slots on the mage's attack table against a target for what raises only its own attacks there: one per FromCaster parse, and Fire Power.

View Source
const (
	FireSpellMaxTimeUntilResult       = 750 * time.Millisecond
	MageSpellFlagNone           int64 = 0
	MageSpellArcaneBlast        int64 = 1 << iota
	MageSpellArcaneExplosion
	MageSpellArcanePower
	MageSpellArcaneMissilesCast
	MageSpellArcaneMissilesTick
	MageSpellArcaneWrath
	MageSpellBlastWave
	MageSpellBlizzard
	MageSpellColdSnap
	MageSpellConeOfCold
	MageSpellEvocation
	MageSpellFireBlast
	MageSpellFireball
	MageSpellFireballDot
	MageSpellFlamestrike
	MageSpellFlamestrikeDot
	MageSpellFrostArmor
	MageSpellIceArmor
	MageSpellFrostbolt
	MageSpellFrostNova
	MageSpellIceBarrier
	MageSpellIceBlock
	MageSpellIceLance
	MageSpellIgnite
	MageSpellMageArmor
	MageSpellManaGems
	MageSpellPresenceOfMind
	MageSpellPyroblast
	MageSpellPyroblastDot
	MageSpellScorch
	MageSpellManaGem
	MageSpellCombustion

	MageSpellFrostfireBolt
	MageSpellFrostfireBoltDot

	MageSpellLast
	MageSpellsAll  = MageSpellLast<<1 - 1
	MageSpellFrost = MageSpellFrostbolt | MageSpellBlizzard | MageSpellFrostNova | MageSpellConeOfCold | MageSpellIceLance
	MageSpellFire  = MageSpellFireball | MageSpellCombustion |
		MageSpellFireBlast | MageSpellFlamestrike | MageSpellIgnite | MageSpellPyroblast | MageSpellScorch
	MageSpellsAllDamaging = MageSpellArcaneBlast | MageSpellArcaneExplosion | MageSpellArcaneMissilesTick | MageSpellArcaneWrath | MageSpellBlizzard |
		MageSpellBlastWave | MageSpellConeOfCold | MageSpellFireBlast | MageSpellFireball | MageSpellFireballDot |
		MageSpellFlamestrike | MageSpellFlamestrikeDot | MageSpellFrostbolt | MageSpellFrostfireBolt | MageSpellFrostfireBoltDot | MageSpellFrostNova |
		MageSpellIceLance | MageSpellPyroblast | MageSpellPyroblastDot | MageSpellScorch
	MageSpellInstantCast = MageSpellArcaneMissilesCast | MageSpellArcaneMissilesTick | MageSpellFireBlast | MageSpellArcaneExplosion | MageSpellPyroblastDot | MageSpellFireballDot |
		MageSpellCombustion | MageSpellConeOfCold | MageSpellIceLance | MageSpellManaGems | MageSpellPresenceOfMind
	MageSpellExtraResult = MageSpellArcaneMissilesTick | MageSpellBlizzard
)

Variables

View Source
var ItemSetArcanistRegalia = core.NewItemSet(core.ItemSet{
	Name: "Arcanist Regalia",
	ID:   201,
	Bonuses: map[int32]core.ApplySetBonus{
		3: func(agent core.Agent, setBonusAura *core.Aura) {
			mage := agent.(MageAgent).GetMage()
			spelldata.ParseEffects(&mage.Character, setBonusAura, arcanistSpellDamage)
		},
		5: func(agent core.Agent, setBonusAura *core.Aura) {
			mage := agent.(MageAgent).GetMage()
			spelldata.ParseEffects(&mage.Character, setBonusAura, arcanistPiercing)
		},
		8: func(agent core.Agent, setBonusAura *core.Aura) {
			mage := agent.(MageAgent).GetMage()
			spelldata.ParseEffects(&mage.Character, setBonusAura, arcanistThreat)
		},
	},
})

TODO: items 16795-16802 have no ItemSparse rows in the game files, so the set cannot be worn yet.

View Source
var ItemSetEnigmaVestments = core.NewItemSet(core.ItemSet{
	Name: "Enigma Vestments",
	ID:   503,
	Bonuses: map[int32]core.ApplySetBonus{
		5: func(agent core.Agent, setBonusAura *core.Aura) {
			mage := agent.(MageAgent).GetMage()

			answer := mage.RegisterAura(spelldata.AuraConfig(enigmaAnswer))
			spelldata.ParseEffects(&mage.Character, answer, enigmaAnswer)

			trigger := spelldata.ProcTrigger(&mage.Character, enigmaResistProc,
				func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) {
					answer.Activate(sim)
					answer.AddStack(sim)
				})
			trigger.Name = "Enigma Vestments - 5PC"
			trigger.Callback = core.CallbackOnSpellHitDealt
			trigger.Outcome = core.OutcomeMiss
			trigger.RequireDamageDealt = false

			setBonusAura.AttachProcTrigger(trigger)
		},
	},
})

(3) Set: a chance for Blizzard not to be interrupted, which the sim never does.

View Source
var ItemSetFrostfireRegalia = core.NewItemSet(core.ItemSet{
	Name:  "Frostfire Regalia",
	ID:    526,
	Slots: shared.TierThreeSlots,
	Bonuses: map[int32]core.ApplySetBonus{
		2: shared.ParsedSetBonus(frostfireEvocation),
		6: func(agent core.Agent, setBonusAura *core.Aura) {
			character := agent.GetCharacter()

			taken := frostfireVulnDebuff.EffectN(1)
			var takenSchools []stats.SchoolIndex
			for school := core.SpellSchoolHoly; school <= core.SpellSchoolArcane; school <<= 1 {
				if taken.Misc&int32(school) != 0 {
					takenSchools = append(takenSchools, school.SchoolIndex())
				}
			}
			debuffs := character.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
				aura := target.RegisterAura(spelldata.AuraConfig(frostfireVulnDebuff,
					spelldata.Label(frostfireVulnDebuff.Name+character.Label)))
				aura.ApplyOnGain(func(_ *core.Aura, _ *core.Simulation) {
					for _, i := range takenSchools {
						target.PseudoStats.SchoolBonusSpellDamage[i] += taken.BaseValue()
					}
				}).ApplyOnExpire(func(_ *core.Aura, _ *core.Simulation) {
					for _, i := range takenSchools {
						target.PseudoStats.SchoolBonusSpellDamage[i] -= taken.BaseValue()
					}
				})

				consume := spelldata.ProcTrigger(character, frostfireVulnDebuff,
					func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) {
						aura.Deactivate(sim)
					})
				consume.Name = "Elemental Vulnerability - Consume" + character.Label
				consume.TriggerImmediately = true
				return aura.AttachProcTrigger(consume)
			})

			trigger := spelldata.ProcTrigger(character, frostfireVulnerability,
				func(sim *core.Simulation, _ *core.Spell, result *core.SpellResult) {
					debuffs.Get(result.Target).Activate(sim)
				})
			trigger.Name = "Frostfire Regalia - 6PC"
			trigger.Callback = core.CallbackOnSpellHitDealt
			trigger.Outcome = core.OutcomeLanded
			trigger.RequireDamageDealt = false
			trigger.RequireDamageComponent = true

			setBonusAura.AttachProcTrigger(trigger)
		},
		8: func(agent core.Agent, setBonusAura *core.Aura) {
			character := agent.GetCharacter()

			buff := character.RegisterAura(spelldata.AuraConfig(frostfireNotThereBuff))
			threatEffect := frostfireNotThereBuff.EffectN(1)
			var schools []stats.SchoolIndex
			for school := core.SpellSchoolHoly; school <= core.SpellSchoolArcane; school <<= 1 {
				if threatEffect.Misc&int32(school) != 0 {
					schools = append(schools, school.SchoolIndex())
				}
			}
			var held [stats.SchoolLen]float64
			buff.ApplyOnGain(func(_ *core.Aura, _ *core.Simulation) {
				for _, i := range schools {
					held[i] = character.PseudoStats.SchoolThreatMultiplier[i]
					character.PseudoStats.SchoolThreatMultiplier[i] *= core.MultiplierFromPercent(threatEffect.BaseValue())
				}
			}).ApplyOnExpire(func(_ *core.Aura, _ *core.Simulation) {
				for _, i := range schools {
					character.PseudoStats.SchoolThreatMultiplier[i] = held[i]
				}
			})

			consume := spelldata.ProcTrigger(character, frostfireNotThereBuff,
				func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) {
					buff.Deactivate(sim)
				})
			consume.Name = "Not There - Consume"
			consume.Callback = core.CallbackOnSpellHitDealt
			consume.Outcome = core.OutcomeLanded
			consume.RequireDamageDealt = false
			consume.RequireDamageComponent = true
			consume.TriggerImmediately = true
			buff.AttachProcTrigger(consume)

			trigger := spelldata.ProcTrigger(character, frostfireNotThere,
				func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) {
					buff.Activate(sim)
				})
			trigger.Name = "Frostfire Regalia - 8PC"
			trigger.Callback = core.CallbackOnSpellHitDealt
			trigger.Outcome = core.OutcomeLanded
			trigger.RequireDamageDealt = false
			trigger.RequireDamageComponent = true

			setBonusAura.AttachProcTrigger(trigger)
		},
	},
})

Tier 3

(4) Set: Adaptive Warding raises a resistance when Mage Armor is struck by a spell, which a boss fight does not test.

View Source
var ItemSetIllusionistsAttire = core.NewItemSet(core.ItemSet{
	Name: "Illusionist's Attire",
	ID:   482,
	Bonuses: map[int32]core.ApplySetBonus{
		2: func(agent core.Agent, setBonusAura *core.Aura) {
			mage := agent.(MageAgent).GetMage()
			spelldata.ParseEffects(&mage.Character, setBonusAura, illusionistSpellDamage)
		},
		5: func(agent core.Agent, setBonusAura *core.Aura) {
			mage := agent.(MageAgent).GetMage()
			spelldata.ParseEffects(&mage.Character, setBonusAura, illusionistFlamestrike)
		},
	},
})

(3) Set: Arcane Intellect and Arcane Brilliance cost less, and the sim casts neither.

View Source
var ItemSetManaflareRegalia = core.NewItemSet(core.ItemSet{
	ID:   2098,
	Name: "Manaflare Regalia",
	Slots: []proto.ItemSlot{
		proto.ItemSlot_ItemSlotShoulder,
		proto.ItemSlot_ItemSlotHands,
		proto.ItemSlot_ItemSlotLegs,
		proto.ItemSlot_ItemSlotFeet,
	},
	Bonuses: map[int32]core.ApplySetBonus{
		2: shared.ParsedSetBonus(manaflareHit),
		3: shared.ParsedSetBonus(manaflareCounterspell),
		4: shared.ParsedSetBonus(manaflareElementals),

		5: func(agent core.Agent, setBonusAura *core.Aura) {
			agent.(MageAgent).GetMage().manaflareAura = setBonusAura
		},
	},
})

Tier 1

The ItemSet row lists six pieces, but the game files ship only the shoulders, hands, legs and feet, so the 5-piece bonus cannot be worn yet.

View Source
var ItemSetNetherwindRegalia = core.NewItemSet(core.ItemSet{
	Name: "Netherwind Regalia",
	ID:   210,
	Bonuses: map[int32]core.ApplySetBonus{

		8: func(agent core.Agent, setBonusAura *core.Aura) {
			mage := agent.(MageAgent).GetMage()

			instant := netherwindFocusBuff.EffectN(1).ClassFlags

			buff := mage.RegisterAura(spelldata.AuraConfig(netherwindFocusBuff))
			spelldata.ParseEffects(&mage.Character, buff, netherwindFocusBuff)

			buff.AttachProcTrigger(core.ProcTrigger{
				Name:               "Netherwind Focus - Consume",
				ClassFlags:         instant,
				Callback:           core.CallbackOnCastComplete,
				TriggerImmediately: true,
				Handler: func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) {
					buff.Deactivate(sim)
				},
			})

			trigger := spelldata.ProcTrigger(&mage.Character, netherwindFocusProc,
				func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) {
					buff.Activate(sim)
				})
			trigger.Name = "Netherwind Regalia - 8PC"
			trigger.ExtraCondition = func(_ *core.Simulation, spell *core.Spell, _ *core.SpellResult) bool {
				return spellData.ArcaneMissiles.Contains(spell) || spellData.Fireball.Contains(spell) ||
					spellData.Frostbolt.Contains(spell)
			}

			setBonusAura.AttachProcTrigger(trigger)
		},
	},
})

TODO: items 16818 and 16912-16918 have no ItemSparse rows in the game files, so the set cannot be worn yet.

(5) Set: a larger radius on Arcane Explosion, Flamestrike and Blizzard, which a single target does not test.

View Source
var ItemSetZanzilsConcentration = core.NewItemSet(core.ItemSet{
	Name: "Zanzil's Concentration",
	ID:   462,
	Bonuses: map[int32]core.ApplySetBonus{
		2: func(agent core.Agent, setBonusAura *core.Aura) {
			mage := agent.(MageAgent).GetMage()
			spelldata.ParseEffects(&mage.Character, setBonusAura, zanzilSpellHit)
			spelldata.ParseEffects(&mage.Character, setBonusAura, zanzilSpellDamage)
		},
	},
})

TODO: items 19893 and 19905 have no ItemSparse rows in the game files, so the set cannot be worn yet.

View Source
var TalentTreeSizes = [3]int{18, 17, 18}

Functions

func RegisterMage

func RegisterMage()

Types

type Mage

type Mage struct {
	core.Character

	ClassSpellScaling float64

	Talents *proto.MageTalents
	Options *proto.MageOptions

	ArcaneChargesAura  *core.Aura
	ClearCasting       *core.Aura
	MissileBarrageAura *core.Aura
	PresenceOfMindAura *core.Aura
	ArcanePowerAura    *core.Aura
	FingersOfFrostAura *core.Aura

	ImprovedScorchAuras core.AuraArray
	WintersChillAuras   core.AuraArray

	Ignite *core.Spell
	// contains filtered or unexported fields
}

func NewMage

func NewMage(character *core.Character, options *proto.Player) *Mage

func (*Mage) AddPartyBuffs

func (mage *Mage) AddPartyBuffs(partyBuffs *proto.PartyBuffs)

func (*Mage) AddRaidBuffs

func (mage *Mage) AddRaidBuffs(raidBuffs *proto.RaidBuffs)

func (*Mage) ApplyTalents

func (mage *Mage) ApplyTalents()

func (*Mage) GetCharacter

func (mage *Mage) GetCharacter() *core.Character

func (*Mage) GetMage

func (mage *Mage) GetMage() *Mage

func (*Mage) Initialize

func (mage *Mage) Initialize()

func (*Mage) OnEncounterStart

func (mage *Mage) OnEncounterStart(sim *core.Simulation)

func (*Mage) Reset

func (mage *Mage) Reset(sim *core.Simulation)

type MageAgent

type MageAgent interface {
	GetMage() *Mage
}

The underlying mage of any of the mage agents.

Jump to

Keyboard shortcuts

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