C# Class ACR_CreatureBehavior.CreatureObject

This class represents a creature within the game.
Inheritance: ACR_CreatureBehavior.GameObject
Show file Open project: ALandFarAway/ALFA-Base-Resources Class Usage Examples

Public Properties

Property Type Description
AbilityDamaged bool
AbilityDrained bool
Blinded bool
Charmed bool
CleanUpNeeded bool
Confused bool
Cursed bool
Darkness bool
Dazed bool
Deaf bool
Diseased bool
Dominated bool
Entangled bool
Frightened bool
HasCombatRoundProcess bool
Insane bool
LevelDrain bool
MoveDown bool
OverrideTarget uint
Paralyzed bool
Petrified bool
Poisoned bool
Silenced bool
Sleeping bool
Slowed bool
Stunned bool
TacticsType AIParty.AIType
Turned bool
UsingEndCombatRound bool
Wounded bool

Public Methods

Method Description
CanAct ( ) : bool

This determines if the creature has any negative status effects which prevent actions in combat.

CreatureObject ( uint ObjectId, GameObjectManager ObjectManager ) : System

Construct a creature object and insert it into the object table.

DropParty ( ) : void
GetAlliesInMelee ( ) : int

This returns the number of allies who are near hostile opponents.

OnAttacked ( uint AttackerObjectId ) : void

Called when the creature is attacked.

OnBlocked ( uint BlockerObjectId ) : void

Called when the creature's movement is blocked.

OnConversation ( ) : void

Called when someone attempts to open a static conversation with the creature.

OnDamaged ( uint DamagerObjectId, int TotalDamageDealt ) : void

Called when the creature is damaged.

OnDeath ( uint KillerObjectId ) : void

Called when the creature dies.

OnEndCombatRound ( ) : void

Called at the end of a combat round, when direction for the next round of combat is necessary. This managed the bulk of action in combat.

OnHeartbeat ( ) : void

Called approximately every six seconds on an NPC, regardless of whether or not the NPC is in combat.

OnInventoryDisturbed ( ) : void

Called when a creature picks up or loses an item.

OnPerception ( uint PerceivedObjectId, bool Heard, bool Inaudible, bool Seen, bool Vanished ) : void

Called when the perception state of the creature changes.

OnRested ( ) : void

Called after a creature rests.

OnRundown ( ) : void

Called when the C# object state is being run down because the game engine half of the object has been deleted. This might occur after the fact.

OnSpawn ( ) : void

Called when the creature is spawned, immediately after the class' constructors are run. Responsible for establishing party membership.

OnSpellCastAt ( uint CasterObjectId, int SpellId ) : void

Called when a spell is cast on the creature.

OnUserDefined ( int UserDefinedEventNumber ) : void

Called whenever a builder invokes an event by script.

RefreshNegativeStatuses ( ) : void

This refreshes the public variables which track status afflictions on the creature.

SelectCombatRoundAction ( bool fromAllyCall ) : void

This function is the primary means by which actions are selected for a given combat round.

TryRemoveStatusAfflictions ( CreatureObject HealTarget ) : bool

This will look for status afflictions that need healing.

TryRemoveUrgentStatusAfflictions ( CreatureObject HealTarget ) : bool

This will look for the most-urgent disabling status afflictions on HealTarget and attempt to cure them.

TryToAttackMelee ( bool PrioritizeSoftTargets = false, bool DistributeAttacks = false ) : bool
TryToAttackRanged ( ) : bool

This function causes Creature to switch to ranged weapons, if the weapon wielded isn't already ranged, and attack from a distance.

TryToBuffAll ( ) : bool

This will search for an ability to buff an ally, or oneself, which is not already applied to its target.

TryToDebuffAll ( ) : bool

This attempts to find a valid place to put down large field-altering effects, and destructive (but dangerous and indiscriminate) spells. It will attempt to avoid friendly fire, but might hit allies who just happen to be within the area of effect anyway.

TryToDebuffCareful ( ) : bool

This attempts to find a place to send an attack which either only harms enemies or which only harms single targets.

TryToHeal ( CreatureObject HealTarget, int HitPoints ) : bool

This will search for an ability that will directly restore about HitPoints of hit points and use it on HealTarget

TryToHealAll ( ) : bool

This will look for an action that will improve the condition of the party.

_AttackWrapper ( CreatureObject AttackTarget ) : bool

