Skip to content

Commit

Permalink
Merge pull request #803 from zoristaken/implement-p2-p3-procs
Browse files Browse the repository at this point in the history
Implement t12 procs
  • Loading branch information
rosenrusinov authored Jul 19, 2024
2 parents 16589cd + 7127f46 commit 857ba5c
Show file tree
Hide file tree
Showing 28 changed files with 4,245 additions and 3 deletions.
93 changes: 93 additions & 0 deletions sim/common/cata/damage_procs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cata

import (
"time"

"github.com/wowsims/cata/sim/common/shared"
"github.com/wowsims/cata/sim/core"
)
Expand Down Expand Up @@ -39,4 +41,95 @@ func init() {
Callback: core.CallbackOnSpellHitDealt,
},
})

core.NewItemEffect(68925, func(agent core.Agent) {
character := agent.GetCharacter()
procChance := 0.3 //TODO: placeholder, get real proc chance
dummyAura := character.GetOrRegisterAura(core.Aura{
Label: "Electrical Charge",
ActionID: core.ActionID{SpellID: 96890},
Duration: core.NeverExpires,
MaxStacks: 10,
})

lightningSpell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 96891},
SpellSchool: core.SpellSchoolNature,
ProcMask: core.ProcMaskEmpty,
Flags: core.SpellFlagNoOnDamageDealt,
DamageMultiplier: 1,
CritMultiplier: character.DefaultSpellCritMultiplier(),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := sim.Roll(985, 1266) * float64(dummyAura.GetStacks())
spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit)
},
})

core.MakePermanent(core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Electrical Charge Aura",
ActionID: core.ActionID{ItemID: 68925},
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskSpellOrProc,
ProcChance: 1,
Outcome: core.OutcomeCrit,
ICD: time.Millisecond * 2500,
Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
dummyAura.Activate(sim)
dummyAura.AddStack(sim)

if sim.Proc(procChance, "Variable Pulse Lightning Capacitor") {
lightningSpell.Cast(sim, result.Target)
dummyAura.SetStacks(sim, 0)
}
},
}))
})

core.NewItemEffect(69110, func(agent core.Agent) {
character := agent.GetCharacter()
procChance := 0.3 //TODO: placeholder, get real proc chance
dummyAura := character.GetOrRegisterAura(core.Aura{
Label: "Electrical Charge",
ActionID: core.ActionID{SpellID: 96890},
Duration: core.NeverExpires,
MaxStacks: 10,
})

lightningSpell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 96891},
SpellSchool: core.SpellSchoolNature,
ProcMask: core.ProcMaskEmpty,
Flags: core.SpellFlagNoOnDamageDealt,
DamageMultiplier: 1,
CritMultiplier: character.DefaultSpellCritMultiplier(),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := sim.Roll(2889, 3713) * float64(dummyAura.GetStacks())
spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit)
},
})

core.MakePermanent(core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Electrical Charge Aura",
ActionID: core.ActionID{ItemID: 69110},
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskSpellOrProc,
ProcChance: 1,
Outcome: core.OutcomeCrit,
ICD: time.Millisecond * 2500,
Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
dummyAura.Activate(sim)
dummyAura.AddStack(sim)

if sim.Proc(procChance, "Variable Pulse Lightning Capacitor Heroic") {
lightningSpell.Cast(sim, result.Target)
dummyAura.SetStacks(sim, 0)
}
},
}))
})

}
236 changes: 236 additions & 0 deletions sim/common/cata/other_effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,4 +524,240 @@ func init() {
Type: core.CooldownTypeMana,
})
})

core.NewItemEffect(68972, func(agent core.Agent) {
character := agent.GetCharacter()

dummyAura := character.RegisterAura(core.Aura{
Label: "Titanic Power",
ActionID: core.ActionID{SpellID: 96923},
Duration: time.Second * 30,
MaxStacks: 5,
})

core.MakePermanent(core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Titanic Power Aura",
ActionID: core.ActionID{ItemID: 68972},
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskMelee,
ProcChance: 1,
Outcome: core.OutcomeCrit,
Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
dummyAura.Activate(sim)
dummyAura.AddStack(sim)
},
}))

