Author Topic: Faction  (Read 596 times)

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Faction
« on: September 16, 2011, 09:08:03 pm »


               Wondering if I can have certain subrace belong to a specific faction, perferably by script if possible. I have looked in the functions but didnt come across any. Or I may have over looked. Anyone can too lend a hand?

Thank in advance.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Faction
« Reply #1 on: September 16, 2011, 11:43:48 pm »


               

Taino wrote...

Wondering if I can have certain subrace belong to a specific faction, perferably by script if possible. I have looked in the functions but didnt come across any. Or I may have over looked. Anyone can too lend a hand?

Thank in advance.


ChangeFaction()
ChangeToStandardFaction()

Both can be used on spawn, though the former requires a creature already of that faction in the game/module, and the latter is limited to standard factions.
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Faction
« Reply #2 on: September 17, 2011, 12:48:00 am »


               So I can set SUBRC_DROW to their own faction by using ChangeFaction()?
               
               

               
            

Legacy_Axe_Murderer

  • Full Member
  • ***
  • Posts: 199
  • Karma: +0/-0
Faction
« Reply #3 on: September 17, 2011, 01:56:01 am »


               NPCs only...PCs have no factions
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Faction
« Reply #4 on: September 17, 2011, 02:40:42 am »


               Hmm, I wanting to make the faction towards the subrace.
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Faction
« Reply #5 on: September 17, 2011, 02:41:11 am »


               Thanks Axe
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Faction
« Reply #6 on: September 17, 2011, 02:59:09 am »


               I found this faction player reputation but kinda vague on the information on how to expand it.. Or I just might not understand how to continue the script and where it would go. Also not sure if this would even work.
               
               

               
            

Legacy_Birdman076

  • Sr. Member
  • ****
  • Posts: 320
  • Karma: +0/-0
Faction
« Reply #7 on: September 17, 2011, 03:21:32 am »


               

Taino wrote...

Wondering if I can have certain subrace belong to a specific faction, perferably by script if possible. I have looked in the functions but didnt come across any. Or I may have over looked. Anyone can too lend a hand?

Thank in advance.


Is this for Shayan's SSE?
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Faction
« Reply #8 on: September 17, 2011, 03:33:49 am »


                 This is how I handle setting PC "factions" in my mod.  While NPCs are added directly to factions, based on scriptless NPC "faction" boss creatures kept in the DM area.  Those same creatures are also used to determine the alteration in reputation for a PC based on the reputation of the faction they'll be joining compared to all the other factions.
  It's not perfect by any means (and requires the toolset extender to compile), but I haven't had any aberant behaviour from it yet.  It might be enough to give you a bit of a template to work from for setting up your own scripts though.


// Returns the tag of the "boss" creature for that faction.
string GetFactionBoss (int nFaction)
{
 switch (nFaction)
   {
    case 0:  return "F_PC";
    case 1:  return "F_COMMONER";
    case 2:  return "F_DEFENDER";
    case 3:  return "F_MERCHANT";
    case 4:  return "F_HOSTILE";
    case 5:  return "F_ZOMBIE";
    case 6:  return "F_ZOMBIE_HERBIVORE";
    case 7:  return "F_ZOMBIE_PET";
    case 8:  return "F_ZOMBIE_PREDATOR";
    case 9:  return "F_UNDEAD_OTHER";
    case 10: return "F_MUMMY";
    case 11: return "F_VAMPIRE";
    case 12: return "F_Maria";
    case 13: return "F_OUTCAST";
    case 14: return "F_HOSTILE_TO_ALL";
    case 15: return "F_SWARMS";
    case 16: return "F_NEUTRAL_TO_ALL";
   }
 return "";
}