This serves as a wrapper about calls to ActionAttack, to apply things like the uncanny dodge modifiers

Private Methods

Method Description
CallToFriends ( ) : void

This method speaks a string of the creature calling out to its friends that it has spotted trouble.

OnPerceptionHeardObject ( uint PerceivedObjectId, bool InitialDetection ) : void

Called when an object first hears an object.

OnPerceptionLostHearingObject ( uint PerceivedObjectId, bool LastDetection ) : void

Called when an object loses hearing of another object.

OnPerceptionLostSightObject ( uint PerceivedObjectId, bool LastDetection ) : void

Called when an object loses sight of another object.

OnPerceptionSeenObject ( uint PerceivedObjectId, bool InitialDetection ) : void

Called when an object first sees an object.

SetAbberationEffects ( ) : void
SetAngelEffects ( ) : void
SetAnimalEffects ( ) : void
SetArchonEffects ( ) : void
SetColdEffects ( ) : void
SetConstructEffects ( ) : void
SetDragonEffects ( ) : void
SetElementalEffects ( ) : void
SetExtraAttacks ( int Attacks ) : void
SetFeyEffects ( ) : void
SetFireEffects ( ) : void
SetGiantEffects ( ) : void
SetIncorporealEffects ( ) : void
SetMagicalBeastEffects ( ) : void
SetMonstrousHumanoidEffects ( ) : void
SetOozeEffects ( ) : void
SetPlantEffects ( ) : void
SetUndeadEffects ( ) : void
SetVerminEffects ( ) : void
TryToCallForHelp ( ) : bool
TryToCleanUp ( ) : bool
_AmbientBehavior ( ) : void

This orders this creature to perform whatever it's supposed to perform when not engaged in something else.

_BashObject ( uint Target ) : void

This orders Creature to bash Target until it is destroyed.

_EquipWeapon ( bool meleeWeapon = true ) : void
_FindTargetForBuff ( NWScript.NWScriptEngineStructure3 Buff ) : uint

This seeks a target for a buff talent, prioritizing on high-risk allies, but only selecting one who doesn't already have the effect.

_FindTargetForDebuff ( NWScript.NWScriptEngineStructure3 Debuff ) : uint

This seeks a target for for large terrain-altering or wide effect spells meant to sway battles. It prioritizes distant and high-danger targets.

_FindTargetForDispel ( ) : uint

This seeks an enemy target with the most visual effects present, which would imply an in-character motivation to dispel.

_GetIsMeleeWeapon ( int baseItemType ) : bool
_GetIsProficient ( CLRScriptBase script, uint item ) : bool
_GetKnownFieldAlteringEffect ( ) : NWScript.NWScriptEngineStructure3
_GetKnownPartyBuff ( ) : NWScript.NWScriptEngineStructure3

This seeks a known talent which can provide benefit to the party.

_GetKnownSelfBuff ( ) : NWScript.NWScriptEngineStructure3

This seeks a known talent which can provide benefit to oneself.

_GetKnownSingleBuff ( ) : NWScript.NWScriptEngineStructure3

This seeks a known talent which can provide benefit to one ally.

_GetKnownUnfriendlyDebuff ( ) : NWScript.NWScriptEngineStructure3
_IsFriendlyFire ( int nTargetArea ) : bool

This function attempts to determine if the spell just cast on this creature was plausibly friendly fire, based on the locations of nearby enemies.

_IsMindMagiced ( uint CreatureId ) : bool

Determines if Creature has effects which would typically cause targeting problems, and might result in attacking a friendly person.

_SetMutualEnemies ( uint Creature1, uint Creature2 ) : void

This function causes Creature1 and Creature2 to be flagged as temporary enemies of one another, with no specified decay time. They, thus, will fight until killed or separated, but will not break the rest of their factions.

_TemporaryRangedCombat ( uint Reason, bool WaitForDeath = false ) : void

This function causes Creature to switch to change to ranged weapons temporarily. It should be used when ranged combat is only a good idea for a moment, because of battlefield conditions.

Method Details

CanAct() public method

This determines if the creature has any negative status effects which prevent actions in combat.
public CanAct ( ) : bool
return bool

CreatureObject() public method

Construct a creature object and insert it into the object table.
public CreatureObject ( uint ObjectId, GameObjectManager ObjectManager ) : System
ObjectId uint Supplies the creature object id.
ObjectManager GameObjectManager Supplies the object manager.
return System

