Table of Contents

Class Hero

Namespace
TaleWorlds.CampaignSystem
Assembly
TaleWorlds.CampaignSystem.dll
public sealed class Hero : MBObjectBase, ITrackableCampaignObject, ITrackableBase, IRandomOwner
Inheritance
Hero
Implements
Inherited Members
Extension Methods

Constructors

Hero()

public Hero()

Hero(string)

public Hero(string stringID)

Parameters

stringID string

Fields

BeardTags

[SaveableField(202)]
public string BeardTags

Field Value

string

Culture

[SaveableField(551)]
public CultureObject Culture

Field Value

CultureObject

HairTags

[SaveableField(201)]
public string HairTags

Field Value

string

HeroWoundedHealthLevel

public const int HeroWoundedHealthLevel = 20

Field Value

int

IsPregnant

[SaveableField(760)]
public bool IsPregnant

Field Value

bool

LastTimeStampForActivity

[SaveableField(120)]
public int LastTimeStampForActivity

Field Value

int

Level

[SaveableField(370)]
public int Level

Field Value

int

MaximumNumberOfVolunteers

public const int MaximumNumberOfVolunteers = 6

Field Value

int

SpcDaysInLocation

[SaveableField(420)]
public int SpcDaysInLocation

Field Value

int

SpecialItems

[SaveableField(590)]
public MBList<ItemObject> SpecialItems

Field Value

MBList<ItemObject>

TattooTags

[SaveableField(203)]
public string TattooTags

Field Value

string

VolunteerTypes

[SaveableField(130)]
public CharacterObject[] VolunteerTypes

Field Value

CharacterObject[]

Properties

Age

public float Age { get; }

Property Value

float

AllAliveHeroes

public static MBReadOnlyList<Hero> AllAliveHeroes { get; }

Property Value

MBReadOnlyList<Hero>

BannerItem

public EquipmentElement BannerItem { get; set; }

Property Value

EquipmentElement

BattleEquipment

public Equipment BattleEquipment { get; }

Property Value

Equipment

BirthDay

public CampaignTime BirthDay { get; }

Property Value

CampaignTime

BodyProperties

public BodyProperties BodyProperties { get; }

Property Value

BodyProperties

BornSettlement

public Settlement BornSettlement { get; set; }

Property Value

Settlement

Build

[SaveableProperty(112)]
public float Build { get; set; }

Property Value

float

CanBeCompanion

public bool CanBeCompanion { get; }

Property Value

bool

CanHaveRecruits

public bool CanHaveRecruits { get; }

Property Value

bool

CaptivityStartTime

[SaveableProperty(240)]
public CampaignTime CaptivityStartTime { get; set; }

Property Value

CampaignTime

CharacterObject

public CharacterObject CharacterObject { get; }

Property Value

CharacterObject

Children

public MBList<Hero> Children { get; }

Property Value

MBList<Hero>

CivilianEquipment

public Equipment CivilianEquipment { get; }

Property Value

Equipment

Clan

public Clan Clan { get; set; }

Property Value

Clan

ClanBanner

public Banner ClanBanner { get; }

Property Value

Banner

CompanionOf

public Clan CompanionOf { get; set; }

Property Value

Clan

CompanionsInParty

public IEnumerable<Hero> CompanionsInParty { get; }

Property Value

IEnumerable<Hero>

CurrentSettlement

public Settlement CurrentSettlement { get; }

Property Value

Settlement

DeadOrDisabledHeroes

public static MBReadOnlyList<Hero> DeadOrDisabledHeroes { get; }

Property Value

MBReadOnlyList<Hero>

DeathDay

public CampaignTime DeathDay { get; set; }

Property Value

CampaignTime

DeathMark

[SaveableProperty(400)]
public KillCharacterAction.KillCharacterActionDetail DeathMark { get; }

Property Value

KillCharacterAction.KillCharacterActionDetail

DeathMarkKillerHero

[SaveableProperty(401)]
public Hero DeathMarkKillerHero { get; }

Property Value

Hero
public string EncyclopediaLink { get; }

Property Value

string

EncyclopediaLinkWithName

public TextObject EncyclopediaLinkWithName { get; }

Property Value

TextObject

EncyclopediaText

[SaveableProperty(190)]
public TextObject EncyclopediaText { get; set; }

Property Value

TextObject

ExSpouses

public MBReadOnlyList<Hero> ExSpouses { get; }

Property Value

MBReadOnlyList<Hero>

Father

public Hero Father { get; set; }

Property Value

Hero

FirstName

public TextObject FirstName { get; }

Property Value

TextObject

Gold

public int Gold { get; set; }

Property Value

int

GovernorOf

public Town GovernorOf { get; set; }

Property Value

Town

HasMet

public bool HasMet { get; }

Property Value

bool

