warlock

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

importing dependencies

Index

Constants

View Source
const PetExpertiseScale = 1.53

Variables

View Source
var DefaultAfflictionWarlock = &proto.Player_Warlock{
	Warlock: &proto.Warlock{
		Talents:  defaultAfflictionTalents,
		Options:  defaultAfflictionOptions,
		Rotation: defaultAfflictionRotation,
	},
}

---------------------------------------

View Source
var DefaultDemonologyWarlock = &proto.Player_Warlock{
	Warlock: &proto.Warlock{
		Talents:  defaultDemonologyTalents,
		Options:  defaultDemonologyOptions,
		Rotation: defaultDemonologyRotation,
	},
}

---------------------------------------

View Source
var DefaultDestroWarlock = &proto.Player_Warlock{
	Warlock: &proto.Warlock{
		Talents:  defaultDestroTalents,
		Options:  defaultDestroOptions,
		Rotation: defaultDestroRotation,
	},
}
View Source
var ItemSetDarkCovensRegalia = core.NewItemSet(core.ItemSet{
	Name: "Dark Coven's Regalia",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {
			warlock := agent.(WarlockAgent).GetWarlock()
			pet := warlock.Pets[0].GetCharacter()

			DeviousMindsAura := warlock.RegisterAura(core.Aura{
				Label:    "Devious Minds",
				ActionID: core.ActionID{SpellID: 70840},
				Duration: time.Second * 10,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.PseudoStats.DamageDealtMultiplier *= 1.1
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.PseudoStats.DamageDealtMultiplier /= 1.1
				},
			})

			petDeviousMindsAura := pet.RegisterAura(core.Aura{
				Label:    "Devious Minds",
				ActionID: core.ActionID{SpellID: 70840},
				Duration: time.Second * 10,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.PseudoStats.DamageDealtMultiplier *= 1.1
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.PseudoStats.DamageDealtMultiplier /= 1.1
				},
			})

			warlock.RegisterAura(core.Aura{
				Label:    "4pT10 Hidden Aura",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnPeriodicDamageDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
					if spell == warlock.UnstableAffliction || spell == warlock.ImmolateDot.Spell {
						if sim.RandomFloat("4pT10") < 0.15 {
							DeviousMindsAura.Activate(sim)
							DeviousMindsAura.Refresh(sim)
							petDeviousMindsAura.Activate(sim)
							petDeviousMindsAura.Refresh(sim)
						}
					}
				},
			})
		},
	},
})

T10

View Source
var ItemSetDeathbringerGarb = core.NewItemSet(core.ItemSet{
	Name: "Deathbringer Garb",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})

T8

View Source
var ItemSetGladiatorsFelshroud = core.NewItemSet(core.ItemSet{
	Name: "Gladiator's Felshroud",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warlock := agent.(WarlockAgent).GetWarlock()
			warlock.AddStat(stats.SpellPower, 29)
		},
		4: func(agent core.Agent) {
			warlock := agent.(WarlockAgent).GetWarlock()
			warlock.AddStat(stats.SpellPower, 88)
		},
	},
})
View Source
var ItemSetGuldansRegalia = core.NewItemSet(core.ItemSet{
	Name: "Gul'dan's Regalia",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warlock := agent.(WarlockAgent).GetWarlock()
			pet := warlock.Pets[0].GetCharacter()
			pet.AddStats(stats.Stats{
				stats.MeleeCrit: 10 * core.CritRatingPerCritChance,
				stats.SpellCrit: 10 * core.CritRatingPerCritChance,
			})
		},
		4: func(agent core.Agent) {

		},
	},
})

T9

View Source
var ItemSetMaleficRaiment = core.NewItemSet(core.ItemSet{
	Name: "Malefic Raiment",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})

T6

