warrior

package
v0.0.110 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiamondFlask           = 20130
	Exsanguinar            = 216497
	SuzerainDefender       = 224280
	GrileksCharmOFMight    = 231286
	RageOfMugamba          = 231350
	GeneralsPlateGauntlets = 231532 // 16548
	MarshalsPlateGauntlets = 231541 // 16484
	BandOfTheDreadnaught   = 236022
)
View Source
const (
	DefaultRecklessnessDamageTakenMultiplier = 1.20
	DefaultRecklessnessStance                = BerserkerStance
	DefaultRecklessnessDuration              = time.Second * 12
)
View Source
const (
	ClassSpellMask_WarriorNone uint64 = 0

	ClassSpellMask_WarriorBloodrage uint64 = 1 << iota
	ClassSpellMask_WarriorBloodthirst
	ClassSpellMask_WarriorCleave
	ClassSpellMask_WarriorDeathWish
	ClassSpellMask_WarriorDeepWounds
	ClassSpellMask_WarriorDevastate
	ClassSpellMask_WarriorExecute
	ClassSpellMask_WarriorHamstring
	ClassSpellMask_WarriorHeroicStrike
	ClassSpellMask_WarriorMortalStrike
	ClassSpellMask_WarriorOverpower
	ClassSpellMask_WarriorQuickStrike
	ClassSpellMask_WarriorRagingBlow
	ClassSpellMask_WarriorRecklesness
	ClassSpellMask_WarriorRend
	ClassSpellMask_WarriorRetaliation
	ClassSpellMask_WarriorRevenge
	ClassSpellMask_WarriorShieldSlam
	ClassSpellMask_WarriorShieldWall
	ClassSpellMask_WarriorShockwave
	ClassSpellMask_WarriorSlam
	ClassSpellMask_WarriorSlamMH
	ClassSpellMask_WarriorSlamOH
	ClassSpellMask_WarriorStanceBattle
	ClassSpellMask_WarriorStanceBerserker
	ClassSpellMask_WarriorStanceGladiator
	ClassSpellMask_WarriorStanceDefensive
	ClassSpellMask_WarriorSunderArmor
	ClassSpellMask_WarriorThunderClap
	ClassSpellMask_WarriorWhirlwind
	ClassSpellMask_WarriorWhirlwindMH
	ClassSpellMask_WarriorWhirlwindOH
)
View Source
const (
	ArmsTree = 0
	FuryTree = 1
	ProtTree = 2
)
View Source
const CrimsonCleaverDamageBonus = 1.20
View Source
const MercyDamageBonus = 1.20
View Source
const RevengeRanks = 6
View Source
const ShoutExpirationThreshold = time.Second * 3
View Source
const (
	SpellFlagOffensive = core.SpellFlagAgentReserved1
)

Variables