DropParty() public method

public DropParty ( ) : void
return void

GetAlliesInMelee() public method

This returns the number of allies who are near hostile opponents.
public GetAlliesInMelee ( ) : int
return int

OnAttacked() public method

Called when the creature is attacked.
public OnAttacked ( uint AttackerObjectId ) : void
AttackerObjectId uint Supplies the attacker object id. ///
return void

OnBlocked() public method

Called when the creature's movement is blocked.
public OnBlocked ( uint BlockerObjectId ) : void
BlockerObjectId uint Supplies the blocker object /// id.
return void

OnConversation() public method

Called when someone attempts to open a static conversation with the creature.
public OnConversation ( ) : void
return void

OnDamaged() public method

Called when the creature is damaged.
public OnDamaged ( uint DamagerObjectId, int TotalDamageDealt ) : void
DamagerObjectId uint Supplies the damager object id. ///
TotalDamageDealt int Supplies the total damage dealt. ///
return void

OnDeath() public method

Called when the creature dies.
public OnDeath ( uint KillerObjectId ) : void
KillerObjectId uint Supplies the killer object id.
return void

OnEndCombatRound() public method

Called at the end of a combat round, when direction for the next round of combat is necessary. This managed the bulk of action in combat.
public OnEndCombatRound ( ) : void
return void

OnHeartbeat() public method

Called approximately every six seconds on an NPC, regardless of whether or not the NPC is in combat.
public OnHeartbeat ( ) : void
return void

OnInventoryDisturbed() public method

Called when a creature picks up or loses an item.
public OnInventoryDisturbed ( ) : void
return void

OnPerception() public method

Called when the perception state of the creature changes.
public OnPerception ( uint PerceivedObjectId, bool Heard, bool Inaudible, bool Seen, bool Vanished ) : void
PerceivedObjectId uint Supplies the perceived object id. ///
Heard bool True if the object is now heard.
Inaudible bool True if the object is now not /// heard.
Seen bool True if the object is now seen.
Vanished bool True if the object is now not seen.
return void

OnRested() public method

Called after a creature rests.
public OnRested ( ) : void
return void

OnRundown() public method

Called when the C# object state is being run down because the game engine half of the object has been deleted. This might occur after the fact.
public OnRundown ( ) : void
return void

OnSpawn() public method

Called when the creature is spawned, immediately after the class' constructors are run. Responsible for establishing party membership.
public OnSpawn ( ) : void
return void

OnSpellCastAt() public method

Called when a spell is cast on the creature.
public OnSpellCastAt ( uint CasterObjectId, int SpellId ) : void
CasterObjectId uint Supplies the spell caster object id. ///
SpellId int Supplies the spell id.
return void

OnUserDefined() public method

Called whenever a builder invokes an event by script.
public OnUserDefined ( int UserDefinedEventNumber ) : void
UserDefinedEventNumber int Supplies the user-defined /// event number associated with the event request.
return void

RefreshNegativeStatuses() public method

This refreshes the public variables which track status afflictions on the creature.
public RefreshNegativeStatuses ( ) : void
return void

SelectCombatRoundAction() public method

This function is the primary means by which actions are selected for a given combat round.
public SelectCombatRoundAction ( bool fromAllyCall ) : void
fromAllyCall bool
return void

TryRemoveStatusAfflictions() public method

This will look for status afflictions that need healing.
public TryRemoveStatusAfflictions ( CreatureObject HealTarget ) : bool
HealTarget CreatureObject The target to be healed
return bool

TryRemoveUrgentStatusAfflictions() public method

This will look for the most-urgent disabling status afflictions on HealTarget and attempt to cure them.
public TryRemoveUrgentStatusAfflictions ( CreatureObject HealTarget ) : bool
HealTarget CreatureObject The target to be healed
return bool

TryToAttackMelee() public method

public TryToAttackMelee ( bool PrioritizeSoftTargets = false, bool DistributeAttacks = false ) : bool
PrioritizeSoftTargets bool
DistributeAttacks bool
return bool

TryToAttackRanged() public method

This function causes Creature to switch to ranged weapons, if the weapon wielded isn't already ranged, and attack from a distance.
public TryToAttackRanged ( ) : bool
return bool

TryToBuffAll() public method

This will search for an ability to buff an ally, or oneself, which is not already applied to its target.
public TryToBuffAll ( ) : bool
return bool