View Source
var ItemSetPlagueheartGarb = core.NewItemSet(core.ItemSet{
	Name: "Plagueheart Garb",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			warlock := agent.(WarlockAgent).GetWarlock()

			DemonicSoulAura := warlock.RegisterAura(core.Aura{
				Label:    "Demonic Soul",
				ActionID: core.ActionID{SpellID: 61595},
				Duration: time.Second * 10,
				AfterCast: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) {
					if spell == warlock.ShadowBolt || spell == warlock.Incinerate {
						aura.Deactivate(sim)
					}
				},
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					warlock.ShadowBolt.BonusCritRating += 10 * core.CritRatingPerCritChance
					warlock.Incinerate.BonusCritRating += 10 * core.CritRatingPerCritChance
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					warlock.ShadowBolt.BonusCritRating -= 10 * core.CritRatingPerCritChance
					warlock.Incinerate.BonusCritRating -= 10 * core.CritRatingPerCritChance
				},
			})

			warlock.RegisterAura(core.Aura{
				Label: "2pT7 Hidden Aura",

				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnPeriodicDamageDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
					if spell == warlock.Corruption || spell == warlock.Immolate {
						if sim.RandomFloat("2pT7") < 0.15 {
							DemonicSoulAura.Activate(sim)
							DemonicSoulAura.Refresh(sim)
						}
					}
				},
			})
		},
		4: func(agent core.Agent) {
			warlock := agent.(WarlockAgent).GetWarlock()

			SpiritsoftheDamnedAura := warlock.RegisterAura(core.Aura{
				Label:    "Spirits of the Damned",
				ActionID: core.ActionID{SpellID: 61082},
				Duration: time.Second * 10,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.AddStatDynamic(sim, stats.Spirit, 300)
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.AddStatDynamic(sim, stats.Spirit, -300)
				},
			})

			warlock.RegisterAura(core.Aura{
				Label:    "4pT7 Hidden Aura",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnCastComplete: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) {
					if spell == warlock.LifeTap {
						if SpiritsoftheDamnedAura.IsActive() {
							SpiritsoftheDamnedAura.Refresh(sim)
						} else {
							SpiritsoftheDamnedAura.Activate(sim)
						}
					}
				},
			})
		},
	},
})

T7

View Source
var P1Gear = items.EquipmentSpecFromJsonString(`
	{"items": [
        {
          "id": 40421,
          "enchant": 44877,
          "gems": [
            41285,
            40051
          ]
        },
        {
          "id": 44661,
          "gems": [
            40026
          ]
        },
        {
          "id": 40424,
          "enchant": 44874,
          "gems": [
            39998
          ]
        },
        {
          "id": 44005,
          "enchant": 55642,
          "gems": [
            40026
          ]
        },
        {
          "id": 40423,
          "enchant": 44623,
          "gems": [
            39998,
            40051
          ]
        },
        {
          "id": 44008,
          "enchant": 44498,
          "gems": [
            39998,
            0
          ]
        },
        {
          "id": 40420,
          "enchant": 54999,
          "gems": [
            39998,
            0
          ]
        },
        {
          "id": 40561,
          "gems": [
            39998
          ]
        },
        {
          "id": 40560,
          "enchant": 41602
        },
        {
          "id": 40558,
          "enchant": 55016
        },
        {
          "id": 40399
        },
        {
          "id": 40719
        },
        {
          "id": 40432
        },
        {
          "id": 40255
        },
        {
          "id": 40396,
          "enchant": 44487
        },
        {
          "id": 39766
        },
        {
          "id": 39712
        }
      ]
	}
`)
View Source
var PetConfigs = map[proto.Warlock_Options_Summon]PetConfig{
	proto.Warlock_Options_Felguard: {
		Name:             "Felguard",
		Melee:            true,
		PrimaryAbility:   Cleave,
		SecondaryAbility: Intercept,
		PowerModifier:    0.77,
		Stats: stats.Stats{
			stats.Strength:  314,
			stats.Agility:   90,
			stats.Stamina:   328,
			stats.Intellect: 150,
			stats.Spirit:    209,
			stats.Mana:      1559,
			stats.MeleeCrit: 3.2685 * core.CritRatingPerCritChance,
			stats.SpellCrit: 3.3355 * core.CritRatingPerCritChance,
		},
	},
	proto.Warlock_Options_Imp: {
		Name:           "Imp",
		PowerModifier:  0.33,
		Melee:          false,
		PrimaryAbility: Firebolt,
		Stats: stats.Stats{
			stats.Strength:  297,
			stats.Agility:   79,
			stats.Stamina:   118,
			stats.Intellect: 369,
			stats.Spirit:    367,
			stats.Mana:      1174,
			stats.MeleeCrit: 3.454 * core.CritRatingPerCritChance,
			stats.SpellCrit: 0.9075 * core.CritRatingPerCritChance,
		},
	},
	proto.Warlock_Options_Succubus: {
		Name:           "Succubus",
		PowerModifier:  0.77,
		Melee:          true,
		PrimaryAbility: LashOfPain,
		Stats: stats.Stats{
			stats.Strength:  314,
			stats.Agility:   90,
			stats.Stamina:   328,
			stats.Intellect: 150,
			stats.Spirit:    209,
			stats.Mana:      1559,
			stats.MeleeCrit: 3.2685 * core.CritRatingPerCritChance,
			stats.SpellCrit: 3.3355 * core.CritRatingPerCritChance,
		},
	},
	proto.Warlock_Options_Felhunter: {
		Name:           "Felhunter",
		PowerModifier:  0.77,
		Melee:          true,
		PrimaryAbility: ShadowBite,
		Stats: stats.Stats{
			stats.Strength:  314,
			stats.Agility:   90,
			stats.Stamina:   328,
			stats.Intellect: 150,
			stats.Spirit:    209,
			stats.Mana:      1559,
			stats.MeleeCrit: 3.2685 * core.CritRatingPerCritChance,
			stats.SpellCrit: 3.3355 * core.CritRatingPerCritChance,
		},
	},
}
View Source
var Phase4Gear = items.EquipmentSpecFromJsonString(`{"items": [
	{
		"id": 31051,
		"enchant": 29191,
		"gems": [
		34220,
		32218
		]
	},
	{
		"id": 33281
	},
	{
		"id": 31054,
		"enchant": 28886,
		"gems": [
		32215,
		32218
		]
	},
	{
		"id": 32524,
		"enchant": 33150
	},
	{
		"id": 30107,
		"enchant": 24003,
		"gems": [
		32196,
		32196,
		32196
		]
	},
	{
		"id": 32586,
		"enchant": 22534
	},
	{
		"id": 31050,
		"enchant": 28272,
		"gems": [
		32196
		]
	},
	{
		"id": 30888,
		"gems": [
		32196,
		32196
		]
	},
	{
		"id": 31053,
		"enchant": 24274,
		"gems": [
		32196
		]
	},
	{
		"id": 32239,
		"enchant": 35297,
		"gems": [
		32218,
		32215
		]
	},
	{
		"id": 32527,
		"enchant": 22536
	},
	{
		"id": 33497,
		"enchant": 22536
	},
	{
		"id": 32483
	},
	{
		"id": 33829
	},
	{
		"id": 32374,
		"enchant": 22561
	},
	{},
	{
		"id": 33192,
		"gems": [
		32215
		]
	}
]}`)