View Source
var ItemSetBattlegearOfUnyieldingStrength = core.NewItemSet(core.ItemSet{
	Name: "Battlegear of Unyielding Strength",
	Bonuses: map[int32]core.ApplyEffect{
		3: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyRAQTank3PBonus()
		},
	},
})
View Source
var ItemSetBattlegearOfValor = core.NewItemSet(core.ItemSet{
	Name: "Battlegear of Heroism",
	Bonuses: map[int32]core.ApplyEffect{

		2: func(agent core.Agent) {
			c := agent.GetCharacter()
			c.AddStats(stats.Stats{
				stats.AttackPower:       40,
				stats.RangedAttackPower: 40,
			})
		},

		4: func(agent core.Agent) {
			c := agent.GetCharacter()
			actionID := core.ActionID{SpellID: 450587}
			healthMetrics := c.NewHealthMetrics(core.ActionID{SpellID: 450589})
			rageMetrics := c.NewRageMetrics(core.ActionID{SpellID: 450589})

			core.MakeProcTriggerAura(&c.Unit, core.ProcTrigger{
				ActionID:          actionID,
				Name:              "S03 - Warrior Armor Heal Trigger - Battlegear of Valor",
				Callback:          core.CallbackOnSpellHitDealt,
				Outcome:           core.OutcomeLanded,
				ProcMask:          core.ProcMaskMelee,
				SpellFlagsExclude: core.SpellFlagSuppressEquipProcs,
				PPM:               1,
				Handler: func(sim *core.Simulation, spell *core.Spell, _ *core.SpellResult) {
					c.GainHealth(sim, sim.Roll(88, 132), healthMetrics)
					if c.HasRageBar() {
						c.AddRage(sim, 10, rageMetrics)
					}
				},
			})
		},

		6: func(agent core.Agent) {
			c := agent.GetCharacter()
			c.AddResistances(8)
		},

		8: func(agent core.Agent) {
			c := agent.GetCharacter()
			c.AddStat(stats.Armor, 200)
		},
	},
})
View Source
var ItemSetChampionsBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Champion's Battlegear",
	Bonuses: map[int32]core.ApplyEffect{

		2: func(agent core.Agent) {
			c := agent.GetCharacter()
			c.AddStats(stats.Stats{
				stats.AttackPower:       40,
				stats.RangedAttackPower: 40,
			})
		},

		4: func(agent core.Agent) {

		},

		6: func(agent core.Agent) {
			c := agent.GetCharacter()
			c.AddStat(stats.Stamina, 20)
		},
	},
})
View Source
var ItemSetConquerorsAdvance = core.NewItemSet(core.ItemSet{
	Name: "Conqueror's Advance",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyTAQDamage2PBonus()
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyTAQDamage4PBonus()
		},
	},
})
View Source
var ItemSetConquerorsBulwark = core.NewItemSet(core.ItemSet{
	Name: "Conqueror's Bulwark",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyTAQTank2PBonus()
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyTAQTank4PBonus()
		},
	},
})
View Source
var ItemSetDreadnaughtsBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Dreadnaught's Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyNaxxramasProtection2PBonus()
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyNaxxramasProtection4PBonus()
		},
		6: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyNaxxramasProtection6PBonus()
		},
	},
})
View Source
var ItemSetDreadnaughtsWarplate = core.NewItemSet(core.ItemSet{
	Name: "Dreadnaught's Warplate",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyNaxxramasDamage2PBonus()
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyNaxxramasDamage4PBonus()
		},
		6: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyNaxxramasDamage6PBonus()
		},
	},
})
View Source
var ItemSetImmoveableMight = core.NewItemSet(core.ItemSet{
	Name: "Immoveable Might",
	Bonuses: map[int32]core.ApplyEffect{

		2: func(agent core.Agent) {
			character := agent.GetCharacter()
			character.AddStat(stats.BlockValue, 30)
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT1Tank4PBonus()
		},
		6: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT1Tank6PBonus()
		},
	},
})
View Source
var ItemSetImmoveableWrath = core.NewItemSet(core.ItemSet{
	Name: "Immoveable Wrath",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT2Protection2PBonus()
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT2Protection4PBonus()
		},
		6: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT2Protection6PBonus()
		},
	},
})
View Source
var ItemSetLieutenantCommandersBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Lieutenant Commander's Battlegear",
	Bonuses: map[int32]core.ApplyEffect{

		2: func(agent core.Agent) {
			c := agent.GetCharacter()
			c.AddStats(stats.Stats{
				stats.AttackPower:       40,
				stats.RangedAttackPower: 40,
			})
		},

		4: func(agent core.Agent) {

		},

		6: func(agent core.Agent) {
			c := agent.GetCharacter()
			c.AddStat(stats.Stamina, 20)
		},
	},
})
View Source
var ItemSetLightbreakersBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Lightbreaker's Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyScarletEnclaveProtection2PBonus()
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyScarletEnclaveProtection4PBonus()
		},
		6: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyScarletEnclaveProtection6PBonus()
		},
	},
})
View Source
var ItemSetLightbreakersWarplate = core.NewItemSet(core.ItemSet{
	Name: "Lightbreaker's Warplate",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyScarletEnclaveDamage2PBonus()
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyScarletEnclaveDamage4PBonus()
		},
		6: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyScarletEnclaveDamage6PBonus()
		},
	},
})
View Source
var ItemSetUnstoppableMight = core.NewItemSet(core.ItemSet{
	Name: "Unstoppable Might",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT1Damage2PBonus()
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT1Damage4PBonus()
		},
		6: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT1Damage6PBonus()
		},
	},
})
View Source
var ItemSetUnstoppableWrath = core.NewItemSet(core.ItemSet{
	Name: "Unstoppable Wrath",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT2Damage2PBonus()
		},
		4: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT2Damage4PBonus()
		},
		6: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyT2Damage6PBonus()
		},
	},
})
View Source
var ItemSetVindicatorsBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Vindicator's Battlegear",
	Bonuses: map[int32]core.ApplyEffect{

		2: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.AddStat(stats.Defense, 7)
		},
		3: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyZGGladiator3PBonus()
		},
		5: func(agent core.Agent) {
			warrior := agent.(WarriorAgent).GetWarrior()
			warrior.applyZGGladiator5PBonus()
		},
	},
})
View Source
var RevengeBaseDamage = [RevengeRanks + 1][]float64{{0, 0}, {12, 14}, {18, 22}, {25, 31}, {43, 53}, {64, 78}, {81, 99}}
View Source
var RevengeLevel = [RevengeRanks + 1]int{0, 14, 24, 34, 44, 54, 60}
View Source
var RevengeSpellId = [RevengeRanks + 1]int32{0, 6572, 6574, 7379, 11600, 11601, 25288}
View Source
var TalentTreeSizes = [3]int{18, 17, 17}