statBonus := float64(508 * dummyAura.MaxStacks)
buffAuraCrit := character.NewTemporaryStatsAura("Blessing of the Shaper Crit", core.ActionID{SpellID: 96928}, stats.Stats{stats.MeleeCrit: statBonus, stats.SpellCrit: statBonus}, time.Second*15)
buffAuraHaste := character.NewTemporaryStatsAura("Blessing of the Shaper Haste", core.ActionID{SpellID: 96927}, stats.Stats{stats.MeleeHaste: statBonus, stats.SpellHaste: statBonus}, time.Second*15)
buffAuraMastery := character.NewTemporaryStatsAura("Blessing of the Shaper Mastery", core.ActionID{SpellID: 96929}, stats.Stats{stats.Mastery: statBonus}, time.Second*15)

sharedCD := character.GetOffensiveTrinketCD()
trinketSpell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{ItemID: 68972},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskEmpty,
Flags: core.SpellFlagNoOnCastComplete,
Cast: core.CastConfig{
SharedCD: core.Cooldown{
Timer: sharedCD,
Duration: time.Second * 15,
},
CD: core.Cooldown{
Timer: character.NewTimer(),
Duration: time.Minute * 2,
},
},

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
statType := character.GetHighestStat([]stats.Stat{stats.MeleeCrit, stats.SpellCrit, stats.MeleeHaste, stats.SpellHaste, stats.Mastery})
switch statType {
case stats.MeleeCrit, stats.SpellCrit:
buffAuraCrit.Activate(sim)
case stats.MeleeHaste, stats.SpellHaste:
buffAuraHaste.Activate(sim)
case stats.Mastery:
buffAuraMastery.Activate(sim)
default:
panic("unexpected statType")
}
dummyAura.Deactivate(sim)
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return dummyAura.GetStacks() == 5
},
})

character.AddMajorCooldown(core.MajorCooldown{
Spell: trinketSpell,
Priority: core.CooldownPriorityDefault,
Type: core.CooldownTypeDPS,
ShouldActivate: func(s *core.Simulation, c *core.Character) bool {
return dummyAura.GetStacks() == 5
},
})
})

core.NewItemEffect(69113, func(agent core.Agent) {
character := agent.GetCharacter()

dummyAura := character.RegisterAura(core.Aura{
Label: "Titanic Power (Heroic)",
ActionID: core.ActionID{SpellID: 96923},
Duration: time.Second * 30,
MaxStacks: 5,
})

core.MakePermanent(core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Titanic Power Aura (Heroic)",
ActionID: core.ActionID{ItemID: 69113},
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskMelee,
ProcChance: 1,
Outcome: core.OutcomeCrit,
Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
dummyAura.Activate(sim)
dummyAura.AddStack(sim)
},
}))

// TODO: discuss the following scenario:
// the trinket should allow to activate at any number of stacks, should we allow this behaviour at all to the users?
// would also mean that we need the temporary aura to be created on the fly after an environment is finalized
statBonus := float64(575 * dummyAura.MaxStacks)
buffAuraCrit := character.NewTemporaryStatsAura("Blessing of the Shaper Crit (Heroic)", core.ActionID{SpellID: 96928}, stats.Stats{stats.MeleeCrit: statBonus, stats.SpellCrit: statBonus}, time.Second*15)
buffAuraHaste := character.NewTemporaryStatsAura("Blessing of the Shaper Haste (Heroic)", core.ActionID{SpellID: 96927}, stats.Stats{stats.MeleeHaste: statBonus, stats.SpellHaste: statBonus}, time.Second*15)
buffAuraMastery := character.NewTemporaryStatsAura("Blessing of the Shaper Mastery (Heroic)", core.ActionID{SpellID: 96929}, stats.Stats{stats.Mastery: statBonus}, time.Second*15)

sharedCD := character.GetOffensiveTrinketCD()
trinketSpell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{ItemID: 69113},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskEmpty,
Flags: core.SpellFlagNoOnCastComplete,
Cast: core.CastConfig{
SharedCD: core.Cooldown{
Timer: sharedCD,
Duration: time.Second * 15,
},
CD: core.Cooldown{
Timer: character.NewTimer(),
Duration: time.Minute * 2,
},
},
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
statType := character.GetHighestStat([]stats.Stat{stats.MeleeCrit, stats.SpellCrit, stats.MeleeHaste, stats.SpellHaste, stats.Mastery})
switch statType {
case stats.MeleeCrit, stats.SpellCrit:
buffAuraCrit.Activate(sim)
case stats.MeleeHaste, stats.SpellHaste:
buffAuraHaste.Activate(sim)
case stats.Mastery:
buffAuraMastery.Activate(sim)
default:
panic("unexpected statType")
}
dummyAura.Deactivate(sim)
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return dummyAura.GetStacks() == 5
},
})

