GetFactionAverageReputation(object, object)

Get an integer between 0 and 100 (inclusive) that represents how an objects faction members collectively feel about the target object.

int GetFactionAverageReputation(
    object oSourceFactionMember,
    object oTarget
);

Parameters

oSourceFactionMember

The object whose collective faction value you wish to examine.

oTarget

The target object that you want to find out how the faction feels about.


Description

Returns an integer between 0 and 100 (inclusive) that represents how oSourceFactionMember's faction feels about oTarget.
Return value on error: -1



Remarks

Each member of a faction holds a reputation value for a specific creature at any given time during a game. It will default to their original faction value against the target creatures faction, but as the creatures in the game interact, this value will climb and fall for each of them individually. This function helps to gather an overview of how the entire faction feels about the target by looping through them and averaging the targets reputation with each of their values.


Version

1.22

Example

void main()
{
	// During a conversation with the local Innkeeper the Player says something which angers the InnKeep but does not affect the rest of the villagers.
	
	object oPlayer = GetPCSpeaker();
	object oInnKeeper = OBJECT_SELF;
	int nFactionRating;

	// Lower the faction rating of the Player with the Innkeepers Faction.
	AdjustReputation(oPlayer, oInnKeeper, -1);
	// Get the new rating of the Innkeeprs faction to the PCs.
	nFactionRating = GetFactionAverageReputation(oInnKeeper, oPlayer);
	
	// Inform the Player as to what happened.
	SendMessageToPC(oPlayer, "You have lost 1 point of faction with the Villagers.");
	// Tell the PC their current faction rating.
	SendMessageToPC(oPlayer, "You currently have a faction rating of " + IntToString(nFactionRating) + " with the all the Villagers");

}

See Also

functions: AdjustReputation | ClearPersonalReputation | GetReputation
categories: Get Data from Creature Functions | Math Functions | Reputation/Faction Functions


 author: John Shuell, editor: Kristian Markon
 Send comments on this topic.