Functions

This section is empty.

Types

type Stance

type Stance uint8
const (
	BattleStance Stance = 1 << iota
	DefensiveStance
	BerserkerStance
	GladiatorStance

	AnyStance = BattleStance | DefensiveStance | BerserkerStance | GladiatorStance
)

func (Stance) Matches added in v0.0.17

func (stance Stance) Matches(other Stance) bool

type Warrior

type Warrior struct {
	core.Character

	Talents *proto.WarriorTalents

	WarriorInputs

	// Current state
	Stance         Stance
	PreviousStance Stance // Used for Warrior T1 DPS 4P

	OverpowerAura *core.Aura

	BloodSurgeAura    *core.Aura
	LastStandAura     *core.Aura
	RampageAura       *core.Aura
	ShieldBlockAura   *core.Aura
	SuddenDeathAura   *core.Aura
	TasteForBloodAura *core.Aura

	// Enrage Auras
	BerserkerRageAura      *core.Aura
	BloodrageAura          *core.Aura
	ConsumedByRageAura     *core.Aura
	EnrageAura             *core.Aura
	FreshMeatEnrageAura    *core.Aura
	WreckingCrewEnrageAura *core.Aura

	LastAMTick time.Duration

	BattleShout *WarriorSpell

	BattleStanceSpells    []*WarriorSpell
	DefensiveStanceSpells []*WarriorSpell
	BerserkerStanceSpells []*WarriorSpell

	Stances         []*WarriorSpell
	BattleStance    *WarriorSpell
	DefensiveStance *WarriorSpell
	BerserkerStance *WarriorSpell
	GladiatorStance *WarriorSpell

	Bloodrage         *WarriorSpell
	BerserkerRage     *WarriorSpell
	Bloodthirst       *WarriorSpell
	DeathWish         *WarriorSpell
	DemoralizingShout *WarriorSpell
	Execute           *WarriorSpell
	MortalStrike      *WarriorSpell
	Overpower         *WarriorSpell
	Recklessness      *WarriorSpell
	Rend              *WarriorSpell
	Retaliation       *WarriorSpell
	Revenge           *WarriorSpell
	ShieldBlock       *WarriorSpell
	ShieldSlam        *WarriorSpell
	ShieldWall        *WarriorSpell
	Slam              *WarriorSpell
	SlamMH            *WarriorSpell
	SlamOH            *WarriorSpell
	SunderArmor       *WarriorSpell
	Devastate         *WarriorSpell
	ThunderClap       *WarriorSpell
	Whirlwind         *WarriorSpell
	WhirlwindMH       *WarriorSpell
	WhirlwindOH       *WarriorSpell
	DeepWounds        *WarriorSpell
	ConcussionBlow    *WarriorSpell
	RagingBlow        *WarriorSpell
	Hamstring         *WarriorSpell
	Rampage           *WarriorSpell
	Shockwave         *WarriorSpell

	HeroicStrike      *WarriorSpell
	HeroicStrikeQueue *WarriorSpell
	QuickStrike       *WarriorSpell
	Cleave            *WarriorSpell
	CleaveQueue       *WarriorSpell

	BattleStanceAura    *core.Aura
	DefensiveStanceAura *core.Aura
	BerserkerStanceAura *core.Aura
	GladiatorStanceAura *core.Aura

	CleaveTargetCount int32

	DemoralizingShoutAuras core.AuraArray
	SunderArmorAuras       core.AuraArray
	ThunderClapAuras       core.AuraArray
	// contains filtered or unexported fields
}

func NewWarrior

func NewWarrior(character *core.Character, talents string, inputs WarriorInputs) *Warrior

func (*Warrior) AddPartyBuffs

func (warrior *Warrior) AddPartyBuffs(_ *proto.PartyBuffs)

func (*Warrior) AddRaidBuffs

func (warrior *Warrior) AddRaidBuffs(raidBuffs *proto.RaidBuffs)

func (*Warrior) ApplyCrimsonCleaverWarriorEffect added in v0.0.59

func (warrior *Warrior) ApplyCrimsonCleaverWarriorEffect(aura *core.Aura)