character.AddMajorCooldown(core.MajorCooldown{
Spell: trinketSpell,
Priority: core.CooldownPriorityDefault,
Type: core.CooldownTypeDPS,
ShouldActivate: func(s *core.Simulation, c *core.Character) bool {
return dummyAura.GetStacks() == 5
},
})
})

core.NewItemEffect(68994, func(agent core.Agent) {
character := agent.GetCharacter()

bonusStats := 1624.0
procAuraCrit := character.NewTemporaryStatsAura("Matrix Restabilizer Crit Proc", core.ActionID{SpellID: 96978}, stats.Stats{stats.MeleeCrit: bonusStats, stats.SpellCrit: bonusStats}, time.Second*30)
procAuraHaste := character.NewTemporaryStatsAura("Matrix Restabilizer Haste Proc", core.ActionID{SpellID: 96977}, stats.Stats{stats.MeleeHaste: bonusStats, stats.SpellHaste: bonusStats}, time.Second*30)
procAuraMastery := character.NewTemporaryStatsAura("Matrix Restabilizer Mastery Proc", core.ActionID{SpellID: 96979}, stats.Stats{stats.Mastery: bonusStats}, time.Second*30)

icd := core.Cooldown{
Timer: character.NewTimer(),
Duration: time.Second * 105,
}

procAuraCrit.Icd = &icd
procAuraHaste.Icd = &icd
procAuraMastery.Icd = &icd

core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Matrix Restabilizer Trigger",
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskMeleeOrRanged,
ProcChance: 0.2,
ActionID: core.ActionID{ItemID: 68994},
Harmful: true,
Handler: func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) {
if icd.IsReady(sim) {
statType := character.GetHighestStat([]stats.Stat{stats.MeleeCrit, stats.SpellCrit, stats.MeleeHaste, stats.SpellHaste, stats.Mastery})
switch statType {
case stats.MeleeCrit, stats.SpellCrit:
procAuraCrit.Activate(sim)
case stats.MeleeHaste, stats.SpellHaste:
procAuraHaste.Activate(sim)
case stats.Mastery:
procAuraMastery.Activate(sim)
default:
panic("unexpected statType")
}
icd.Use(sim)
}
},
})
})

