Skip to content

Commit

Permalink
Merge branch 'master' into ThunderfuryDamageModifier
Browse files Browse the repository at this point in the history
  • Loading branch information
sanguinerarogue authored Sep 26, 2024
2 parents 5882b77 + 39bd04c commit 9c29d65
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 24 deletions.
3 changes: 2 additions & 1 deletion proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ message Debuffs {
int32 ancient_corrosive_poison = 24; // between 0 and 100, represents average uptime percentage
bool mekkatorque_fist_debuff = 29;
bool serpents_striker_fist_debuff = 30;
bool improved_faerie_fire = 36; // Provided by Tier 1 Balance set bonus
bool improved_faerie_fire = 36; // Provided by Tier 1 Feral set bonus
bool melee_hunter_dodge_debuff = 41; // Provided by Tier 1 Melee Hunter set bonus

TristateEffect curse_of_elements_new = 31 [deprecated=true];
TristateEffect curse_of_shadow_new = 32 [deprecated=true];
Expand Down
18 changes: 18 additions & 0 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
MakePermanent(ImprovedFaerieFireAura(target))
}

if debuffs.MeleeHunterDodgeDebuff {
MakePermanent(MeleeHunterDodgeReductionAura(target, level))
}

if debuffs.CurseOfWeakness != proto.TristateEffect_TristateEffectMissing {
MakePermanent(CurseOfWeaknessAura(target, GetTristateValueInt32(debuffs.CurseOfWeakness, 0, 3), level))
}
Expand Down Expand Up @@ -1136,6 +1140,20 @@ func ImprovedFaerieFireAura(target *Unit) *Aura {
})
}

func MeleeHunterDodgeReductionAura(target *Unit, _ int32) *Aura {
return target.GetOrRegisterAura(Aura{
Label: "Stalked",
ActionID: ActionID{SpellID: 456393},
Duration: time.Second * 30,
OnGain: func(aura *Aura, sim *Simulation) {
aura.Unit.PseudoStats.DodgeReduction += 0.01
},
OnExpire: func(aura *Aura, sim *Simulation) {
aura.Unit.PseudoStats.DodgeReduction -= 0.01
},
})
}

