Pkhex: Event Affection + Save Legality false flagging.

Created on 26 Mar 2018  路  10Comments  路  Source: kwsch/PKHeX

So there is currently false flags going up for event affection and I thought they should be addressed.

  • If you have a gen 6 event and take it to a contest hall in ORAS the contest provides 20 affection to the original OT, not the current OT. What this means is that every contest you enter will trigger the pkhex legality flag because it currently expects all event affections to remain at the base.

The error on Pkhex reads "Invalid: Event OT Affection should be 0"

-If you have a gen 6 or 7 save that matches the event, such as if you manipulate the RNG for gen 6/7 and match the TID / SID / OT / Gender of the event for all intents and purposes you become the OT of that event. This currently will trigger a false legality flag in Pkhex. Furthermore if you ride around on a bike or feed it pokebeans in refresh it will also trigger more legality flags since it does not expect the base event happiness / affection to change.

For an event pokemon that matches the save it incorrectly flags "Invalid: Current Handler should not be Event OT"

If you rode around on a bike with the event pokemon matching your save and raised the friendship it will read incorrectly "Event OT friendship does not match base friendship"

If you fed it pokebeans in refresh / gave it cupcakes in amie it incorrectly reads "Event OT Affection should be 0"

If anything needs further clarification please let me know. Cheers.

Most helpful comment

Can also confirm, took Pokemon20 Mew into a Contest and OT Affection went up by 20
image

Line should be changed to include:

((pkm.AO || !pkm.IsUntraded) && (pkm.OT_Affection == 255 || pkm.OT_Affection % 20 != 0))

Yielding a valid legality check:
image

All 10 comments

The fact that you can get matching OT details by way of RNG is consciously ignored by PKHeX. 99.9% of the time it is indicative of cheating.

What about the first issue with the ORAS contest hall and Pkhex incorrectly flagging any event that participates in a contest?

Need someone else to verify; for it to have gone this long without noticing is fishy.

I have files, methods of testing and proof through keysav. It is also consistent with other sources such as bulbapedia where it mentions it only provides affection if you are the original trainer. Just let me know if I should post it

https://github.com/kwsch/PKHeX/issues/631 it seems others have had this issue before as well. Any multiple of 20 in affection is through the contests.

Neat, @sora10pls (can you confirm?)

https://github.com/kwsch/PKHeX/blob/4d3877bf7fc94c555908b4dd6b185ac0e03f970b/PKHeX.Core/Legality/Checks.cs#L1580-L1588

The middle check would need to be updated to exclude:
c# ((pkm.ORAS || pkm.IsTraded) && (pkm.OT_Affection == 255 || pkm.Affection % 20 == 0))` // ORAS contests mistakenly apply 20 affection to the OT instead of the current handler's value`
(final code tbd)

Also worth mentioning that if the pokemon has a master ribbon it needs to have at least 20 base affection since that means it participated in a single contest. I haven't tested the other contests if they also give affection but I thought this was worth noting (the reason being if someone hacked a contest ribbon onto a pokemon).

Can also confirm, took Pokemon20 Mew into a Contest and OT Affection went up by 20
image

Line should be changed to include:

((pkm.AO || !pkm.IsUntraded) && (pkm.OT_Affection == 255 || pkm.OT_Affection % 20 != 0))

Yielding a valid legality check:
image

image
2 master contests.
image
2 master 1 normal contest.
It seems all contests provide the 20 affection to the event. This is important for the pokemon with x number of ribbons to have 20(x) base affection at the bare minimum.

Would have to add a new check for the master ribbons...

Checking pkm.OT_Affection < s6.RibbonBitsContest().Count() * 20 which returns something.

https://github.com/kwsch/PKHeX/blob/4d3877bf7fc94c555908b4dd6b185ac0e03f970b/PKHeX.Core/Ribbons/IRibbonSetCommon6.cs#L54-L66

May be best to check outside the ribbon verifier since it's a meta-check instead of individual. Which would put it here at the end (with a new _V123_ illegal message, tbd):
https://github.com/kwsch/PKHeX/blob/ff675ed6e5900b034a836aaa5a959d565ea75152/PKHeX.Core/Legality/Checks.cs#L1012-L1031

Was this page helpful?
0 / 5 - 0 ratings

Related issues

architdate picture architdate  路  3Comments

ricksee picture ricksee  路  4Comments

netraagal picture netraagal  路  3Comments

EmilyLove26 picture EmilyLove26  路  3Comments

B1gM1k3 picture B1gM1k3  路  4Comments