Anvil
Anvil.API.NwFaction Class Reference

The faction info of a Creature/Player/GameObject. More...

+ Inheritance diagram for Anvil.API.NwFaction:
+ Collaboration diagram for Anvil.API.NwFaction:

Public Member Functions

void AdjustReputation (NwCreature creature, int adjustment)
 Adjusts how this faction feels about the specified creature. More...
 
bool Equals (NwFaction? other)
 
override bool Equals (object? obj)
 
int GetAverageReputation (NwGameObject target)
 Gets an integer between 0 and 100 (inclusive) that represents how this faction feels about the specified target.
-> 0-10 means this faction is hostile to the target
-> 11-89 means this faction is neutral to the target
-> 90-100 means this faction is friendly to the target.
More...
 
NwCreature GetBestACMember (NwCreature? referenceCreature=null, bool visible=false)
 Gets the member with the highest AC in this faction. More...
 
override int GetHashCode ()
 
NwCreature GetLeastDamagedMember (NwCreature? referenceCreature=null, bool visible=false)
 Gets the least damaged member in this faction that is visible from the specified object. More...
 
List< NwCreatureGetMembers ()
 Gets all creatures that are members of this faction.
More...
 
NwCreature GetMostDamagedMember (NwCreature? referenceCreature=null, bool visible=false)
 Gets the most damaged member in this faction that is visible from the specified object. More...
 
int GetReputation (NwGameObject target)
 Gets an integer between 0 and 100 (inclusive) that represents how this faction feels about the specified target.
-> 0-10 means this faction is hostile to the target
-> 11-89 means this faction is neutral to the target
-> 90-100 means this faction is friendly to the target. More...
 
NwCreature GetStrongestMember (NwCreature? referenceCreature=null, bool visible=false)
 Gets the strongest member in this faction that is visible from the specified object. More...
 
NwCreature GetWeakestMember (NwCreature? referenceCreature=null, bool visible=false)
 Gets the weakest member in this faction that is visible from the specified object. More...
 
NwCreature GetWorstACMember (NwCreature? referenceCreature=null, bool visible=false)
 Gets the member with the lowest AC in this faction that is visible from the specified object. More...
 
void SetReputation (NwGameObject target, int newReputation)
 Sets how this faction feels about the specified creature.
-> 0-10 means this faction is hostile to the target.
-> 11-89 means this faction is neutral to the target.
-> 90-100 means this faction is friendly to the target. More...
 

Static Public Member Functions

static ? NwFaction FromFactionId (int factionId)
 Resolves a NwFaction from a faction id. More...
 
static ? NwFaction FromStandardFaction (StandardFaction factionType)
 Resolves a NwFaction from a StandardFaction. More...
 
static implicit operator NwFaction? (StandardFaction faction)
 
static bool operator!= (NwFaction left, NwFaction right)
 
static bool operator== (NwFaction? left, NwFaction? right)
 

Properties

int AverageGoodEvilAlignment [get]
 Gets the average Good/Evil alignment value of members in this faction.
More...
 
int AverageLawChaosAlignment [get]
 Gets the average Law/Chaos alignment value of members in this faction.
More...
 
int AverageLevel [get]
 Gets the average level of members in this faction.
More...
 
int AverageXP [get]
 Gets the average amount of XP of members in this faction.
More...
 
static IReadOnlyList< NwFactionFactions [get]
 Gets a list of all active factions. More...
 
int Gold [get]
 Gets the total amount of gold held by all members of this party.
More...
 
int Id [get]
 Gets the id of this faction. More...
 
NwPlayerLeader [get]
 Gets the leader of this player faction (party).
More...
 
NwClass MostFrequentClass [get]
 Gets the most common type of class among the members of this faction/party.
More...
 
StandardFaction StandardFactionType [get]
 Gets the StandardFaction type of this faction.
If this is a player or custom faction, returns an out-of-range value. More...
 

Detailed Description

The faction info of a Creature/Player/GameObject.

Member Function Documentation

◆ AdjustReputation()

void Anvil.API.NwFaction.AdjustReputation ( NwCreature  creature,
int  adjustment 
)
inline

Adjusts how this faction feels about the specified creature.

Parameters
creatureThe target creature for the reputation change.
adjustmentThe adjustment in reputation to make.

◆ FromFactionId()

static ? NwFaction Anvil.API.NwFaction.FromFactionId ( int  factionId)
inlinestatic

Resolves a NwFaction from a faction id.

Parameters
factionIdThe id of the faction to resolve.
Returns
The associated NwFaction instance. Null if the faction id is invalid.

◆ FromStandardFaction()

static ? NwFaction Anvil.API.NwFaction.FromStandardFaction ( StandardFaction  factionType)
inlinestatic

Resolves a NwFaction from a StandardFaction.

Parameters
factionTypeThe faction type to resolve.
Returns
The associated NwFaction instance. Null if the faction type is invalid.

◆ GetAverageReputation()

int Anvil.API.NwFaction.GetAverageReputation ( NwGameObject  target)
inline

Gets an integer between 0 and 100 (inclusive) that represents how this faction feels about the specified target.
-> 0-10 means this faction is hostile to the target
-> 11-89 means this faction is neutral to the target
-> 90-100 means this faction is friendly to the target.

Parameters
targetThe target object to check.

◆ GetBestACMember()

NwCreature Anvil.API.NwFaction.GetBestACMember ( NwCreature referenceCreature = null,
bool  visible = false 
)
inline