func CurseOfWeaknessAura(target *Unit, points int32, playerLevel int32) *Aura {
spellID := map[int32]int32{
25: 6205,
Expand Down
2 changes: 1 addition & 1 deletion sim/core/spell_outcome.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ func (result *SpellResult) applyAttackTableBlock(spell *Spell, attackTable *Atta
}

func (result *SpellResult) applyAttackTableDodge(spell *Spell, attackTable *AttackTable, roll float64, chance *float64, countHits bool) bool {
*chance += max(0, attackTable.BaseDodgeChance)
*chance += max(0, attackTable.BaseDodgeChance-attackTable.Defender.PseudoStats.DodgeReduction)

if roll < *chance {
result.Outcome = OutcomeDodge
Expand Down
2 changes: 1 addition & 1 deletion sim/core/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ type PseudoStats struct {

DisableDWMissPenalty bool // Used by Heroic Strike and Cleave
IncreasedMissChance float64 // Insect Swarm and Scorpid Sting
DodgeReduction float64 // Used by Warrior talent 'Weapon Mastery' and SWP boss auras.
DodgeReduction float64 // Target dodge reduction effects e.g. "reduces its target's chance to Dodge by X%"

MobTypeAttackPower float64 // Bonus AP against mobs of the current type.
MobTypeSpellPower float64 // Bonus SP against mobs of the current type.
Expand Down
33 changes: 17 additions & 16 deletions sim/hunter/item_sets_pve.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,31 @@ var ItemSetGiantstalkerProwess = core.NewItemSet(core.ItemSet{
// Your Mongoose Bite also reduces its target's chance to Dodge by 1% and increases your chance to hit by 1% for 30 sec.
2: func(agent core.Agent) {
hunter := agent.(HunterAgent).GetHunter()

procBonus := stats.Stats{
stats.SpellHit: 1,
stats.MeleeHit: 1,
}

debuffAuras := hunter.NewEnemyAuraArray(func(target *core.Unit, level int32) *core.Aura {
return target.RegisterAura(core.Aura{
Label: "S03 - Item - T1 - Hunter - Melee 2P Bonus",
ActionID: core.ActionID{SpellID: 456389},
Duration: time.Second * 30,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Dodge, -1)
aura.Unit.PseudoStats.BonusMeleeHitRatingTaken += 1 * core.MeleeHitRatingPerHitChance
aura.Unit.PseudoStats.BonusSpellHitRatingTaken += 1 * core.SpellHitRatingPerHitChance
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Dodge, 1)
aura.Unit.PseudoStats.BonusMeleeHitRatingTaken += 1 * core.MeleeHitRatingPerHitChance
aura.Unit.PseudoStats.BonusSpellHitRatingTaken += 1 * core.SpellHitRatingPerHitChance
},
})
stalkerAura := hunter.RegisterAura(core.Aura{
ActionID: core.ActionID{SpellID: 458403},
Label: "Stalker",
Duration: time.Second * 30,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.AddStatsDynamic(sim, procBonus)
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
aura.Unit.AddStatsDynamic(sim, procBonus.Invert())
},
})

debuffAuras := hunter.NewEnemyAuraArray(core.MeleeHunterDodgeReductionAura)
core.MakePermanent(hunter.RegisterAura(core.Aura{
Label: "S03 - Item - T1 - Hunter - Melee 2P Bonus Trigger",
OnSpellHitDealt: func(_ *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if spell.SpellCode == SpellCode_HunterMongooseBite && result.Landed() {
debuffAuras.Get(result.Target).Activate(sim)
stalkerAura.Activate(sim)
}
},
}))
Expand Down
19 changes: 14 additions & 5 deletions ui/core/components/inputs/buffs_debuffs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,10 @@ export const ImprovedFaerieFire = makeBooleanDebuffInput({
actionId: player => player.getMatchingSpellActionId([{ id: 455864, minLevel: 60 }]),
fieldName: 'improvedFaerieFire',
});
export const MeleeHunter2pcT1Bonus = makeBooleanDebuffInput({
actionId: player => player.getMatchingSpellActionId([{ id: 456393, minLevel: 60 }]),
fieldName: 'meleeHunterDodgeDebuff',
});
export const MekkatorqueFistDebuff = makeBooleanDebuffInput({
actionId: player => player.getMatchingItemActionId([{ id: 213409, minLevel: 40, maxLevel: 45 }]),
fieldName: 'mekkatorqueFistDebuff',
Expand Down Expand Up @@ -1012,11 +1016,11 @@ export const RAID_BUFFS_CONFIG = [
picker: IconPicker,
stats: [Stat.StatArmor],
},
// {
// config: DamageReductionPercentBuff,
// picker: IconPicker,
// stats: [Stat.StatArmor],
// },
// {
// config: DamageReductionPercentBuff,
// picker: IconPicker,
// stats: [Stat.StatArmor],
// },
{
config: ResistanceBuff,
picker: MultiIconPicker,
Expand Down Expand Up @@ -1329,6 +1333,11 @@ export const MISC_DEBUFFS_CONFIG = [
picker: IconPicker,
stats: [],
},
{
config: MeleeHunter2pcT1Bonus,
picker: IconPicker,
stats: [Stat.StatMeleeHit],
},
{
config: MekkatorqueFistDebuff,
picker: IconPicker,
Expand Down
2 changes: 2 additions & 0 deletions ui/core/proto_utils/action_id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,11 @@ const spellIDsToShowBuffs = new Set([
457816, // https://www.wowhead.com/classic/spell=457816/battle-forecast
457817, // https://www.wowhead.com/classic/spell=457817/berserker-forecast
457819, // https://www.wowhead.com/classic/spell=457819/echoes-of-gladiator-stance
458403, // https://www.wowhead.com/classic/spell=458403/stalker
461252, // https://www.wowhead.com/classic/spell=461252/shadowflame-fury
461270, // https://www.wowhead.com/classic/spell=461270/magmadars-return
461615, // https://www.wowhead.com/classic/spell=461615/mark-of-chaos
456393, // https://www.wowhead.com/classic/spell=456393/stalked
]);

export const defaultTargetIcon = 'https://wow.zamimg.com/images/wow/icons/large/spell_shadow_metamorphosis.jpg';
Expand Down

0 comments on commit 9c29d65

Please sign in to comment.