Functions

func RegisterWarlock

func RegisterWarlock()

Types

type CastReadyness

type CastReadyness func(*core.Simulation) time.Duration

type PetAbilityType

type PetAbilityType byte
const (
	Unknown PetAbilityType = iota
	Cleave
	Intercept
	LashOfPain
	ShadowBite
	Firebolt
)

type PetConfig

type PetConfig struct {
	Name string
	// DamageMultiplier float64
	Melee         bool
	Stats         stats.Stats
	PowerModifier float64

	// Randomly select between abilities instead of using a prio.
	RandomSelection bool

	PrimaryAbility   PetAbilityType
	SecondaryAbility PetAbilityType
}

type SpellRotation

type SpellRotation struct {
	Spell    *core.Spell
	CastIn   CastReadyness
	Priority int
}

type Warlock

type Warlock struct {
	core.Character
	Talents  *proto.WarlockTalents
	Options  *proto.Warlock_Options
	Rotation *proto.Warlock_Rotation

	Pet *WarlockPet

	ShadowBolt            *core.Spell
	Incinerate            *core.Spell
	Immolate              *core.Spell
	ImmolateDot           *core.Dot
	UnstableAffliction    *core.Spell
	UnstableAfflictionDot *core.Dot
	Corruption            *core.Spell
	CorruptionDot         *core.Dot
	Haunt                 *core.Spell
	LifeTap               *core.Spell
	DarkPact              *core.Spell
	ChaosBolt             *core.Spell
	SoulFire              *core.Spell
	Conflagrate           *core.Spell
	ConflagrateDot        *core.Dot
	DrainSoul             *core.Spell
	DrainSoulDot          *core.Dot
	DrainSoulChannelling  *core.Spell
	Shadowburn            *core.Spell

	CurseOfElements     *core.Spell
	CurseOfElementsAura *core.Aura
	CurseOfWeakness     *core.Spell
	CurseOfWeaknessAura *core.Aura
	CurseOfTongues      *core.Spell
	CurseOfTonguesAura  *core.Aura
	CurseOfAgony        *core.Spell
	CurseOfAgonyDot     *core.Dot
	CurseOfDoom         *core.Spell
	CurseOfDoomDot      *core.Dot
	Seeds               []*core.Spell
	SeedDots            []*core.Dot

	NightfallProcAura      *core.Aura
	EradicationAura        *core.Aura
	DemonicEmpowerment     *core.Spell
	DemonicEmpowermentAura *core.Aura
	Metamorphosis          *core.Spell
	MetamorphosisAura      *core.Aura
	ImmolationAura         *core.Spell
	ImmolationAuraDot      *core.Dot
	MoltenCoreAura         *core.Aura
	DecimationAura         *core.Aura
	PyroclasmAura          *core.Aura
	BackdraftAura          *core.Aura
	EmpoweredImpAura       *core.Aura
	GlyphOfLifeTapAura     *core.Aura

	// Rotation related memory
	CorruptionRolloverPower float64
	DPSPAverage             float64
	PreviousTime            time.Duration
	SpellsRotation          []SpellRotation
}

