Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db: rotation spells addition and cleanup #3441

Merged
merged 5 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/database/db.bin
Binary file not shown.
227 changes: 226 additions & 1 deletion assets/database/db.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions sim/core/aura.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ func (at *auraTracker) GetAura(label string) *Aura {
}
return nil
}
func (at *auraTracker) GetAuras() []*Aura {
return at.auras
}
func (at *auraTracker) GetAuraByID(actionID ActionID) *Aura {
for _, aura := range at.auras {
if aura.ActionID.SameAction(actionID) {
Expand Down
2 changes: 1 addition & 1 deletion sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func GiftOfArthasAura(target *Unit) *Aura {
func MangleAura(target *Unit) *Aura {
return bleedDamageAura(target, Aura{
Label: "Mangle",
ActionID: ActionID{SpellID: 33876},
ActionID: ActionID{SpellID: 48566},
Duration: time.Minute,
}, 1.3)
}
Expand Down
148 changes: 148 additions & 0 deletions tools/database/gen_db/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"strings"

"github.com/wowsims/wotlk/sim"
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/proto"
_ "github.com/wowsims/wotlk/sim/encounters" // Needed for preset encounters.
Expand Down Expand Up @@ -133,6 +134,12 @@ func main() {
}
}

for _, spellIds := range GetAllRotationSpellIds() {
for _, spellId := range spellIds {
db.AddSpellIcon(spellId, spellTooltips)
}
}

atlasDBProto := atlaslootDB.ToUIProto()
db.MergeZones(atlasDBProto.Zones)
db.MergeNpcs(atlasDBProto.Npcs)
Expand Down Expand Up @@ -393,3 +400,144 @@ func getGlyphIDsFromJson(infile string) []*proto.GlyphID {
}
})
}

func CreateTempAgent(r *proto.Raid) core.Agent {
encounter := core.MakeSingleTargetEncounter(0.0)
env, _, _ := core.NewEnvironment(r, encounter)
return env.Raid.Parties[0].Players[0]
}

type RotContainer struct {
Name string
Raid *proto.Raid
}

