Porygon2 @ Eviolite
Ability: Trace
Level: 50
EVs: 244 HP / 12 Def / 4 SpA / 244 SpD / 4 Spe
Calm Nature
IVs: 0 Atk
- Shadow Ball
- Ice Beam
- Recover
- Trick Room
244 HP EVs ensure that your HP stat is not divisible by sixteen. Maximized HP would be, which would be bad against status like poison or burn and other forms of passive damage.
244 SpD EVs reach the highest relevant defensive benchmark against Mega Gengar. Investing more doesn't improve Porygon2's ability to handle it. Investing less increases the chance of a Focus Blast 2HKO.
4 SpA EVs allow Shadow Ball to 2HKO all offensive Mega Gengar builds that only invest 4 EVs into 'bulk'.
The rest is dumped into the physical Defense to slightly increase the physical durability.
4 EVs go to Speed, because investing in an even number of stats is a waste of stat points at level 50.
Porygon2 doesn't lose offensive presence by being burned and it also is immune to Hex. +
Porygon2 has Trick Room to gain the speed advantage against potential Substitute, Disable or Destiny Bond Gengar. +
Porygon2 has reliable recovery to not be worn down easily by status. +
Porygon2 has Trace to copy Mega Gengar's Shadow Tag and avoid getting trapped by a potential Perish Song trapper. +
Trick Room allows Porygon2 to willingly run into a Destiny Bond trade and get a free switch into something like Mawile, which could completely turn the game's momentum on the head. +
You don't need a dedicated Trick Room core or team to abuse the move effectively. +
Porygon2 is not a niche pick and can fill many pivoting roles on a variety of teams, especially with Trace. +
Garchomp and Landorus-T are number two and number three of Gengar's most common partners. Trace Porygon2 can use their Abilities against them and easily kill them with Ice Beam. +
Focus Blast on Mega Gengar is not too common, but has a small chance to 2HKO. -
Offensive Calcs
4 SpA Porygon2 Shadow Ball vs. 252 HP / 4 SpD Gengar-Mega: 68-80 (40.7 - 47.9%) -- guaranteed 3HKO
4 SpA Porygon2 Shadow Ball vs. 4 HP / 0 SpD Gengar-Mega: 68-80 (50 - 58.8%) -- guaranteed 2HKO
4 SpA Porygon2 Shadow Ball vs. 0 HP / 4 SpD Gengar-Mega: 68-80 (50.3 - 59.2%) -- guaranteed 2HKO
Defensive Calcs
252 SpA Gengar-Mega Focus Blast vs. 244 HP / 244+ SpD Eviolite Porygon2: 84-100 (43.9 - 52.3%) -- 16% chance to 2HKO
Probably the worst case scenario. Not very likely, especially with the Focus Blast usage (~12%) and Accuracy (70%), but still possible. Special Defense drops are also a potential factor here (10%).
252 SpA Gengar-Mega Sludge Wave vs. 244 HP / 244+ SpD Eviolite Porygon2: 51-60 (26.7 - 31.4%) -- guaranteed 4HKO
252 SpA Gengar-Mega Sludge Bomb vs. 244 HP / 244+ SpD Eviolite Porygon2: 48-57 (25.1 - 29.8%) -- guaranteed 4HKO
EDIT: Changed the nature from Sassy to Calm to not waste EVs and because it doesn't matter against Mega Gengar. This set is not trying to sweep with Trick Room so it doesn't really need to be as slow as possible anyway.