This is the Classic/Bc macro for totem stomp, they've changed in wrath not to be able to be stomped by pets (afaik, I've used on mouseover for Wrath so can't be 100% sure).

/petattack
/petattack [target=mana tide totem]
/petattack [target=tremor totem]
/petattack [target=grounding totem]
/petattack [target=windfury totem]

The totem priority starts from top one to bottom one.
From my experience, there are 3 builds for locks overall.

Max scaling dps : https://classic.wowhead.com/talent-c...-2350300142001
Soul Link : https://classic.wowhead.com/talent-c...50300152501051
Conflag with Shadow burn: able to take 2 targets really fast: https://classic.wowhead.com/talent-c...50005122005141

There are other variatons, but this should be best possible setup.

Therhe are some gear tricks too, but that's different story.

For priest, there are 2 possible setups:
Spirit setup for mana game: https://classic.wowhead.com/talent-c...-2-05025201035
Extra armor and Holy nova: https://classic.wowhead.com/talent-c...03-05025201035

Do note: the shadow wands benefit from COS and Shadow weaving (need to test ds and sm) so your wands with shadow dmg would do effectily extra 25% dmg.