po-devs/pokemon-online — pull request #1109 by Fuzzysqurl (2014-04-21 06:31:02+00:00)
Title: Giratina CC Ability fix

Alternative way: Generate Pokemon, then item, then form check (has to overwrite``PokeGeneral g;``), then ability
Honestly though, I have no idea how to manipulate that part of the code, and this fixed it just fine.