Equip: Chance on hit to cause your next 2 instances of Cleave damage to be increased by 20%. Lasts 12 sec. (100ms cooldown) Confirmed PPM 1.0

func (*Warrior) ApplyFallenRegalityWarriorBonus added in v0.0.52

func (warrior *Warrior) ApplyFallenRegalityWarriorBonus(aura *core.Aura)

If Cleave hits fewer than its maximum number of targets, it deals 25% more damage for each unused bounce.

func (*Warrior) ApplyHackAndSmashWarriorBonus added in v0.0.59

func (warrior *Warrior) ApplyHackAndSmashWarriorBonus()

The damage increaes from Mercy's and Crimson Cleaver's effects are increased by 10%.

func (*Warrior) ApplyMercyWarriorEffect added in v0.0.59

func (warrior *Warrior) ApplyMercyWarriorEffect(aura *core.Aura)

Equip: Chance on hit to cause your next 2 instances of Whirlwind damage to be increased by 20%. Lasts 12 sec. (100ms cooldown) Confirmed PPM 1.0

func (*Warrior) ApplyQueensfallWarriorEffect added in v0.0.52

func (warrior *Warrior) ApplyQueensfallWarriorEffect(aura *core.Aura)

Your Bloodthirst, Mortal Strike, Shield Slam, Heroic Strike, and Cleave critical strikes set the duration of your Rend on the target to 21 sec.

func (*Warrior) ApplyRegicideWarriorEffect added in v0.0.53

func (warrior *Warrior) ApplyRegicideWarriorEffect(itemID int32, aura *core.Aura)

Striking a higher level enemy applies a stack of Coup, increasing their damage taken from your next Execute by 10% per stack, stacking up to 20 times. At 20 stacks, Execute may be cast regardless of the target's health.

func (*Warrior) ApplyRunes

func (warrior *Warrior) ApplyRunes()

func (*Warrior) ApplyTalents

func (warrior *Warrior) ApplyTalents()

func (*Warrior) GetCharacter

func (warrior *Warrior) GetCharacter() *core.Character

func (*Warrior) HasRune

func (warrior *Warrior) HasRune(rune proto.WarriorRune) bool

func (*Warrior) Initialize

func (warrior *Warrior) Initialize()

func (*Warrior) IsEnraged added in v0.0.17

func (warrior *Warrior) IsEnraged() bool

func (*Warrior) RegisterRecklessnessCD

func (warrior *Warrior) RegisterRecklessnessCD(sharedTimer *core.Timer)

Recklessness now increases critical strike chance by 50% (was 100%) and the duration is reduced to 12 seconds, but the cooldown is reduced to 5 minutes.

func (*Warrior) RegisterShieldBlockCD

func (warrior *Warrior) RegisterShieldBlockCD()

func (*Warrior) RegisterShieldWallCD

func (warrior *Warrior) RegisterShieldWallCD(sharedTimer *core.Timer)

TODO: Classic Update

func (*Warrior) RegisterSpell added in v0.0.17

func (warrior *Warrior) RegisterSpell(stanceMask Stance, config core.SpellConfig) *WarriorSpell

func (*Warrior) Reset

func (warrior *Warrior) Reset(sim *core.Simulation)

func (*Warrior) StanceMatches

func (warrior *Warrior) StanceMatches(other Stance) bool

func (*Warrior) ToughnessArmorMultiplier

func (warrior *Warrior) ToughnessArmorMultiplier() float64

func (*Warrior) TryHSOrCleave

func (warrior *Warrior) TryHSOrCleave(sim *core.Simulation, mhSwingSpell *core.Spell) *core.Spell

type WarriorAgent

type WarriorAgent interface {
	GetWarrior() *Warrior
}

Agent is a generic way to access underlying warrior on any of the agents.

type WarriorInputs

type WarriorInputs struct {
	QueueDelay     int32
	StanceSnapshot bool
	Stance         proto.WarriorStance
}

type WarriorSpell added in v0.0.17

type WarriorSpell struct {
	*core.Spell
	StanceMask Stance
	// contains filtered or unexported fields
}

func (*WarriorSpell) CanCast added in v0.0.17

func (ws *WarriorSpell) CanCast(sim *core.Simulation, target *core.Unit) bool

func (*WarriorSpell) GetStanceMask added in v0.0.17

func (ws *WarriorSpell) GetStanceMask() Stance

Returns the StanceMask accounting for a possible override

func (*WarriorSpell) IsEqual added in v0.0.17

func (ws *WarriorSpell) IsEqual(s *core.Spell) bool

func (*WarriorSpell) IsReady added in v0.0.17

func (ws *WarriorSpell) IsReady(sim *core.Simulation) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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