void SetPCReputation (object oPC, int nPCFaction)
{
 int nReaction, nReaction2, nAdjust;
 object oBoss;
 object oPCBoss = GetObjectByTag (GetFactionBoss (nPCFaction));
 int nFaction = 1;
 string sBoss;
 for (sBoss = GetFactionBoss (nFaction); sBoss != ""; sBoss = GetFactionBoss (nFaction))
    {
     oBoss = GetObjectByTag (sBoss);
     nReaction  = GetReputation (oBoss, oPC);
     nReaction2 = GetReputation (oBoss, oPCBoss);
     nAdjust    = nReaction2 - nReaction;
     AdjustReputation (oPC, oBoss, nAdjust);
     nFaction ++;
    }
}
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Faction
« Reply #9 on: September 17, 2011, 03:33:57 am »


               Nah, I'm using another subrace system.
               
               

               
            

Legacy_Axe_Murderer

  • Full Member
  • ***
  • Posts: 199
  • Karma: +0/-0
Faction
« Reply #10 on: September 17, 2011, 04:12:35 am »


               What that script does is adjust your repuataion with an NPC faction based on the faction of the NPC you kill. Basically it does the exact same thing the default faction system does. If you kill something of faction X and there is a faction Y who are set friendly to X, then your reputation with Y gets worse because you killed an X-man. The only difference is that instead of creating actual factions for groups of NPCs and assigning your NPCs to those factions, that script relys on the builder to tag all NPCs in a group the same to mark them as belonging to the same group. Frankly, it seems easier and more efficient to me to use the built-in faction editor to achieve that. . . far less scripting involved since the default scripts already handle it for you for one thing. Lots of different types of interaction besides just killing can affect things for another.

Sounds like what you want is to group PCs into factions which there is no support for. All the monster factions react to PCs identically regardless of what PC kills them or thier friends. So you have to mark them in some way to indicate what group they belong to and then if you want monsters to react differently to PCs of differing groups, you must provide a custom AI for your creatures so they will be capable of recognizing your custom grouping mark and responding accordingly. You could use a variable to mark them or maybe give them a nodrop item such as a badge or something or use their subrace if you implement that, but whatever method you use, you'll have to additionally modify your creature scripts to be able differentiate if you want varying behavior from them. That's where all the work is at.

Personal Reputation is what the system uses to differentiate somewhat between individual PCs (so if one PC in an MP game attacks a commoner, all other commoners will only be angry with that one PC, not every PC in the game). But be forewarned that personal rep is often overriden by actions that affect faction rep. Like if you're in a party and your party member attacks a commoner then the whole party is affected reputation-wise.
               
               

               


                     Modifié par Axe_Murderer, 17 septembre 2011 - 03:15 .
                     
                  


            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Faction
« Reply #11 on: September 17, 2011, 05:23:07 am »


               It's hard to help someone when they aren't very detailed in the request.

Why do you want to change their faction?  You can never really change a PC's faction, however, you can change every other creature in the module's faction, and determine what to do to the PC when the PC encounters said creature.  (e.g. attack, drink ale together, make small talk, etc)

You can assign a variable to anything and check that variable, not tough to do, to make a determination on how to "react" or "perform" in any given situation.

Based upon the variable set on the PC, determined by race, you can make a switch statement that determine what to do based against the faction that the PC is (read from variable), and what they have done. E.g. if a PC Attacks say, a commoner, then your script would want to modify that variable (for future reference).   You could also use this variable in a very wide array of ways to determine what action to assign the NPC when they encounter the PC.

The Easiest way to handle Custom Factions, is to give all creatures a custom faction (especially monsters), and when they "Perceive" the PC, here you will want to do a check on the PC to determine what to do, e.g. if it's a drow, who sees a drow, they may not attack the PC/Drow if they was a member of their drow house, or if a giant percieved a giant PC, they may be friendly towards them, maybe.

You can more or less do anything with a variable on a PC, the variable (x) could mean anything, you determine what defines (x), and in turn when you read the variable from the PC with any script you could make determinations on what to do.

You can use a 100,000 point system for the player's race  1000 # (e.g. 2,000 / 3,000), and then assign a smaller number 100/200/300 to tell you more information about the PC.

Example Usage (we read variable x = 20,350 from the PC) which, interpreted, means..

Race Drow / has a neutral reputation towards Commoners...
You can use a-z variables in an array to store information about the player's reputation towards every possible faction (@ 27 start using (aa) / (bb) / (cc) / etc. variables)

