Factions

A good place to start learning about factions is the faction section of the lexicon:

http://www.nwnlexicon.com/compiled/categoryfunction.reputationfaction.html

Factions are controlled in the Factions window. To view this page in NWN2 go to View > Factions. Here you will see a table showing how factions feel about each other.

Each row shows how the faction listed to the left feels about the faction in each column. To adjust how a faction feels about each faction, change the values in a row. 

Note that there is no Player row. This is because the Player faction cannot have feelings one way or another for other factions. Note also that, by default, all factions except for hostile are 100% friendly to Players. This is a change from NWN1 defaults.

Faction is measured on a scale from 0 to 100. Anything 10 or lower means the creatures of a faction are hostile to the creatures in the target faction. Anything 90 or above means the creatures of a faction are friendly to the creatures of the target faction.

Hostile creatures attack on sight. Friendly creatures can share buffs (such as bless and other area of effect spells), and will usually not be affected by area of effect attacks (such as fireballs). Note that area of affect damage will be determined by server and campaign settings.

You can check to see how one faction feels about another using GetReputation():

int GetReputation(
object oSource,
object oTarget
);