HeroDeveloper

public IHeroDeveloper HeroDeveloper { get; }

Property Value

IHeroDeveloper

HeroState

public Hero.CharacterStates HeroState { get; }

Property Value

Hero.CharacterStates

HitPoints

public int HitPoints { get; set; }

Property Value

int

HomeSettlement

public Settlement HomeSettlement { get; }

Property Value

Settlement

IsActive

public bool IsActive { get; }

Property Value

bool

IsAlive

public bool IsAlive { get; }

Property Value

bool

IsArtisan

public bool IsArtisan { get; }

Property Value

bool

IsChild

public bool IsChild { get; }

Property Value

bool

IsClanLeader

public bool IsClanLeader { get; }

Property Value

bool

IsCommander

public bool IsCommander { get; }

Property Value

bool

IsDead

public bool IsDead { get; }

Property Value

bool

IsDisabled

public bool IsDisabled { get; }

Property Value

bool

IsFactionLeader

public bool IsFactionLeader { get; }

Property Value

bool

IsFemale

[SaveableProperty(200)]
public bool IsFemale { get; }

Property Value

bool

IsFugitive

public bool IsFugitive { get; }

Property Value

bool

IsGangLeader

public bool IsGangLeader { get; }

Property Value

bool

IsHeadman

public bool IsHeadman { get; }

Property Value

bool

IsHumanPlayerCharacter

public bool IsHumanPlayerCharacter { get; }

Property Value

bool

IsKingdomLeader

public bool IsKingdomLeader { get; }

Property Value

bool

IsKnownToPlayer

public bool IsKnownToPlayer { get; set; }

Property Value

bool

IsLord

public bool IsLord { get; }

Property Value

bool

IsMainHeroIll

public static bool IsMainHeroIll { get; }

Property Value

bool

IsMerchant

public bool IsMerchant { get; }

Property Value

bool

IsMinorFactionHero

[SaveableProperty(320)]
public bool IsMinorFactionHero { get; set; }

Property Value

bool

IsNoncombatant

public bool IsNoncombatant { get; }

Property Value

bool

IsNotSpawned

public bool IsNotSpawned { get; }

Property Value

bool

IsNotable

public bool IsNotable { get; }

Property Value

bool

IsPartyLeader

public bool IsPartyLeader { get; }

Property Value

bool

IsPlayerCompanion

public bool IsPlayerCompanion { get; }

Property Value

bool

IsPreacher

public bool IsPreacher { get; }

Property Value

bool

IsPrisoner

public bool IsPrisoner { get; }

Property Value

bool

IsRebel

public bool IsRebel { get; }

Property Value

bool

IsReleased

public bool IsReleased { get; }

Property Value

bool

IsRuralNotable

public bool IsRuralNotable { get; }

Property Value

bool

IsSpecial

public bool IsSpecial { get; }

Property Value

bool

IsTemplate

public bool IsTemplate { get; }

Property Value

bool

IsTraveling

public bool IsTraveling { get; }

Property Value

bool

IsUrbanNotable

public bool IsUrbanNotable { get; }

Property Value

bool

IsWanderer

public bool IsWanderer { get; }

Property Value

bool

IsWounded

public bool IsWounded { get; }

Property Value

bool

Issue

public IssueBase Issue { get; }

Property Value

IssueBase

LastExaminedLogEntryID

[SaveableProperty(481)]
public long LastExaminedLogEntryID { get; set; }

Property Value

long

LastKnownClosestSettlement

[SaveableProperty(411)]
public Settlement LastKnownClosestSettlement { get; }

Property Value

Settlement

LastMeetingTimeWithPlayer

[SaveableProperty(620)]
public CampaignTime LastMeetingTimeWithPlayer { get; set; }

Property Value

CampaignTime

MainHero

public static Hero MainHero { get; }

Property Value

Hero

MapFaction

public IFaction MapFaction { get; }

Property Value

IFaction

MaxHitPoints

public int MaxHitPoints { get; }

Property Value

int

Mother

public Hero Mother { get; set; }

Property Value

Hero

Name

public TextObject Name { get; }

Property Value

TextObject

Occupation

[SaveableProperty(780)]
public Occupation Occupation { get; }

Property Value

Occupation

OneToOneConversationHero

public static Hero OneToOneConversationHero { get; }

Property Value

Hero

OwnedAlleys

public List<Alley> OwnedAlleys { get; }

Property Value

List<Alley>

OwnedCaravans

public List<CaravanPartyComponent> OwnedCaravans { get; }

Property Value

List<CaravanPartyComponent>

OwnedWorkshops

public MBReadOnlyList<Workshop> OwnedWorkshops { get; }

Property Value

MBReadOnlyList<Workshop>

PartyBelongedTo

public MobileParty PartyBelongedTo { get; }

