forked from wowsims/mop
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathenchants.go
More file actions
192 lines (167 loc) · 6.52 KB
/
enchants.go
File metadata and controls
192 lines (167 loc) · 6.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
package tbc
import (
"time"
"github.com/wowsims/tbc/sim/core"
"github.com/wowsims/tbc/sim/core/proto"
"github.com/wowsims/tbc/sim/core/stats"
)
func init() {
// Mongoose
// EffectID: 2673, Proc SpellID: 28093
// PPM: 1, ICD: 0
// Permanently enchant a Melee Weapon to occasionally increase Agility by 120 and attack speed slightly (2%).
core.NewEnchantEffect(2673, func(agent core.Agent) {
character := agent.GetCharacter()
duration := time.Second * 15
createMongooseAuras := func(tag int32) *core.StatBuffAura {
labelSuffix := core.Ternary(tag == 1, " (MH)", " (OH)")
slot := core.Ternary(tag == 1, proto.ItemSlot_ItemSlotMainHand, proto.ItemSlot_ItemSlotOffHand)
aura := character.NewTemporaryStatsAuraWrapped(
"Lightning Speed"+labelSuffix,
core.ActionID{SpellID: 28093}.WithTag(tag),
stats.Stats{stats.Agility: 120},
duration,
func(aura *core.Aura) {
aura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) {
character.MultiplyAttackSpeed(sim, 1.02)
})
aura.ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) {
character.MultiplyAttackSpeed(sim, 1/1.02)
})
},
)
character.AddStatProcBuff(2673, aura, true, []proto.ItemSlot{slot})
character.ItemSwap.RegisterWeaponEnchantBuff(aura.Aura, 2673)
return aura
}
mhAuras := createMongooseAuras(1)
ohAuras := createMongooseAuras(2)
character.MakeProcTriggerAura(core.ProcTrigger{
Name: "Enchant Weapon - Mongoose",
Callback: core.CallbackOnSpellHitDealt,
ActionID: core.ActionID{SpellID: 28093},
DPM: character.NewDynamicLegacyProcForEnchant(2673, 1.0, 0),
Outcome: core.OutcomeLanded,
Handler: func(sim *core.Simulation, spell *core.Spell, _ *core.SpellResult) {
core.Ternary(spell.IsOH(), ohAuras, mhAuras).Activate(sim)
},
})
})
// Executioner
// EffectID: 3225, Proc SpellID: 42976
// PPM: ?, ICD: 0
// Permanently enchant a Melee Weapon to occasionally ignore 840 of your enemy's armor. Requires a level 60 or higher item.
core.NewEnchantEffect(3225, func(agent core.Agent) {
character := agent.GetCharacter()
duration := time.Second * 15
aura := character.NewTemporaryStatsAura(
"Executioner",
core.ActionID{SpellID: 42976},
stats.Stats{stats.ArmorPenetration: 840},
duration,
)
character.AddStatProcBuff(3225, aura, true, core.AllMeleeWeaponSlots())
character.ItemSwap.RegisterWeaponEnchantBuff(aura.Aura, 3225)
character.MakeProcTriggerAura(core.ProcTrigger{
Name: "Enchant Weapon - Executioner",
Callback: core.CallbackOnSpellHitDealt,
ActionID: core.ActionID{SpellID: 28093},
DPM: character.NewDynamicLegacyProcForEnchant(3225, 1.0, 0),
Outcome: core.OutcomeLanded,
Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
aura.Activate(sim)
},
})
})
// Deathfrost
// EffectID: 3273, Proc SpellID: 46579, Damage SpellID: 46579, Debuff SpellID: 46629
// Proc Chance: 50%, ICD: 25s
// Permanently enchant a weapon so your damaging spells and melee weapon hits occasionally inflict an additional 150 Frost damage
// and reduce the target's melee, ranged, and casting speed by 15% for 8 sec. Requires a level 60 or higher item.
core.NewEnchantEffect(3273, func(agent core.Agent) {
character := agent.GetCharacter()
duration := time.Second * 8
effect := 0.85
debuffArray := character.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
return target.GetOrRegisterAura(core.Aura{
Label: "Deathfrost",
Duration: duration,
ActionID: core.ActionID{SpellID: 46629},
OnGain: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.MultiplyAttackSpeed(sim, effect)
aura.Unit.MultiplyRangedSpeed(sim, effect)
aura.Unit.MultiplyCastSpeed(sim, effect)
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.MultiplyAttackSpeed(sim, 1/effect)
aura.Unit.MultiplyRangedSpeed(sim, 1/effect)
aura.Unit.MultiplyCastSpeed(sim, 1/effect)
},
})
})
dfSpell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 46579},
SpellSchool: core.SpellSchoolFrost,
Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagPassiveSpell,
ProcMask: core.ProcMaskSpellProc,
DamageMultiplier: 1,
CritMultiplier: character.DefaultSpellCritMultiplier(),
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
spell.CalcAndDealDamage(sim, target, 150, spell.OutcomeMagicCrit)
},
})
character.MakeProcTriggerAura(core.ProcTrigger{
Name: "Enchant Weapon - Deathfrost",
Callback: core.CallbackOnSpellHitDealt,
ActionID: core.ActionID{SpellID: 46579},
DPM: character.NewFixedProcChanceManager(0.5, core.ProcMaskMeleeOrMeleeProc|core.ProcMaskSpellOrSpellProc),
Outcome: core.OutcomeLanded,
ICD: time.Second * 25,
Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
debuffArray.Get(result.Target).Activate(sim)
dfSpell.Cast(sim, result.Target)
},
})
})
// Savage Guard - +10 Nature Resistance (item 22635)
core.NewEnchantEffect(2681, func(agent core.Agent) {
agent.GetCharacter().AddStat(stats.NatureResistance, 10)
})
// Ice Guard - +10 Frost Resistance (item 22636)
core.NewEnchantEffect(2682, func(agent core.Agent) {
agent.GetCharacter().AddStat(stats.FrostResistance, 10)
})
// Scopes
core.NewEnchantEffect(2523, func(agent core.Agent) {
character := agent.GetCharacter()
character.AddStat(stats.RangedHitPercent, 30.0/core.PhysicalHitRatingPerHitPercent)
})
core.NewEnchantEffect(2722, func(agent core.Agent) {
character := agent.GetCharacter()
ranged := character.AutoAttacks.Ranged()
ranged.BaseDamageMin += 10
ranged.BaseDamageMax += 10
})
core.NewEnchantEffect(2723, func(agent core.Agent) {
character := agent.GetCharacter()
ranged := character.AutoAttacks.Ranged()
ranged.BaseDamageMin += 12
ranged.BaseDamageMax += 12
})
core.NewEnchantEffect(2724, func(agent core.Agent) {
character := agent.GetCharacter()
character.AddStat(stats.RangedCritPercent, 28.0/core.PhysicalCritRatingPerCritPercent)
})
movementSpeedEnchants := []int32{
2939, // Enchant Boots - Cat's Swiftness
2940, // Enchant Boots - Boar's Speed
}
for _, enchantID := range movementSpeedEnchants {
core.NewEnchantEffect(enchantID, func(agent core.Agent) {
character := agent.GetCharacter()
aura := character.NewPassiveMovementSpeedAura("Minor Run Speed", core.ActionID{SpellID: 13889}, 0.08)
character.ItemSwap.RegisterEnchantProc(enchantID, aura)
})
}
}