1998
So, the first thing to do is to multiclass. Our goal is to get as many levels granting sneak attack as possible. While you can do that for all 20 if you allow 3rd party material, in first-party pathfinder there aren't quite enough archetypes like that yet. One example maximal option (you can only get Rogue if you don't take Ninja and vice versa, and there're other choices like that) is:
Eldritch Poisoner/Ninja/Snakebite Striker/Greensting Slayer/Master Spy/Assassin/Red Mantis Assassin/Gray Warden/Deep Sea Pirate/Sleepless Detective/Field Agent/Twilight Talon
And that's all the regular, 'gets sneak attack at first level', sneak attack classes. For our last 8 levels, we'll want to take Crimson Templar.
Crimson Templar gives us Deific Obedience which we can use in the worship of Tanagaar (which gives +3d6 sneak attack, and which we would definitely be taking otherwise), which frees up a feat for something else. It also eventually provides +1d6/level half-fire half-holy damage on sneak attacks v.s. evil outsiders (once per day per level), which is actually more sneak attack damage than 1d6/level since it also provides a tiny bit of sneak attacking, so this is definitely the way to go. With all the multipliers to sneak attack damage, it actually ends up pretty close, but in 8 levels Crimson Templar gives 3d6 sneak attack while any other class would give at most 4d6. Even with the effective X2 multiplier we end up with later that applies to our base sneak attack damage but not bonus sneak attack damage like Heavenly Fire, the 8d6 from heavenly fire is better. In fact, even if Heavenly Fire couldn't stack with Sap Master (which I believe it does), you'd still be 4d6 better off with Heavenly Fire than the one extra die.
At this point we are gonna try to get 12d6 sneak attack from the listed classes, then 3d6 sneak attack from Crimson Templar, plus 8d6 Heavenly Fire sneak attack from Crimson Templar for 23d6 total sneak attack damage per attack from class levels. The requirements for the prestige classes involved are quite onerous and we will have had to invest feats in:
- Alertness
- Exotic Weapon Proficiency(Sawtooth Saber)
- Weapon Focus(Sawtooth Saber)
- Two-Weapon Fighting
- Skill Focus(any)
- Deceitful
- Iron Will
- Combat Reflexes
- Catch Off Guard
- Twilight Tattoo
- Exotic Weapon Proficiency(Bastard Sword)
- Power Attack
- Vital Strike
Though we can avoid the need to take most of those feats permanently via Paragon Surge, or all of them except probably Twilight Tattoo, via Paragon Surge dual-wielding training weapons, and possessing a dark blue rhomboid ioun stone. This means we only actually need to spend one feat on this bunch.
We also need skill ranks in:
- Intimidate 5 ranks
- Stealth 5 ranks
- Perception 5 ranks
- Linguistics 2 ranks
- Knowledge(local) 5 ranks
- Appraise 5 ranks
- Profession(sailor) 5 ranks
- Swim 5 ranks
- Bluff 7 ranks
- Disguise 7 ranks
- Sense Motive 5 ranks
- Diplomacy 2 ranks
- Craft Alchemy 5 ranks
So, now we want to spend our remaining feats. We definitely want Demonic Obedience(Shax), for another 3d6 sneak attack, as well as Sap Adept and Sap Master to double the sneak attack dice that aren't Heavenly Fire bonus damage. Beyond that, we can take Merciless Precision if we're a kobold, for 1d6 for damage if the target has one of a variety of severe negative conditions, such as blinded, frightened, or helpless. Being a kobold also gets us access to the Dragonmaw trait, for an extra natural attack. The two-weapon fighting line gets us Two-Weapon Fighting, Improved Two-Weapon Fighting, and Greater Two-Weapon Fighting, which lets us attack 3 more times in a full attack. Our penultimate normal feat needs to be spent on Quick Draw, which leaves one feat free and another feat available if we opt to play an antihero. We should take Weapon Versatility and Bludgeoner if we've access to Mantis Blades, using a resonant opalescent white pyramid ioun stone keyed to the sawtooth saber in our wayfinder to gain Weapon Focus(sawtooth saber). Otherwise the feats are free.
Traits can give us bonus damage, but not bonus damage dice nor attacks in a full attack.
Skills obviously don't factor in here.
The next big thing is equipment. First of all, we're going to want 8 sneaky saps. A sneaky sap deals your sneak attack damage in extra sneak attack damage, once per day (with other restrictions and benefits and stuff). With quick draw and 8 of them, we have enough to add that bonus to each of our attacks.
Alternatively, given that we are level 20 and have levels in the Red Mantis Assasin prestige class (though we clearly have rebelled against the cult since our last several levels are in Crimson Templar), we may be able to acquire a Mantis Blade, or better yet 8 Mantis Blades, and then add the sneaky property to the artifacts (since those properties have merely a flat price modification rather than a stated bonus). This would add an extra 1d6 sneak attack per Mantis Blade, and require UMD to avoid negative levels. Mantis Blades are minor artifacts, so this is not likely to be an easy task.
We also want a Cloak of the Manta Ray, which gives us another extra attack. By wearing an Amulet of Mighty Fists we can add sneaky, merciful, and weapon focus (tail spine) training to the attack, allowing us to apply sap master and the extra dice from sneaky. That same amulet should also have weapon focus (bite) training, so that it can do the same for our natural attack from being a dragonmaw kobold, weapon focus (whip) training for our hellmouth lash spell, and weapon focus (claw) training for our phantom limb spell. This makes the amulet cost 105,000 gp.
The last thing we need is to have at some point had access to a Spindle of Perfect Knowledge. That minor artifact grants actual skill ranks, which we need to level up into Field Agent while leveling up from any one level from 1 to 4. That's cause we're one short on base classes that grant 1d6 sneak attack.
I believe the rest of our equipment is irrelevant, except that we'll want to benefit from several spells, and will probably do so via scroll. We want:
- instant enemy(evil outsider) or similar so we can apply Heavenly Fire to the wooden dummy, which might necessitate the use of an enmity fetish or an allied ranger depending on how we access it.
- a scroll of (or other access to) (Tenser's) transformation to get our BAB up properly to 20 so we have 4 attacks that way.
- a CL 20 scroll of intensified sense vitals empowered by the greater component effect of the entropic resin esoteric component, which increases sneak attack by +7d6.
- haste, for the one extra attack it provides.
- monstrous extremities, twice, for two hoof attacks
- phantom limb, for two claw attacks
- hellmouth lash, for one whip attack via tounge
And that's everything. At that point we can deal 15d6 sneak attack damage from class levels, plus 1d6 sneak attack damage from Merciless Precision, plus 6d6 sneak attack from our Obediences, plus 1d6 from using Mantis Blades for 23d6, plus 7d6 from sense vitals to 30d6, doubled by sneaky to 60d6, increased by Heavenly Fire to 68d6 and doubled again by Sap Master (which stacks) to 136d6, and again multiplied by our attacking 15 times to 2040d6, less 42d6 on account of 7 of those are natural attacks instead of a Mantis Blade, for a grand total of 1998d6.
You can do higher via any of the methods that grant you infinite attacks, or via uncapping the bonus on Sense Vitals via Blood Intensity or otherwise, but this is the most I think you can do using only straightforward non-infinite stuff.
This is what the build might actually look like, so people don't complain about it being nonsensical or whatever:
1: Born a slave to House Vexidyre in the underdark, our Kobold is raised in the worship of the Demon Lord Shax. Her first level is in Snakebite Striker, and she serves as a thug in the family's enforcement of order in the slave markets, and as a subject for occasional diabolical experiments. From an early age she learns that the only way out of suffering is to make others suffer in service to the House.
2: Frequent squabbling amongst the Houses means that there are many opportunities for Vexidyre to profit via riots and murder. Our Kobold takes a level in Ninja and begins serving with other hardened slaves in directing the street riots to the benefit of their masters, encouraging them when a distraction or chaos is beneficial and eliminating the leadership when a riot is contrary to Vexidyre's interests.
3-4: Our kobold's unusual aptitude for assassination is noted by a noble of the House, and she is reassigned to the temple for training and processing. She takes a level of Eldritch Poisoner, then a level of Greensting Slayer, but ultimately is judged unworthy of becoming an official member of the temple or assassin for the house, largely on account of race. The house begins sending her to assassinate notable slaves of other houses, with the expectation that she will die in the attempt, but she keeps succeeding, which increasingly irritates the slave responsible for her assessment as not worth further training, and increases his need to dispose of her to retain his position.
5: Seeing the way things are going, our kobold shifts allegiances, and plots to get herself sold out of assassin work and to the Zirnakaynin chapter of the Pathfinder Society. Through skill and luck, she manages to locate the item she needs to pass the chapter's arduous testing, and illicitly trades information on and access to House Vexidyre for the opportunity to serve in the room as a guard. With the help of the item to increase her apparent value to the agents of the potential buyer, she gets herself sold, is issued a wayfinder, and takes a level in Field Agent.
6: The Zirnakaynin chapter of the Society isn't so much a part of the Pathfinder Society as a whole as it is a ploy by the matriarchs, part of their plan to try and generate more acceptance of outsiders and increased trade with the outside world. While technically a member, our kobold's job is to pretend to befriend other members, learn their secrets, and report everything to the Matriarchs. Since slaves sent out with Pathfinders on expeditions are more likely to attempt escape, a closer watch is kept of her activities. She strives to prove her value to the drow in order to keep her new life and the tiny mote of social security it offers, eventually betraying a group of companions who violate drow law in a manner that threatens the power of a matriarch. Her companions are sentenced to death, and she executes them, taking a level of Gray Warden (she can cast a 2nd level divine spell from a scroll she owns, or possibly her wayfinder).
7: Having proved her loyalty, she is allowed into service as an assassin, but banished from the Society for murdering its agents. She begins working as an assasin for the Drow as a whole, murdering people the Matriarchs want removed in settlements nearby but outside the capitol. She takes a level in assassin, and subsumes herself in her job role to escape the hell of life in the Underdark.
8: Over the course of her career, she is scouted by the Red Mantis, and they eventually purchase her in exchange for services already rendered (the Matriarchs have a pretty big tab). She takes a level in Red Mantis Assassin, and is taught to worship Achaekek instead of Lolth, but mantains her Obedience to Shax as part of her identification as an assassin. The surface world is beautiful and seeing the beauty fundamentally changes her life, but she does her best to hide her slowly reemerging personality from her new masters.
9: Her new masters are much nicer than the drow, from her perspective: they are lawful like she is and this enables her to build relationships with others that are founded on agreements that can be relied on rather than the whimsy of the day. The lack of racism helps immensely, and she rapidly works her way into solo work, spending more and more time in 'cover' roles that allow her to relate to people outside the society and see the beauty in others' lives and nature, claiming to herself and the order that she's doing it just to get access to her mark. She takes a level of Master Spy.
10: Her double life breaks down and she gets caught. Fleeing the Red Mantis, she manages to feign her death temporarily, and stow away on a ship bound to Cheliax, feigning a position as a common slave. As it nears arrival, she incites a mutiny, kills the captain, and begins a career in piracy on the run from the Red Mantis, taking a level in Deep Sea Pirate. Our kobold can neither cope with nor imagine being in charge, so it never occurs to her to take command of the ship; she uses her social skills during the mutiny to push another slave, one she thinks will be useful to her, into the public captaining position.
11: Working as a member of the suddenly formed pirate crew, she notices some of the other slaves are also socially manipulating things. In particular, they seem to keep manipulating the captain into attacking Katapeshi and Chelish ships for cargo, and freeing their slaves. She begins a cat and mouse game with the other ship members involved as they each try to learn the other's secret without revealing their own or that anything is amiss to the crew as a whole. Eventually they come to respect eachother, and our kobold gets the Eagle Knight in question to reveal their secrets to her, which completely breaks her world view. After much emotional trauma and relationship building, she disembarks in Andoran and joins forces with the knight on a temporary basis, to learn about this whole 'not being evil' thing. She takes a level in Sleepless Detective, using her unparalleled tracking skills, single-minded focus, and forensic knowledge to augment her assassin skills as a member of the new adventuring party.
12: Eventually, she gives in to hope, accepts that the Eagle Knights really do do what they do for selfless ideological reasons, and joins the order. Given her skills, it's no surprise she's selected for duty as a twilight talon, and takes a level in the appropriate class.
13-20: While serving as a Talon, she consistently butts heads with leadership, who want her to not kill prominent enemy leaders, when it seems so obvious that the right solution is to do exactly that. Nonetheless, she abides by the rules of her newfound family, especially when it becomes clear she won't be kicked out or murdered for having a different opinion. Periodically, elite Red Mantis agents track her down to kill her, but she has powerful friends now, and she's rather skilled at killing things herself. She acquires her first Mantis Blade off a failed assassin, promptly subjects it to a helm of opposite alignment, and proceeds to keep it around. Still performing her daily obediences to Shax, now as a reminder of her heritage and a place to root herself in her everchanging and always overwhelmingly foreign life, and frequently living in Andoran she is naturally drawn to the cult of Tanagaar, the LG empyreal bird god of assassins (as opposed to Shax, the CE demon bird god of assassins). She herself has a special hatred for devils, having personally experienced how being born into slavery and evil can prevent one from even being able to imagine the good, joy, or beauty of the world, and so she grows into the role of Crimson Templar, firey opponent of evil and servant of Ragathiel, but honors Tanagaar with her Deific Obedience. She's no stranger to complicated religious loyalties, after all. By the time she's reached 20th level, she is the greatest Twilight Talon the Eagle Knights have ever employed, capable of slaying practically any creature in the universe in a single strike, her room bedecked with a veritable wall of Mantis Blades, a testament to the Red Mantis' continued failure to end her life.