Skip to content

Commit

Permalink
Merge pull request #1253 from wowsims/feature/add-trinket-swapping
Browse files Browse the repository at this point in the history
[UI][CORE] Add ability to item swap all gear
  • Loading branch information
1337LutZ authored Jan 16, 2025
2 parents 62bd44c + 0c9ae89 commit c67de86
Show file tree
Hide file tree
Showing 219 changed files with 8,155 additions and 7,933 deletions.
8 changes: 5 additions & 3 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1037,9 +1037,11 @@ message CustomSpell {
}

message ItemSwap {
ItemSpec mh_item = 1;
ItemSpec oh_item = 2;
ItemSpec ranged_item = 3;
ItemSpec mh_item = 1 [deprecated=true];
ItemSpec oh_item = 2 [deprecated=true];
ItemSpec ranged_item = 3 [deprecated=true];
repeated ItemSpec items = 4;
UnitStats prepull_bonus_stats = 5;
}

message Duration {
Expand Down
10 changes: 4 additions & 6 deletions proto/shaman.proto
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,15 @@ message ShamanTotems {
FireTotem fire = 10;
WaterTotem water = 11;

// If set, will use fire elemental totem at the start and revert to regular
// fire totems when it expires.
bool use_fire_elemental = 12;
bool use_fire_elemental = 12 [deprecated=true];

// Bonus spell power for fire elemental snapshotting.
int32 bonus_spellpower = 13;
int32 bonus_spellpower = 13 [deprecated=true]; // No longer used in favor of Item Swapping
// Bonus intellect for fire elemental snapshotting.
int32 bonus_intellect = 15;
int32 bonus_intellect = 15 [deprecated=true]; // No longer used in favor of Item Swapping

// Snapshot fire elemental using Tier 10 4 set bonus.
bool enh_tier_ten_bonus = 14;
bool enh_tier_ten_bonus = 14 [deprecated=true]; // No longer used in favor of Item Swapping
}

enum ShamanShield {
Expand Down
5 changes: 3 additions & 2 deletions proto/warlock.proto
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ message WarlockOptions {

Summon summon = 1;
bool detonate_seed = 2;
int32 prepull_mastery = 3;
int32 prepull_post_snapshot_mana = 4;
int32 prepull_mastery = 3 [deprecated=true]; // Use Item Swap sets instead
int32 prepull_post_snapshot_mana = 4 [deprecated=true]; // Use Item Swap sets instead
bool use_item_swap_bonus_stats = 5;
}

message AfflictionWarlock {
Expand Down
3 changes: 2 additions & 1 deletion proto/warrior.proto
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ message FuryWarrior {
WarriorOptions class_options = 1;
bool stance_snapshot = 2;
WarriorSyncType sync_type = 3;
int32 prepull_mastery = 4;
int32 prepull_mastery = 4 [deprecated=true]; // Use Item Swap sets instead
bool use_item_swap_bonus_stats = 5;
}
Options options = 1;
}
Expand Down
10 changes: 7 additions & 3 deletions sim/common/cata/damage_procs.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func init() {
School: core.SpellSchoolNature,
MinDmg: 5250,
MaxDmg: 8750,
Outcome: shared.OutcomeMeleeNoBlockDodgeParryCrit,
Flags: core.SpellFlagNoSpellMods | core.SpellFlagIgnoreModifiers | core.SpellFlagNoOnDamageDealt,
Outcome: shared.OutcomeMeleeNoBlockDodgeParryCrit,
Trigger: core.ProcTrigger{
Name: "Darkmoon Card: Hurricane",
ProcMask: core.ProcMaskMeleeOrRanged,
Expand Down Expand Up @@ -74,7 +74,7 @@ func init() {
},
})

core.MakePermanent(core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
aura := core.MakePermanent(core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Electrical Charge Aura",
ActionID: core.ActionID{ItemID: 68925},
Callback: core.CallbackOnSpellHitDealt | core.CallbackOnPeriodicDamageDealt,
Expand All @@ -92,6 +92,8 @@ func init() {
}
},
}))

character.ItemSwap.RegisterProc(68925, aura)
})

core.NewItemEffect(69110, func(agent core.Agent) {
Expand Down Expand Up @@ -124,7 +126,7 @@ func init() {
},
})

core.MakePermanent(core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
aura := core.MakePermanent(core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Electrical Charge Aura",
ActionID: core.ActionID{ItemID: 69110},
Callback: core.CallbackOnSpellHitDealt | core.CallbackOnPeriodicDamageDealt,
Expand All @@ -142,6 +144,8 @@ func init() {
}
},
}))

character.ItemSwap.RegisterProc(69110, aura)
})

}
12 changes: 10 additions & 2 deletions sim/common/cata/dragonwrath.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ func GetDRTSpellConfig(spell *core.Spell) core.SpellConfig {

func init() {
core.NewItemEffect(71086, func(a core.Agent) {
unit := &a.GetCharacter().Unit
character := a.GetCharacter()
unit := &character.Unit
registerSpells(unit)

unit.OnSpellRegistered(func(spell *core.Spell) {
Expand All @@ -209,13 +210,18 @@ func init() {

lastTimestamp := time.Duration(0)
spellList := map[*core.Spell]bool{}
core.MakePermanent(unit.RegisterAura(core.Aura{

aura := core.MakePermanent(unit.RegisterAura(core.Aura{
ActionID: core.ActionID{ItemID: 71086},
Label: "Dragonwrath, Tarecgosa's Rest - Handler",
OnReset: func(aura *core.Aura, sim *core.Simulation) {
lastTimestamp = time.Duration(0)
spellList = map[*core.Spell]bool{}
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
lastTimestamp = sim.CurrentTime
spellList = map[*core.Spell]bool{}
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {

// Handle direct damage only and make sure we're not proccing of our own spell
Expand Down Expand Up @@ -322,6 +328,8 @@ func init() {
config.getDoTHandler(spell.SpellID)(sim, spell, result)
},
}))

character.ItemSwap.RegisterProc(71086, aura)
})

// register custom global spell handlers
Expand Down
Loading

0 comments on commit c67de86

Please sign in to comment.