func GetAllRotationSpellIds() map[string][]int32 {
sim.RegisterAll()

rotMapping := []RotContainer{
{Name: "feral", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassDruid,
Equipment: &proto.EquipmentSpec{},
TalentsString: "-503202132322010053120230310511-205503012",
}, &proto.Player_FeralDruid{FeralDruid: &proto.FeralDruid{Options: &proto.FeralDruid_Options{}, Rotation: &proto.FeralDruid_Rotation{}}}), nil, nil, nil)},
{Name: "balance", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassDruid,
Equipment: &proto.EquipmentSpec{},
TalentsString: "5102233115331303213305311031--205003002",
}, &proto.Player_BalanceDruid{BalanceDruid: &proto.BalanceDruid{Options: &proto.BalanceDruid_Options{}, Rotation: &proto.BalanceDruid_Rotation{}}}), nil, nil, nil)},
{Name: "guardian", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassDruid,
Equipment: &proto.EquipmentSpec{},
TalentsString: "-503232132322010353120300313511-20350001",
}, &proto.Player_FeralTankDruid{FeralTankDruid: &proto.FeralTankDruid{Options: &proto.FeralTankDruid_Options{}, Rotation: &proto.FeralTankDruid_Rotation{}}}), nil, nil, nil)},
{Name: "restodruid", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassDruid,
Equipment: &proto.EquipmentSpec{},
TalentsString: "05320031103--230023312131502331050313051",
}, &proto.Player_RestorationDruid{RestorationDruid: &proto.RestorationDruid{Options: &proto.RestorationDruid_Options{}, Rotation: &proto.RestorationDruid_Rotation{}}}), nil, nil, nil)},
{Name: "elemental", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassShaman,
Equipment: &proto.EquipmentSpec{},
TalentsString: "0532001523212351322301351-005052031",
}, &proto.Player_ElementalShaman{ElementalShaman: &proto.ElementalShaman{Options: &proto.ElementalShaman_Options{}, Rotation: &proto.ElementalShaman_Rotation{}}}), nil, nil, nil)},
{Name: "enhance", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassShaman,
Equipment: &proto.EquipmentSpec{},
TalentsString: "053030152-30405003105021333031131031051",
}, &proto.Player_EnhancementShaman{EnhancementShaman: &proto.EnhancementShaman{Options: &proto.EnhancementShaman_Options{}, Rotation: &proto.EnhancementShaman_Rotation{}}}), nil, nil, nil)},
{Name: "restosham", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassShaman,
Equipment: &proto.EquipmentSpec{},
TalentsString: "-3020503-50005331335310501122331251",
}, &proto.Player_RestorationShaman{RestorationShaman: &proto.RestorationShaman{Options: &proto.RestorationShaman_Options{}, Rotation: &proto.RestorationShaman_Rotation{}}}), nil, nil, nil)},
{Name: "hunter", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassHunter,
Equipment: &proto.EquipmentSpec{},
TalentsString: "-015305101-5000032500033330532135301311",
}, &proto.Player_Hunter{Hunter: &proto.Hunter{Options: &proto.Hunter_Options{}, Rotation: &proto.Hunter_Rotation{}}}), nil, nil, nil)},
{Name: "mage", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassMage,
Equipment: &proto.EquipmentSpec{},
TalentsString: "23000513310033015032310250532-03-023303001",
}, &proto.Player_Mage{Mage: &proto.Mage{Options: &proto.Mage_Options{}, Rotation: &proto.Mage_Rotation{}}}), nil, nil, nil)},
{Name: "healingpriest", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassPriest,
Equipment: &proto.EquipmentSpec{},
TalentsString: "0503203130300512301313231251-2351010303",
}, &proto.Player_HealingPriest{HealingPriest: &proto.HealingPriest{Options: &proto.HealingPriest_Options{}, Rotation: &proto.HealingPriest_Rotation{}}}), nil, nil, nil)},
{Name: "shadow", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassPriest,
Equipment: &proto.EquipmentSpec{},
TalentsString: "05032031--325023051223010323151301351",
}, &proto.Player_ShadowPriest{ShadowPriest: &proto.ShadowPriest{Options: &proto.ShadowPriest_Options{}, Rotation: &proto.ShadowPriest_Rotation{}}}), nil, nil, nil)},
{Name: "rogue", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassRogue,
Equipment: &proto.EquipmentSpec{},
TalentsString: "00532000523-0252051050035010223100501251",
}, &proto.Player_Rogue{Rogue: &proto.Rogue{Options: &proto.Rogue_Options{}, Rotation: &proto.Rogue_Rotation{}}}), nil, nil, nil)},
{Name: "warrior", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassWarrior,
Equipment: &proto.EquipmentSpec{},
TalentsString: "302023102331-305053000520310053120500351",
}, &proto.Player_Warrior{Warrior: &proto.Warrior{Options: &proto.Warrior_Options{}, Rotation: &proto.Warrior_Rotation{}}}), nil, nil, nil)},
{Name: "protwarrior", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassWarrior,
Equipment: &proto.EquipmentSpec{},
TalentsString: "2500030023-302-053351225000012521030113321",
}, &proto.Player_ProtectionWarrior{ProtectionWarrior: &proto.ProtectionWarrior{Options: &proto.ProtectionWarrior_Options{}, Rotation: &proto.ProtectionWarrior_Rotation{}}}), nil, nil, nil)},
{Name: "holypally", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassPaladin,
Equipment: &proto.EquipmentSpec{},
TalentsString: "50350151020013053100515221-50023131203",
}, &proto.Player_HolyPaladin{HolyPaladin: &proto.HolyPaladin{Options: &proto.HolyPaladin_Options{}, Rotation: &proto.HolyPaladin_Rotation{}}}), nil, nil, nil)},
{Name: "protpally", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassPaladin,
Equipment: &proto.EquipmentSpec{},
TalentsString: "-05005135200132311333312321-511302012003",
}, &proto.Player_ProtectionPaladin{ProtectionPaladin: &proto.ProtectionPaladin{Options: &proto.ProtectionPaladin_Options{}, Rotation: &proto.ProtectionPaladin_Rotation{}}}), nil, nil, nil)},
{Name: "ret", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassPaladin,
Equipment: &proto.EquipmentSpec{},
TalentsString: "050501-05-05232051203331302133231331",
}, &proto.Player_RetributionPaladin{RetributionPaladin: &proto.RetributionPaladin{Options: &proto.RetributionPaladin_Options{}, Rotation: &proto.RetributionPaladin_Rotation{}}}), nil, nil, nil)},
{Name: "warlock", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassWarlock,
Equipment: &proto.EquipmentSpec{},
TalentsString: "2350002030023510253500331151--550000051",
}, &proto.Player_Warlock{Warlock: &proto.Warlock{Options: &proto.Warlock_Options{}, Rotation: &proto.Warlock_Rotation{}}}), nil, nil, nil)},
{Name: "dk", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassDeathknight,
Equipment: &proto.EquipmentSpec{},
TalentsString: "-320043500002-2300303050032152000150013133051",
}, &proto.Player_Deathknight{Deathknight: &proto.Deathknight{Options: &proto.Deathknight_Options{}, Rotation: &proto.Deathknight_Rotation{}}}), nil, nil, nil)},
{Name: "tankdk", Raid: core.SinglePlayerRaidProto(core.WithSpec(&proto.Player{
Class: proto.Class_ClassDeathknight,
Equipment: &proto.EquipmentSpec{},
TalentsString: "005510153330330220102013-3050505100023101-002",
}, &proto.Player_TankDeathknight{TankDeathknight: &proto.TankDeathknight{Options: &proto.TankDeathknight_Options{}, Rotation: &proto.TankDeathknight_Rotation{}}}), nil, nil, nil)},
}

