As a role-playing video game based on the Dungeons & Dragons 3.5 edition ruleset, players build a player character in accordance with the character creation rules of Dungeons & Dragons, which includes selecting a race and class, then assigning skill points. There are sixteen races and twelve classes available, including the rogue and the wizard, as well as an additional seventeen unlockable classes. Neverwinter Nights 2 makes use of the d20 system introduced in Dungeons & Dragons, where a die roll or random number is used to determine the probability and effectiveness of every action, including attacks and saving throws. The player character can recruit companions during the campaign, and may form a party with up to three of them. Party members can be controlled directly by the player or given orders dictating how to behave in combat. The game is set in the Forgotten Realms campaign setting. The party is able to explore various areas of Faerûn—including its cities, forests, and dungeons—while earning experience points and treasure by defeating monsters and completing quests. The entire party collaborates during combat, with characters' behavior determined by their class and abilities. Upon gaining specified amounts of experience, characters level up, allowing them to earn new abilities such as magic spells and feats. Some races, like the drow, are more powerful than others and require characters to accumulate more experience to earn levels. Characters can access Prestige classes, more specialized versions of base classes, by fulfilling certain requirements. The warpriest, for example, is available to divine spellcasters such as clerics after they have reached a set level of power. Items such as weapons, armor, potions, and scrolls can be used or equipped by characters, and some equipment changes will affect a character's appearance. As the game progresses, the player character acquires a keep that can be used as a base of operations. Initially, the keep is in a state of disrepair and must be refurbished using party funds. As the keep is improved, it can generate income and gain stronger defenses to repel sieges. Non-player characters such as equipment vendors can be recruited to work at the keep, and the player must manage the training of guards and the allocation of resources. Before the online component was disabled (see Development below), the campaign of Neverwinter Nights 2 could be played with other players, but only from the beginning of the storyline. The rules