@@ -898,24 +898,46 @@ func init() {
898898 // Mark of the Champion (physical): +150 AP vs Undead and Demons.
899899 core .NewItemEffect (23206 , func (agent core.Agent ) {
900900 character := agent .GetCharacter ()
901- character .Env .RegisterPostFinalizeEffect (func () {
902- for _ , at := range character .AttackTables {
903- bonus := stats.Stats {stats .AttackPower : 150 , stats .RangedAttackPower : 150 }
904- at .MobTypeBonusStats [proto .MobType_MobTypeUndead ] = at .MobTypeBonusStats [proto .MobType_MobTypeUndead ].Add (bonus )
905- at .MobTypeBonusStats [proto .MobType_MobTypeDemon ] = at .MobTypeBonusStats [proto .MobType_MobTypeDemon ].Add (bonus )
906- }
907- })
901+ bonus := stats.Stats {stats .AttackPower : 150 , stats .RangedAttackPower : 150 }
902+ aura := core .MakePermanent (character .RegisterAura (core.Aura {
903+ Label : "Mark of the Champion (Physical)" ,
904+ ActionID : core.ActionID {ItemID : 23206 },
905+ })).
906+ ApplyOnGain (func (_ * core.Aura , _ * core.Simulation ) {
907+ for _ , at := range character .AttackTables {
908+ at .MobTypeBonusStats [proto .MobType_MobTypeUndead ] = at .MobTypeBonusStats [proto .MobType_MobTypeUndead ].Add (bonus )
909+ at .MobTypeBonusStats [proto .MobType_MobTypeDemon ] = at .MobTypeBonusStats [proto .MobType_MobTypeDemon ].Add (bonus )
910+ }
911+ }).
912+ ApplyOnExpire (func (_ * core.Aura , _ * core.Simulation ) {
913+ for _ , at := range character .AttackTables {
914+ at .MobTypeBonusStats [proto .MobType_MobTypeUndead ] = at .MobTypeBonusStats [proto .MobType_MobTypeUndead ].Subtract (bonus )
915+ at .MobTypeBonusStats [proto .MobType_MobTypeDemon ] = at .MobTypeBonusStats [proto .MobType_MobTypeDemon ].Subtract (bonus )
916+ }
917+ })
918+ character .ItemSwap .RegisterProc (23206 , aura )
908919 })
909920
910921 // Mark of the Champion (spell): +85 spell damage vs Undead and Demons.
911922 core .NewItemEffect (23207 , func (agent core.Agent ) {
912923 character := agent .GetCharacter ()
913- character .Env .RegisterPostFinalizeEffect (func () {
914- for _ , at := range character .AttackTables {
915- bonus := stats.Stats {stats .SpellDamage : 85 }
916- at .MobTypeBonusStats [proto .MobType_MobTypeUndead ] = at .MobTypeBonusStats [proto .MobType_MobTypeUndead ].Add (bonus )
917- at .MobTypeBonusStats [proto .MobType_MobTypeDemon ] = at .MobTypeBonusStats [proto .MobType_MobTypeDemon ].Add (bonus )
918- }
919- })
924+ bonus := stats.Stats {stats .SpellDamage : 85 }
925+ aura := core .MakePermanent (character .RegisterAura (core.Aura {
926+ Label : "Mark of the Champion (Spell)" ,
927+ ActionID : core.ActionID {ItemID : 23207 },
928+ })).
929+ ApplyOnGain (func (_ * core.Aura , _ * core.Simulation ) {
930+ for _ , at := range character .AttackTables {
931+ at .MobTypeBonusStats [proto .MobType_MobTypeUndead ] = at .MobTypeBonusStats [proto .MobType_MobTypeUndead ].Add (bonus )
932+ at .MobTypeBonusStats [proto .MobType_MobTypeDemon ] = at .MobTypeBonusStats [proto .MobType_MobTypeDemon ].Add (bonus )
933+ }
934+ }).
935+ ApplyOnExpire (func (_ * core.Aura , _ * core.Simulation ) {
936+ for _ , at := range character .AttackTables {
937+ at .MobTypeBonusStats [proto .MobType_MobTypeUndead ] = at .MobTypeBonusStats [proto .MobType_MobTypeUndead ].Subtract (bonus )
938+ at .MobTypeBonusStats [proto .MobType_MobTypeDemon ] = at .MobTypeBonusStats [proto .MobType_MobTypeDemon ].Subtract (bonus )
939+ }
940+ })
941+ character .ItemSwap .RegisterProc (23207 , aura )
920942 })
921943}
0 commit comments