core.NewItemEffect(69150, func(agent core.Agent) {
character := agent.GetCharacter()

bonusStats := 1834.0
procAuraCrit := character.NewTemporaryStatsAura("Matrix Restabilizer Crit Proc (Heroic)", core.ActionID{SpellID: 97140}, stats.Stats{stats.MeleeCrit: bonusStats, stats.SpellCrit: bonusStats}, time.Second*30)
procAuraHaste := character.NewTemporaryStatsAura("Matrix Restabilizer Haste Proc (Heroic)", core.ActionID{SpellID: 97139}, stats.Stats{stats.MeleeHaste: bonusStats, stats.SpellHaste: bonusStats}, time.Second*30)
procAuraMastery := character.NewTemporaryStatsAura("Matrix Restabilizer Mastery Proc (Heroic)", core.ActionID{SpellID: 97141}, stats.Stats{stats.Mastery: bonusStats}, time.Second*30)

icd := core.Cooldown{
Timer: character.NewTimer(),
Duration: time.Second * 105,
}

procAuraCrit.Icd = &icd
procAuraHaste.Icd = &icd
procAuraMastery.Icd = &icd

core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Matrix Restabilizer Trigger (Heroic)",
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskMeleeOrRanged,
ProcChance: 0.2,
ActionID: core.ActionID{ItemID: 69150},
Harmful: true,
Handler: func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) {
if icd.IsReady(sim) {
statType := character.GetHighestStat([]stats.Stat{stats.MeleeCrit, stats.SpellCrit, stats.MeleeHaste, stats.SpellHaste, stats.Mastery})
switch statType {
case stats.MeleeCrit, stats.SpellCrit:
procAuraCrit.Activate(sim)
case stats.MeleeHaste, stats.SpellHaste:
procAuraHaste.Activate(sim)
case stats.Mastery:
procAuraMastery.Activate(sim)
default:
panic("unexpected statType")
}
icd.Use(sim)
}
},
})
})
}
13 changes: 10 additions & 3 deletions sim/common/cata/stat_bonus_cds.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ func init() {
shared.NewHasteActive(60233, 1935, time.Second*10, time.Minute*1) // Shard of Woe

// CRIT
shared.NewCritActive(66879, 512, time.Second*20, time.Minute*2) // Bottled Lightning
shared.NewCritActive(61448, 970, time.Second*20, time.Minute*2) // Oremantle's Favor
shared.NewCritActive(66879, 512, time.Second*20, time.Minute*2) // Bottled Lightning
shared.NewCritActive(61448, 970, time.Second*20, time.Minute*2) // Oremantle's Favor
shared.NewCritActive(70144, 1700, time.Second*20, time.Minute*2) // Ricket's Magnetic Fireball

// STRENGTH
shared.NewStrengthActive(59685, 830, time.Second*10, time.Minute) // Kvaldir Battle Standard - Alliance
Expand All @@ -29,6 +30,7 @@ func init() {
shared.NewStrengthActive(62464, 1605, time.Second*20, time.Minute*2) // Impatience of Youth (Alliance)
shared.NewStrengthActive(62469, 1605, time.Second*20, time.Minute*2) // Impatience of Youth (Horde)
shared.NewStrengthActive(61034, 1605, time.Second*20, time.Minute*2) // Vicious Gladiator's Badge of Victory
shared.NewStrengthActive(69002, 1277, time.Second*15, time.Minute) // Essence of the Eternal Flame

// AGILITY
shared.NewAgilityActive(63840, 1095, time.Second*15, time.Second*90) // Juju of Nimbleness
Expand All @@ -39,6 +41,7 @@ func init() {
shared.NewAgilityActive(62463, 1605, time.Second*20, time.Minute*2) // Unsolvable Riddle (Horde)
shared.NewAgilityActive(68709, 1605, time.Second*20, time.Minute*2) // Unsolvable Riddle (No Faction)
shared.NewAgilityActive(61033, 1605, time.Second*20, time.Minute*2) // Vicious Gladiator's Badge of Conquest
shared.NewAgilityActive(69001, 1277, time.Second*15, time.Minute) // Ancient Petrified Seed

// SPIRIT
shared.NewSpiritActive(67101, 555, time.Second*20, time.Minute*2) // Unquenchable Flame
Expand All @@ -50,6 +53,8 @@ func init() {
shared.NewDodgeActive(52352, 1425, time.Second*20, time.Minute*2) // Figurine - Earthen Guardian
shared.NewDodgeActive(59515, 1605, time.Second*20, time.Minute*2) // Vial of Stolen Memories
shared.NewDodgeActive(65109, 1812, time.Second*20, time.Minute*2) // Vial of Stolen Memories (Heroic)
shared.NewDodgeActive(70143, 1700, time.Second*20, time.Minute*2) // Moonwell Phial
shared.NewDodgeActive(71338, 1700, time.Second*20, time.Minute*2) // Brawler's Trophy

// SpellPower
shared.NewSpellPowerActive(61429, 970, time.Second*15, time.Second*90) // Insignia of the Earthen Lord
Expand All @@ -76,7 +81,9 @@ func init() {
shared.NewHealthActive(61027, 16196, time.Second*15, time.Minute*2) // Vicious Gladiator's Emblem of Accuracy

// INT
shared.NewIntActive(67118, 567, time.Second*20, time.Minute*2) // Electrospark Heartstarter
shared.NewIntActive(67118, 567, time.Second*20, time.Minute*2) // Electrospark Heartstarter
shared.NewIntActive(68998, 1277, time.Second*15, time.Minute) // Rune of Zeth
shared.NewIntActive(69000, 1149, time.Second*25, time.Second*90) // Fiery Quintessence

// MASTERY
shared.NewMasteryActive(63745, 1095, time.Second*15, time.Second*90) // Za'brox's Lucky Tooth - Alliance
Expand Down
Loading

0 comments on commit 857ba5c

Please sign in to comment.