it is used by the faction system which you can use if you wan't(but need to implement by yourself)
example from a race by me:
public OnWar3PluginReady()
{
thisRaceID=War3_CreateNewRaceT("malak");
SKILL_HAUNTING=War3_AddRaceSkillT(thisRaceID,"HauntingPast",false,4);
SKILL_SIGHT=War3_AddRaceSkillT(thisRaceID,"Sight",false,4);
SKILL_VISION=War3_AddRaceSkillT(thisRaceID,"Vision",false,4);
ULTIMATE=War3_AddRaceSkillT(thisRaceID,"Wave",true,4);
War3_CreateRaceEnd(thisRaceID);
W3Faction(thisRaceID,"Priests",true);
}
As you see there is a "W3Faction" command to assign the race to the faction "Priests".
but you need to tell the system which factions are friends or foes by using something like this:
W3FactionBehaviorByName("Priests","Undead",FactionBehavior:Enemy);
W3FactionBehaviorByName("Priests","Humans",FactionBehavior:Friend);
W3FactionBehaviorByName("Priests","Elves",FactionBehavior:Neutral);
and NOW it get's intresting, there are tons of new possibilities like creating a skill which will act completly different when attacking a enemy faction than a friendly.
here's a very simple example:
new Float:fPercent = fHauntingPercent[skill];
switch(W3FactionCompare(thisRaceID,War3_GetRace(victim)))
{
case (FactionBehavior:Friend):
{
fPercent-=0.15;
}
case (FactionBehavior:Enemy):
{
fPercent+=0.15;
}
}
if(War3_DealDamage(victim,(iLastDamage*fPercent/100),attacker,DMG_GENERIC,"hauntingpast",W3DMGORIGIN_SKILL,W3DMGTYPE_MAGIC)) {
iLastDamageValue[victim] = -1;
return;
}
this will increase the damage agains enemy factions and decrease it when attacking a friendly faction