Variables are more or less how you would use a custom faction setup, to give you a short answer, I'm hoping you are talented enough to figure the rest out on your own.\\

I hope this helps you in some way, sorry that you cannot actually modify the PC 's Faction.

---------------------------

Axe made a very important point about Reputations, which I tend not to use at all, because often bad Players will do stupid things that cause issues with everyone in the party, so when  a PC attacks a commoner, they should have their reputations adjusted instantly, but that doesn't mean you cannot set a variable on the PC that would tell the commoners that this PC is a um bad guy..

Which in turn would tell the commoner in the inn to raise the price of his goods. '<img'>
               
               

               


                     Modifié par _Guile, 17 septembre 2011 - 04:30 .
                     
                  


            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Faction
« Reply #12 on: September 17, 2011, 10:14:44 am »


               Thanks Guile and too everyone. Sorry I didn't leave more information on what I was looking for or wanting to try and attempted.

What I was trying to figure out is I have several surface race and underdark race; which I wanted to have their factions adjusted towards each other and towards other creature [forest creatures, commoners, merchants, etc].

@ Failed_Beard:
This is similar too what I am looking for now I just need to see how to script/impliment it into the module.

@Axe:
I have looked through the reputation systems on the vault and understand how adjusting the PC actions can effect their entire faction.

@ Guile:
Even though I wasn't very detailed on my question. You got what I am trying to aim at. Which I'm not the best scripter and I might be working towards something which is a bit over my novice scripting talent.

Thanks to everyone!! I will trying to figure this out.
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Faction
« Reply #13 on: September 17, 2011, 08:26:58 pm »


               Just know the adjust reputation function is does not work if you are going to cycle through NPCs. I have a thread on here somewhere about it. Maybe Axe can find a work around such as destroying then re-creating the NPC. But in short whenever you adjust reputation on a creature if you run that function on them again you get boosted result. I can go into details if this is not clear and anyone wants more information. I will be looking at this more probably next month.
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Faction
« Reply #14 on: September 17, 2011, 09:09:36 pm »


               I did found this: Race Relations which has a single script like this:
/*
THE NOTORIOUS GENIUS'S RACE RELATIONS
A MODULE ONENTER SCRIPT
FEBRUARY 2003

Simulates racial relations
Sets an entering PC's personal reputation with every other
player in the module based on player race

*/