func NewWarlock

func NewWarlock(character core.Character, options *proto.Player) *Warlock

func (*Warlock) AddPartyBuffs

func (warlock *Warlock) AddPartyBuffs(partyBuffs *proto.PartyBuffs)

func (*Warlock) AddRaidBuffs

func (warlock *Warlock) AddRaidBuffs(raidBuffs *proto.RaidBuffs)

func (*Warlock) ApplyTalents

func (warlock *Warlock) ApplyTalents()

func (*Warlock) GetCharacter

func (warlock *Warlock) GetCharacter() *core.Character

func (*Warlock) GetWarlock

func (warlock *Warlock) GetWarlock() *Warlock

func (*Warlock) HasMajorGlyph

func (warlock *Warlock) HasMajorGlyph(glyph proto.WarlockMajorGlyph) bool

func (*Warlock) HasMinorGlyph

func (warlock *Warlock) HasMinorGlyph(glyph proto.WarlockMinorGlyph) bool

func (*Warlock) HauntDebuffAura

func (warlock *Warlock) HauntDebuffAura(target *core.Unit) *core.Aura

func (*Warlock) Initialize

func (warlock *Warlock) Initialize()

func (*Warlock) LifeTapOrDarkPact

func (warlock *Warlock) LifeTapOrDarkPact(sim *core.Simulation)

Regen Spells: Casts the regen spell that will give you the most mana, includes a error whenever we cast pact on full mana.

func (*Warlock) NewWarlockPet

func (warlock *Warlock) NewWarlockPet() *WarlockPet

func (*Warlock) OnGCDReady

func (warlock *Warlock) OnGCDReady(sim *core.Simulation)

This function is an intermediary, it is used when sim has a GCD ready, not much to see here.

func (*Warlock) Reset

func (warlock *Warlock) Reset(sim *core.Simulation)

func (*Warlock) ShadowEmbraceDebuffAura

func (warlock *Warlock) ShadowEmbraceDebuffAura(target *core.Unit) *core.Aura

func (*Warlock) ShouldCastCurseOfElements

func (warlock *Warlock) ShouldCastCurseOfElements(sim *core.Simulation, target *core.Unit, curse proto.Warlock_Rotation_Curse) bool

type WarlockAgent

type WarlockAgent interface {
	GetWarlock() *Warlock
}

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

type WarlockPet

type WarlockPet struct {
	core.Pet

	DemonicEmpowermentAura *core.Aura
	// contains filtered or unexported fields
}

func (*WarlockPet) GetPet

func (wp *WarlockPet) GetPet() *core.Pet

func (*WarlockPet) Initialize

func (wp *WarlockPet) Initialize()

func (*WarlockPet) NewPetAbility

func (wp *WarlockPet) NewPetAbility(abilityType PetAbilityType, isPrimary bool) *core.Spell

func (*WarlockPet) OnGCDReady

func (wp *WarlockPet) OnGCDReady(sim *core.Simulation)

func (*WarlockPet) Reset

func (wp *WarlockPet) Reset(sim *core.Simulation)

func (*WarlockPet) TryCast

func (wp *WarlockPet) TryCast(sim *core.Simulation, target *core.Unit, spell *core.Spell) bool

Returns whether the ability was successfully cast.

Jump to

Keyboard shortcuts

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