Gets the member with the highest AC in this faction.

Parameters
referenceCreatureThe reference creature. Bonuses and penalties against the reference creature will be considered when finding the best AC member.
visibleHighly recommended to set to "true" on large NPC factions. Includes only creatures visible to referenceCreature.

◆ GetLeastDamagedMember()

NwCreature Anvil.API.NwFaction.GetLeastDamagedMember ( NwCreature referenceCreature = null,
bool  visible = false 
)
inline

Gets the least damaged member in this faction that is visible from the specified object.

Parameters
referenceCreatureThe reference creature, used to determine visibility.
visibleHighly recommended to set to "true" on large NPC factions. Includes only creatures visible to referenceCreature.

◆ GetMembers()

List<NwCreature> Anvil.API.NwFaction.GetMembers ( )
inline

Gets all creatures that are members of this faction.

Note
This can be a very costly operation when used on large NPC factions.
Returns
All creatures in this faction.

◆ GetMostDamagedMember()

NwCreature Anvil.API.NwFaction.GetMostDamagedMember ( NwCreature referenceCreature = null,
bool  visible = false 
)
inline

Gets the most damaged member in this faction that is visible from the specified object.

Parameters
referenceCreatureThe reference creature, used to determine visibility.
visibleHighly recommended to set to "true" on large NPC factions. Includes only creatures visible to referenceCreature.

◆ GetReputation()

int Anvil.API.NwFaction.GetReputation ( NwGameObject  target)
inline

Gets an integer between 0 and 100 (inclusive) that represents how this faction feels about the specified target.
-> 0-10 means this faction is hostile to the target
-> 11-89 means this faction is neutral to the target
-> 90-100 means this faction is friendly to the target.

Parameters
targetThe target object.
Returns
0-100 (inclusive) based on the standing of the target within this standard faction.

◆ GetStrongestMember()

NwCreature Anvil.API.NwFaction.GetStrongestMember ( NwCreature referenceCreature = null,
bool  visible = false 
)
inline

Gets the strongest member in this faction that is visible from the specified object.

Parameters
referenceCreatureThe reference creature. Bonuses and penalties against the reference creature will be considered when finding the strongest member.
visibleHighly recommended to set to "true" on large NPC factions. Includes only creatures visible to referenceCreature.

◆ GetWeakestMember()

NwCreature Anvil.API.NwFaction.GetWeakestMember ( NwCreature referenceCreature = null,
bool  visible = false 
)
inline

Gets the weakest member in this faction that is visible from the specified object.

Parameters
referenceCreatureThe reference creature. Bonuses and penalties against the reference creature will be considered when finding the weakest member.
visibleHighly recommended to set to "true" on large NPC factions. Includes only creatures visible to referenceCreature.

◆ GetWorstACMember()

NwCreature Anvil.API.NwFaction.GetWorstACMember ( NwCreature referenceCreature = null,
bool  visible = false 
)
inline

Gets the member with the lowest AC in this faction that is visible from the specified object.

Parameters
referenceCreatureThe reference creature. Bonuses and penalties against the reference creature will be considered when finding the worst AC member.
visibleHighly recommended to set to "true" on large NPC factions. Includes only creatures visible to referenceCreature.

◆ SetReputation()

void Anvil.API.NwFaction.SetReputation ( NwGameObject  target,
int  newReputation 
)
inline

Sets how this faction feels about the specified creature.
-> 0-10 means this faction is hostile to the target.
-> 11-89 means this faction is neutral to the target.
-> 90-100 means this faction is friendly to the target.

Parameters
targetThe target object.
newReputationA value between 0-100 (inclusive).

Property Documentation

◆ AverageGoodEvilAlignment

int Anvil.API.NwFaction.AverageGoodEvilAlignment
get

Gets the average Good/Evil alignment value of members in this faction.

Note
This can be a costly operation when used on large NPC factions.

◆ AverageLawChaosAlignment

int Anvil.API.NwFaction.AverageLawChaosAlignment
get

Gets the average Law/Chaos alignment value of members in this faction.

Note
This can be a costly operation when used on large NPC factions.

◆ AverageLevel

int Anvil.API.NwFaction.AverageLevel
get

Gets the average level of members in this faction.

Note
This can be a costly operation when used on large NPC factions.

◆ AverageXP

int Anvil.API.NwFaction.AverageXP
get

Gets the average amount of XP of members in this faction.

Note
This can be a costly operation when used on large NPC factions.

◆ Factions

IReadOnlyList<NwFaction> Anvil.API.NwFaction.Factions
staticget

Gets a list of all active factions.

◆ Gold

int Anvil.API.NwFaction.Gold
get

Gets the total amount of gold held by all members of this party.

Note
This can be a costly operation when used on large NPC factions.

◆ Id

int Anvil.API.NwFaction.Id
get

Gets the id of this faction.

◆ Leader

NwPlayer? Anvil.API.NwFaction.Leader
get

Gets the leader of this player faction (party).

◆ MostFrequentClass

NwClass Anvil.API.NwFaction.MostFrequentClass
get

Gets the most common type of class among the members of this faction/party.

Note
This can be a costly operation when used on large NPC factions.

◆ StandardFactionType

StandardFaction Anvil.API.NwFaction.StandardFactionType
get

Gets the StandardFaction type of this faction.
If this is a player or custom faction, returns an out-of-range value.


The documentation for this class was generated from the following file: