Since my post got screwed up and I cannot edit, here goes.
deity is normally an aspect of faction.  So, I wouldn't say it is the same thing.  You could always make a faction called cazic thule or something (this one does already exist) and make it work practically the same though.
And on the last thing,
quest::setglobal("kingdomfaction","FactionA",7,"F" ) 
kingdomfaction is the global's name.  FactionA is the value.  7 corresponds to who the variable will affect.  You could use any number 1-7 from the table in the link mentioned above.  However, 7 means the global variable kingdomfaction is set to FactionA for all players and all npcs in all zones.  And again, F is the time variable.  I normally use F for forever, but you can use other things such as "Y5" for 5 years if you really want to.
So, what exactly does the 7 mean?
I made an npc named Inny in hateplaneb.  I made an npc named cazzy in fearplane.  I gave them the exact same script:
	Code:
	if($text=~/hail/i){
  quest::say("Hi $name.  kingdomfaction is set to $qglobals{kingdomfaction}");
}
 When Striat hailed Inny in hateplaneb, he sets kingdomfaction is set to FactionA.  Then, Rondo hailed Cazzy in fearplane.  Again, kingdomfaction is set to FactionA.  
Next, I used 5 instead of 7.  This is npcs-all, players-this player only, zone-all zones.  I completed the initial quest with Striat.  I hail Cazzy, I get the same response as above.  Same response with Izzy.
Then, I use Rondo.  I hail the npcs and he gets a blank value because the value is only defined for Striat.  Hope that clears that aspect up a little.