void main()
{
// Get the entering object
object oEntering = GetEnteringObject();
// Is it a PC?
if (GetIsPC(oEntering) == TRUE)
   {
   // get the race of the PC
   int iRace = GetRacialType(oEntering);

   // if oEntering is a human, adjust relations accordingly
   if (iRace == RACIAL_TYPE_HUMAN)
           {

           // Get the first PC on the list
           object oPC = GetFirstPC();
           // big race relations while loop
           while (GetIsObjectValid(oPC)  == TRUE)
               {

               // get oPC's race
               int iClan = GetRacialType(oPC);

               // ELVES
               // d2 switch. 1= set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_ELF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // DWARVES
               // set oEntering friendly to dwarves
               if (iClan == RACIAL_TYPE_DWARF)
                   {
                   SetIsTemporaryFriend(oPC,oEntering,FALSE);
                    }

               // HALFELVES
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_HALFELF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFLINGS
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_HALFLING)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HUMANS
               // of course, humans are friendly to other humans
               if (iClan == RACIAL_TYPE_HUMAN)
                   {
                   SetIsTemporaryFriend(oPC,oEntering,FALSE);
                   }

                // d2 switch.  1 = set them friendly, 2 = set them neutral
                if (iClan == RACIAL_TYPE_GNOME)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFORCS
               // d2 switch. 1 = set them neutral, 2 = set them hostile
               if (iClan == RACIAL_TYPE_HALFORC)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryEnemy(oPC,oEntering,FALSE);
                           }
                       }
                   }
               }
           oPC = GetNextPC();
           }

   // if oEntering is an elf, adjust relations accordingly
   if (iRace == RACIAL_TYPE_ELF)
       {
           // Get the first PC on the list
           object oPC = GetFirstPC();
           // big race relations while loop
           while (GetIsObjectValid(oPC)  == TRUE)
               {

               // get oPC's race
               int iClan = GetRacialType(oPC);

               // ELVES
               // Elves are friendly with other elves
               if (iClan == RACIAL_TYPE_ELF)
                   {
                   SetIsTemporaryFriend(oPC,oEntering,FALSE);
                   }

               // set oEntering neutral to dwarves
               if (iClan == RACIAL_TYPE_DWARF)
                   {
                   SetIsTemporaryFriend(oPC,oEntering,FALSE);
                    }

               // HALFELVES
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_HALFELF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFLINGS
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_HALFLING)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HUMANS
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_HUMAN)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // GNOMES
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_GNOME)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFORCS
               // d2 switch.  1 = set them friendly, 2 = set them hostile
               if (iClan == RACIAL_TYPE_HALFORC)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryEnemy(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }
               }
           // Reset the Loop
           oPC = GetNextPC();
           }

   // if oEntering is a dwarf, adjust relations accordingly
   if (iRace == RACIAL_TYPE_DWARF)
       {

           // Get the first PC on the list
           object oPC = GetFirstPC();
           // big race relations while loop
           while (GetIsObjectValid(oPC)  == TRUE)
               {

               // get oPC's race
               int iClan = GetRacialType(oPC);

               // ELVES
               // d2 switch. 1= set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_ELF)
               {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // DWARVES
               // Dwarves are friendly to other dwarve
               if (iClan == RACIAL_TYPE_DWARF)
                   {
                   SetIsTemporaryFriend(oPC,oEntering,FALSE);
                   }

               // HALFELVES
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_HALFELF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFLINGS
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_HALFLING)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

                // HUMANS
                // d2 switch.  1 = set them friendly, 2 = set them neutral
                if (iClan == RACIAL_TYPE_HUMAN)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // GNOMES
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_GNOME)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFORCS
               // d2 switch.  1 = set them friendly, 2 = set them hostile
               if (iClan == RACIAL_TYPE_HALFORC)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryEnemy(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }
               }
           // Reset the Loop
           oPC = GetNextPC();
           }

   // If oEntering is a half-elf, adjust relations accordingly
   if (iRace == RACIAL_TYPE_HALFELF)
       {

           // Get the first PC on the list
           object oPC = GetFirstPC();
           // big race relations while loop
           while (GetIsObjectValid(oPC)  == TRUE)
               {

               // get oPC's race
               int iClan = GetRacialType(oPC);

               // ELVES
               // d2 switch. 1= set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_ELF)
               {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // DWARVES
               // d2 switch. 1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_DWARF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFELVES
               // Halfelves are friendly to other halfelves
               if (iClan = RACIAL_TYPE_HALFELF)
                   {
                   SetIsTemporaryFriend(oPC,oEntering,FALSE);
                   }

               // HALFLINGS
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_HALFLING)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

                // HUMANS
                // d2 switch.  1 = set them friendly, 2 = set them neutral
                if (iClan == RACIAL_TYPE_HUMAN)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // GNOMES
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_GNOME)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFORCS
               // d2 switch.  1 = set them friendly, 2 = set them hostile
               if (iClan == RACIAL_TYPE_HALFORC)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryEnemy(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }
               }
           // Reset the Loop
           oPC = GetNextPC();
           }

   // If oEntering is a Gnome, adjust relations accordingly
   if (iRace == RACIAL_TYPE_GNOME)
       {

           // Get the first PC on the list
           object oPC = GetFirstPC();
           // big race relations while loop
           while (GetIsObjectValid(oPC)  == TRUE)
               {

               // get oPC's race
               int iClan = GetRacialType(oPC);

               // ELVES
               // d2 switch. 1= set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_ELF)
               {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // DWARVES
               // d2 switch. 1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_DWARF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFELVES
               // Sets them neutral
               if (iClan = RACIAL_TYPE_HALFELF)
                   {
                   SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                   }

               // HALFLINGS
               // d2 switch.  1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_HALFLING)
                   {
                   SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                   }

                // HUMANS
                // d2 switch.  1 = set them friendly, 2 = set them neutral
                if (iClan == RACIAL_TYPE_HUMAN)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // GNOMES
               // Gnomes are friendly to other gnomes
               if (iClan == RACIAL_TYPE_GNOME)
                   {
                   SetIsTemporaryFriend(oPC,oEntering,FALSE);
                   }

               // HALFORCS
               // Sets them neutral
               if (iClan == RACIAL_TYPE_HALFORC)
                   {
                   SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                   }
               }
           // Reset the Loop
           oPC = GetNextPC();
           }

   // If oEntering is a Halfling, adjust relations accordingly
   if (iRace == RACIAL_TYPE_HALFLING)
       {

           // Get the first PC on the list
           object oPC = GetFirstPC();
           // big race relations while loop
           while (GetIsObjectValid(oPC)  == TRUE)
               {

               // get oPC's race
               int iClan = GetRacialType(oPC);

               // ELVES
               // d2 switch. 1= set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_ELF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // DWARVES
               // d2 switch. 1 = set them friendly, 2 = set them neutral
               if (iClan == RACIAL_TYPE_DWARF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFELVES
               // Sets them neutral
               if (iClan = RACIAL_TYPE_HALFELF)
                   {
                   SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                   }

               // HALFLINGS
               //  Halflings are friendly to other halflings
               if (iClan == RACIAL_TYPE_HALFLING)
                   {
                   SetIsTemporaryFriend(oPC,oEntering,FALSE);
                   }

                // HUMANS
                // d2 switch.  1 = set them friendly, 2 = set them neutral
                if (iClan == RACIAL_TYPE_HUMAN)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // GNOMES
               // Gnomes are friendly to other gnomes
               if (iClan == RACIAL_TYPE_GNOME)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryFriend(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFORCS
               // Sets them neutral
               if (iClan == RACIAL_TYPE_HALFORC)
                   {
                   SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                   }
               }
           // Reset the Loop
           oPC = GetNextPC();
           }

   // If oEntering is a Halforc, adjust relations accordingly
   if (iRace == RACIAL_TYPE_HALFORC)
       {

           // Get the first PC on the list
           object oPC = GetFirstPC();
           // big race relations while loop
           while (GetIsObjectValid(oPC)  == TRUE)
               {

               // get oPC's race
               int iClan = GetRacialType(oPC);

               // ELVES
               // d2 switch. 1= set them neutral, 2 = set them hostile
               if (iClan == RACIAL_TYPE_ELF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryEnemy(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // DWARVES
               // sets them neutral
               if (iClan == RACIAL_TYPE_DWARF)
                   {
                   SetIsTemporaryFriend(oPC,oEntering,FALSE);
                   }

               // HALFELVES
               // d2 switch. 1 = set them neutral, 2 = set them hostile
               if (iClan = RACIAL_TYPE_HALFELF)
                   {
                   switch (d2())
                       {
                       case 1:
                           {
                           SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                           }
                       case 2:
                           {
                           SetIsTemporaryEnemy(oPC,oEntering,FALSE);
                           }
                       }
                   }

               // HALFLINGS
               //  sets them neutral
               if (iClan == RACIAL_TYPE_HALFLING)
                   {
                   SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                   }

                // HUMANS
                // d2 switch.  1 = set them friendly, 2 = set them neutral
                if (iClan == RACIAL_TYPE_HUMAN)
                   {
                   SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                   }

               // GNOMES
               // sets them neutral
               if (iClan == RACIAL_TYPE_GNOME)
                   {
                   SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                   }

               // HALFORCS
               // Halforcs are friendly to other halforcs
               if (iClan == RACIAL_TYPE_HALFORC)
                   {
                   SetIsTemporaryNeutral(oPC,oEntering,FALSE);
                   }
               }
           // Reset the Loop
           oPC = GetNextPC();
           }
   }
}
// THE END

Pretty much is kinda close to what I would like to work with. So I just might see if I can work on this and see if I can use it towards a Subrace instead of RACIAL_TYPE_