Property Value

MobileParty

PartyBelongedToAsPrisoner

[SaveableProperty(570)]
public PartyBase PartyBelongedToAsPrisoner { get; }

Property Value

PartyBase

PassedTimeAtHomeSettlement

public float PassedTimeAtHomeSettlement { get; set; }

Property Value

float

Power

public float Power { get; }

Property Value

float

PreferredUpgradeFormation

[SaveableProperty(800)]
public FormationClass PreferredUpgradeFormation { get; set; }

Property Value

FormationClass

ProbabilityOfDeath

public float ProbabilityOfDeath { get; }

Property Value

float

RandomValue

[SaveableProperty(660)]
public int RandomValue { get; }

Property Value

int

Siblings

public IEnumerable<Hero> Siblings { get; }

Property Value

IEnumerable<Hero>

Spouse

public Hero Spouse { get; set; }

Property Value

Hero

StayingInSettlement

public Settlement StayingInSettlement { get; set; }

Property Value

Settlement

SupporterOf

public Clan SupporterOf { get; set; }

Property Value

Clan

Template

public CharacterObject Template { get; }

Property Value

CharacterObject

Weight

[SaveableProperty(111)]
public float Weight { get; set; }

Property Value

float

Methods

AddDeathMark(Hero, KillCharacterActionDetail)

public void AddDeathMark(Hero killerHero = null, KillCharacterAction.KillCharacterActionDetail deathMarkDetail = KillCharacterActionDetail.None)

Parameters

killerHero Hero
deathMarkDetail KillCharacterAction.KillCharacterActionDetail

AddInfluenceWithKingdom(float)

public void AddInfluenceWithKingdom(float additionalInfluence)

Parameters

additionalInfluence float

AddOwnedWorkshop(Workshop)

public void AddOwnedWorkshop(Workshop workshop)

Parameters

workshop Workshop

AddPower(float)

public void AddPower(float value)

Parameters

value float

AddSkillXp(SkillObject, float)

public void AddSkillXp(SkillObject skill, float xpAmount)

Parameters

skill SkillObject
xpAmount float

AfterLoad()

protected override void AfterLoad()

AssignVoice()

public string AssignVoice()

Returns

string

AutoGeneratedInstanceCollectObjects(List<object>)

protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)

Parameters

collectedObjects List<object>

CanBeGovernorOrHavePartyRole()

public bool CanBeGovernorOrHavePartyRole()

Returns

bool

CanBecomePrisoner()

public bool CanBecomePrisoner()

Returns

bool

CanDie(KillCharacterActionDetail)

public bool CanDie(KillCharacterAction.KillCharacterActionDetail causeOfDeath)

Parameters

causeOfDeath KillCharacterAction.KillCharacterActionDetail

Returns

bool

CanHaveQuestsOrIssues()

public bool CanHaveQuestsOrIssues()

Returns

bool

CanHeroEquipmentBeChanged()

public bool CanHeroEquipmentBeChanged()

Returns

bool

CanLeadParty()

public bool CanLeadParty()

Returns

bool

CanMarry()

public bool CanMarry()

Returns

bool

CanMoveToSettlement()

public bool CanMoveToSettlement()

Returns

bool

ChangeHeroGold(int)

public void ChangeHeroGold(int changeAmount)

Parameters

changeAmount int

ChangeState(CharacterStates)

public void ChangeState(Hero.CharacterStates newState)

Parameters

newState Hero.CharacterStates

CheckInvalidEquipmentsAndReplaceIfNeeded()

public void CheckInvalidEquipmentsAndReplaceIfNeeded()

CheckTracked(BasicCharacterObject)

public bool CheckTracked(BasicCharacterObject basicCharacter)

Parameters

basicCharacter BasicCharacterObject

Returns

bool

ClearAttributes()

public void ClearAttributes()

ClearPerks()

public void ClearPerks()

ClearSkills()

public void ClearSkills()

ClearTraits()

public void ClearTraits()

CreateHero(string)

public static Hero CreateHero(string stringID)

Parameters

stringID string

Returns

Hero

Deserialize(MBObjectManager, XmlNode)

public override void Deserialize(MBObjectManager objectManager, XmlNode node)

Parameters

objectManager MBObjectManager
node XmlNode

FindAll(Func<Hero, bool>)

public static IEnumerable<Hero> FindAll(Func<Hero, bool> predicate)

Parameters

predicate Func<Hero, bool>

Returns

IEnumerable<Hero>

FindFirst(Func<Hero, bool>)

public static Hero FindFirst(Func<Hero, bool> predicate)

Parameters

predicate Func<Hero, bool>

Returns

Hero

GetAttributeValue(CharacterAttribute)

public int GetAttributeValue(CharacterAttribute charAttribute)

Parameters