ret_db := make(map[string][]int32, 0)

for _, r := range rotMapping {
f := CreateTempAgent(r.Raid).GetCharacter()

spells := make([]int32, 0, len(f.Spellbook))

for _, s := range f.Spellbook {
if s.SpellID != 0 {
spells = append(spells, s.SpellID)
}
}

for _, s := range f.GetAuras() {
if s.ActionID.SpellID != 0 {
spells = append(spells, s.ActionID.SpellID)
}
}

ret_db[r.Name] = spells
}
return ret_db
}
10 changes: 9 additions & 1 deletion tools/database/overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ var SharedSpellsIcons = []int32{
16862,
55487,

33876,
48566,
46855,
57393,

Expand Down Expand Up @@ -579,6 +579,14 @@ var SharedSpellsIcons = []int32{
53408,

11374,
15235,

27013,

58749,
49071,

30708,
}

// If any of these match the item name, don't include it.
Expand Down
2 changes: 1 addition & 1 deletion ui/core/components/icon_inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const AttackPowerDebuff = InputHelpers.makeMultiIconInput([
], 'Atk Pwr');

export const BleedDebuff = InputHelpers.makeMultiIconInput([
makeBooleanDebuffInput(ActionId.fromSpellId(33876), 'mangle'),
makeBooleanDebuffInput(ActionId.fromSpellId(48564), 'mangle'),
makeBooleanDebuffInput(ActionId.fromSpellId(46855), 'trauma'),
makeBooleanDebuffInput(ActionId.fromSpellId(57393), 'stampede'),
], 'Bleed');
Expand Down
8 changes: 4 additions & 4 deletions ui/protection_warrior/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const ShoutPicker = InputHelpers.makeSpecOptionsEnumIconInput<Spec.SpecPr
fieldName: 'shout',
values: [
{ color: 'c79c6e', value: WarriorShout.WarriorShoutNone },
{ actionId: ActionId.fromSpellId(2048), value: WarriorShout.WarriorShoutBattle },
{ actionId: ActionId.fromSpellId(47436), value: WarriorShout.WarriorShoutBattle },
{ actionId: ActionId.fromSpellId(469), value: WarriorShout.WarriorShoutCommanding },
],
});
Expand All @@ -45,13 +45,13 @@ export const ProtectionWarriorRotationConfig = {
fieldName: 'customRotation',
numColumns: 3,
values: [
{ actionId: ActionId.fromSpellId(30357), value: SpellOption.Revenge },
{ actionId: ActionId.fromSpellId(57823), value: SpellOption.Revenge },
{ actionId: ActionId.fromSpellId(47488), value: SpellOption.ShieldSlam },
{ actionId: ActionId.fromSpellId(47440), value: SpellOption.Shout },
{ actionId: ActionId.fromSpellId(47502), value: SpellOption.ThunderClap },
{ actionId: ActionId.fromSpellId(25203), value: SpellOption.DemoralizingShout },
{ actionId: ActionId.fromSpellId(71552), value: SpellOption.MortalStrike },
{ actionId: ActionId.fromSpellId(30022), value: SpellOption.Devastate },
{ actionId: ActionId.fromSpellId(47486), value: SpellOption.MortalStrike },
{ actionId: ActionId.fromSpellId(47498), value: SpellOption.Devastate },
{ actionId: ActionId.fromSpellId(47467), value: SpellOption.SunderArmor },
{ actionId: ActionId.fromSpellId(12809), value: SpellOption.ConcussionBlow },
{ actionId: ActionId.fromSpellId(46968), value: SpellOption.Shockwave },
Expand Down
Loading