TryToDebuffAll() public method

This attempts to find a valid place to put down large field-altering effects, and destructive (but dangerous and indiscriminate) spells. It will attempt to avoid friendly fire, but might hit allies who just happen to be within the area of effect anyway.
public TryToDebuffAll ( ) : bool
return bool

TryToDebuffCareful() public method

This attempts to find a place to send an attack which either only harms enemies or which only harms single targets.
public TryToDebuffCareful ( ) : bool
return bool

TryToHeal() public method

This will search for an ability that will directly restore about HitPoints of hit points and use it on HealTarget
public TryToHeal ( CreatureObject HealTarget, int HitPoints ) : bool
HealTarget CreatureObject The one to receive healing.
HitPoints int The amount to heal.
return bool

TryToHealAll() public method

This will look for an action that will improve the condition of the party.
public TryToHealAll ( ) : bool
return bool

_AttackWrapper() public method

This serves as a wrapper about calls to ActionAttack, to apply things like the uncanny dodge modifiers
public _AttackWrapper ( CreatureObject AttackTarget ) : bool
AttackTarget CreatureObject
return bool

Property Details

AbilityDamaged public property

This contains whether or not this creature has ability damage, and thus needs help from a lesser restoration, restoration, or greater restoration.
public bool AbilityDamaged
return bool

AbilityDrained public property

This contains whether or not this creature has ability drain, and thus needs help from a restoration or greater restoration.
public bool AbilityDrained
return bool

Blinded public property

This contains whether or not this creature is blinded, and thus needs a remove blindness spell.
public bool Blinded
return bool

Charmed public property

This contains whether a target is charmed, and thus is unwilling to fight enemies
public bool Charmed
return bool

CleanUpNeeded public property

This determines if a healer believes that a party still needs healing after a fight is over.
public bool CleanUpNeeded
return bool

Confused public property

This contains whether a target is confused, and thus acting randomly.
public bool Confused
return bool

Cursed public property

This contains whether a target is cursed, and in need of a remove curse spell.
public bool Cursed
return bool

Darkness public property

This contains whether a target is afflicted by a Darkness spell, and thus needs true seeing or to move.
public bool Darkness
return bool

Dazed public property

This contains whether a target is dazed, and thus incapable of fighting.
public bool Dazed
return bool

Deaf public property

This contains whether a target is deaf, and in need of healing.
public bool Deaf
return bool

Diseased public property

This contains whether a target is diseased.
public bool Diseased
return bool

Dominated public property

This contains whether a target is following the orders of an enemy spellcaster.
public bool Dominated
return bool

Entangled public property

This contains whether a target has been trapped by webs, ropes, or the like.
public bool Entangled
return bool

Frightened public property

This contains whether a target is "frightened" by the NWN2 engine, which is mechanically "panicked"
public bool Frightened
return bool

HasCombatRoundProcess public property

This contains whether or not this creature has an active cycle of combat round processing.
public bool HasCombatRoundProcess
return bool

Insane public property

This contains whether a target is permanently confused, and thus in desparate need of healing.
public bool Insane
return bool

LevelDrain public property

This contains whether a target has negative levels.
public bool LevelDrain
return bool

MoveDown public property

This contains whether some effect is reducing the creature's movement speed.
public bool MoveDown
return bool

OverrideTarget public property

public uint OverrideTarget
return uint

Paralyzed public property

This contains whether a target is paralyzed.
public bool Paralyzed
return bool

Petrified public property

This contains whether a target has been turned to stone.
public bool Petrified
return bool

Poisoned public property

This contains whether a target has been poisoned.
public bool Poisoned
return bool

Silenced public property

This contains whether a target has been silenced.
public bool Silenced
return bool

Sleeping public property

This contains whether a target is sleeping.
public bool Sleeping
return bool

Slowed public property

This contains whether a target is slowed.
public bool Slowed
return bool

Stunned public property

This contains whether a target is stunned.
public bool Stunned
return bool

TacticsType public property

public AIParty.AIType TacticsType
return AIParty.AIType

Turned public property

This contains whether a target has been turned.
public bool Turned
return bool

UsingEndCombatRound public property

This contains whether or not EndCombatRound has begun firing for the NPC.
public bool UsingEndCombatRound
return bool

Wounded public property

This contains whether a target is bleeding, and in need of a cure spell.
public bool Wounded
return bool