charAttribute CharacterAttribute

Returns

int

GetBaseHeroRelation(Hero)

public int GetBaseHeroRelation(Hero otherHero)

Parameters

otherHero Hero

Returns

int

GetHeroTraits()

public CharacterTraits GetHeroTraits()

Returns

CharacterTraits

GetMapPoint()

public IMapPoint GetMapPoint()

Returns

IMapPoint

GetPerkValue(PerkObject)

public bool GetPerkValue(PerkObject perk)

Parameters

perk PerkObject

Returns

bool

GetPosition()

public Vec3 GetPosition()

Returns

Vec3

GetRelation(Hero)

public int GetRelation(Hero otherHero)

Parameters

otherHero Hero

Returns

int

GetRelationWithPlayer()

public float GetRelationWithPlayer()

Returns

float

GetSkillValue(SkillObject)

public int GetSkillValue(SkillObject skill)

Parameters

skill SkillObject

Returns

int

GetTrackDistanceToMainAgent()

public float GetTrackDistanceToMainAgent()

Returns

float

GetTraitLevel(TraitObject)

public int GetTraitLevel(TraitObject trait)

Parameters

trait TraitObject

Returns

int

GetUnmodifiedClanLeaderRelationshipWithPlayer()

public float GetUnmodifiedClanLeaderRelationshipWithPlayer()

Returns

float

Heal(int, bool)

public void Heal(int healAmount, bool addXp = false)

Parameters

healAmount int
addXp bool

Init()

public void Init()

IsEnemy(Hero)

public bool IsEnemy(Hero otherHero)

Parameters

otherHero Hero

Returns

bool

IsFriend(Hero)

public bool IsFriend(Hero otherHero)

Parameters

otherHero Hero

Returns

bool

IsHealthFull()

public bool IsHealthFull()

Returns

bool

IsNeutral(Hero)

public bool IsNeutral(Hero otherHero)

Parameters

otherHero Hero

Returns

bool

MakeWounded(Hero, KillCharacterActionDetail)

public void MakeWounded(Hero killerHero = null, KillCharacterAction.KillCharacterActionDetail deathMarkDetail = KillCharacterActionDetail.None)

Parameters

killerHero Hero
deathMarkDetail KillCharacterAction.KillCharacterActionDetail

ModifyHair(int, int, int)

public void ModifyHair(int hair, int beard, int tattoo)

Parameters

hair int
beard int
tattoo int

ModifyPlayersFamilyAppearance(StaticBodyProperties)

public void ModifyPlayersFamilyAppearance(StaticBodyProperties staticBodyProperties)

Parameters

staticBodyProperties StaticBodyProperties

OnIssueCreatedForHero(IssueBase)

public void OnIssueCreatedForHero(IssueBase issue)

Parameters

issue IssueBase

OnIssueDeactivatedForHero()

public void OnIssueDeactivatedForHero()

PreAfterLoad()

protected override void PreAfterLoad()

RemoveOwnedWorkshop(Workshop)

public void RemoveOwnedWorkshop(Workshop workshop)

Parameters

workshop Workshop

ResetEquipments()

public void ResetEquipments()

SetBirthDay(CampaignTime)

public void SetBirthDay(CampaignTime birthday)

Parameters

birthday CampaignTime

SetCharacterObject(CharacterObject)

public void SetCharacterObject(CharacterObject characterObject)

Parameters

characterObject CharacterObject

SetHasMet()

public void SetHasMet()
public static TextObject SetHeroEncyclopediaTextAndLinks(Hero o)

Parameters

o Hero

Returns

TextObject

SetName(TextObject, TextObject)

public void SetName(TextObject fullName, TextObject firstName)

Parameters

fullName TextObject
firstName TextObject

SetNewOccupation(Occupation)

public void SetNewOccupation(Occupation occupation)

Parameters

occupation Occupation

SetPersonalRelation(Hero, int)

public void SetPersonalRelation(Hero otherHero, int value)

Parameters

otherHero Hero
value int

SetSkillValue(SkillObject, int)

public void SetSkillValue(SkillObject skill, int value)

Parameters

skill SkillObject
value int

SetTextVariables()

public void SetTextVariables()

SetTraitLevel(TraitObject, int)

public void SetTraitLevel(TraitObject trait, int value)

Parameters

trait TraitObject
value int

ToString()

public override string ToString()

Returns

string

UpdateHomeSettlement()

public void UpdateHomeSettlement()

UpdateLastKnownClosestSettlement(Settlement)

public void UpdateLastKnownClosestSettlement(Settlement settlement)

Parameters

settlement Settlement

UpdatePlayerGender(bool)

public void UpdatePlayerGender(bool isFemale)

Parameters

isFemale bool

This page was last modified at 09/01/2024 16:12:00 +00:00 (UTC).