this.supertype.add("Legendary");
// {1}, {tap}, Discard a card: Put a study counter on Grimoire of the Dead.
Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STUDY.createInstance()), new ManaCostsImpl("{1}"));
ability1.addCost(new TapSourceCost());
ability1.addCost(new DiscardTargetCost(new TargetCardInHand()));
this.addAbility(ability1);
// {tap}, Remove three study counters from Grimoire of the Dead and sacrifice it: Put all creature cards from all graveyards onto the battlefield under your control. They're black Zombies in addition to their other colors and types.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrimoireOfTheDeadEffect(), new TapSourceCost());
ability2.addCost(new RemoveCountersSourceCost(CounterType.STUDY.createInstance(3)));