C# Class Aura.Channel.World.Entities.Creature

Base class for all "creaturly" entities.
Inheritance: Entity, IDisposable
显示文件 Open project: aura-project/aura Class Usage Examples

Public Properties

Property Type Description
_hitTrackerIds long
_hitTrackers HitTracker>.Dictionary
_totalHits int

Protected Properties

Property Type Description
_battleStance bool

Public Methods

Method Description
AcquireItem ( Item item ) : void

Adds item to creature's inventory and shows an acquire window.

Activate ( CreatureStates state ) : void
Activate ( CreatureStatesEx state ) : void
AgeUp ( short years ) : void

Increases age by years and sends update packets.

Aggro ( Creature target ) : void

Aggroes target, setting target and putting creature in battle stance.

AttackRangeFor ( Creature target ) : int

Returns the max distance the creature can have to attack.

This might not be the 100% accurate formula, but it should be good enough to work with for now.

Bless ( ) : void

Blesses given items and updates client.

BlessAll ( ) : void

Blesses all main equip items and updates client.

BurnMana ( float amount = 100 ) : void

Removes the given percentage of the creature's mana and updates client.

CalculateElementalDamageMultiplier ( Creature target ) : float

Calculates the creature's elemental damage modifier, against the target's elements.

CalculateElementalDamageMultiplier ( int myLightning, int myFire, int myIce, Creature target ) : float

Calculates the elemental damage modifier, based on the given affinities, against target.

CalculateElementalDamageMultiplier ( int myLightning, int myFire, int myIce, int targetLightning, int targetFire, int targetIce ) : float

Calculates the elemental damage modifier, between the "my" and the "target" affinities.

Since nobody seems to know the exact way elementals work, this function is mostly based on guess. First, all elementals are stacked against each other. If you have 1 affinity for an element that the enemy has as well, you lose 11.1% damage. Afterwards, you gain 11.1% for each very effective combination, and 3.7% for each slightly effective combination. The basic idea is that the same elements cancel each other out, while Fire and Ice are very, and Ice and Lightning are slightly effective against each other, as is hinted at in the in-game book "Understanding Elementals". The book also mentions that Fire and Lightning don't affect each other. The acual values, 11.1 and 3.7 (11.1 / 3) are based on the max affinity number 9, 11.1 * 9 being 99.9, and findings of the community, stating the need for at least 3 affinity for a noticible effect.

Can ( System.Collections.Generic.Locks locks ) : bool

Returns true if given lock isn't activated.

CanPickUp ( Item item ) : bool

Returns whether creature is allowed to pick up the given item from the ground.

CanTarget ( Creature creature ) : bool

Returns true if creature is able to attack this creature.

Deactivate ( CreatureStates state ) : void
Deactivate ( CreatureStatesEx state ) : void
Disappear ( ) : void

Disposes creature and removes it from its current region.

Dispose ( ) : void

Called when creature is removed from the server. (Killed NPC, disconnect, etc)

FullHeal ( ) : void

Heals all life, mana, stamina, hunger, and wounds and updates client.

FullLifeHeal ( ) : void

Fully heals life and updates client.

GetActualCreature ( ) : Creature

If this creature is an RP character, it returns the player's character behind the RP character, if not it just returns itself.

Use in cases where you want to execute an action on the actual player character, but you don't know if you're working with an RP character or not. For example, maybe you want to give a player a quest item at the end of the dungeon, but the dungeon can be played as RP or non-RP. Using just the creature would give it to the RP character, with the player never getting it.

GetAdjustedManaCost ( float baseVal ) : float

Returns given Mana cost adjusted for this creature, factoring in bonuses and modifications.

GetAllHitters ( ) : List

Returns all creatures that have hit this creature and are still in the same region.

GetChainCastLevel ( SkillId skillId ) : int

Returns the chain cast level the creature can use for the given skill.

Checks passive monster skill and upgrades of equipped weapons.

GetDestination ( ) : Position

Returns current destination.

GetHitTracker ( long entityId ) : HitTracker

Returns the tracker for the creature with the given id, or null if it doesn't exist.

GetLeftCritChance ( float protection ) : float

Calculates left hand crit chance, taking stat bonuses and given protection into consideration. Capped at 0~30.

GetPosition ( ) : Position

Returns current position.

GetPowerRating ( Creature compareCreature ) : PowerRating

Returns the power rating (Weak, Boss, etc) of compareCreature towards creature.

GetProductionPartyBonus ( Skill skill ) : float

Returns party production bonus for the given skill if creature is in a party.

http://wiki.mabinogiworld.com/view/Party#Production_Bonus

GetProductionSuccessChance ( Skill skill, ProductionCategory category, int baseChance, int rainBonus ) : float

Calculates and returns general production skill success chance.

Unofficial, but seems to work fine in most cases. Dex bonus: http://mabination.com/threads/57123-Chaos-Life-Skill-Guide-Refining

GetRestPose ( ) : byte

Returns Rest pose based on skill's rank.

GetRightCritChance ( float protection ) : float

Calculates right (or bare) hand crit chance, taking stat bonuses and given protection into consideration. Capped at 0~30.

GetRndBalance ( int baseBalance ) : int

Calculates random balance with given base balance, adding the dex bonus along the way.

GetRndLeftHandDamage ( ) : float

Calculates random damage for the left hand (off-hand).

Uses bare hand damage if creature has 0 stamina.

GetRndMagicBalance ( int baseBalance = BaseMagicBalance ) : int

Calculates random magic balance (0.0~1.0).

GetRndMagicDamage ( Skill skill, float baseMin, float baseMax ) : float

Calculates random base Magic damage for skill, using the given values.

http://wiki.mabinogiworld.com/view/Stats#Magic_Damage

GetRndRangedDamage ( ) : float

Returns random base damage for a ranged attack, e.g. Ranged Attack or Magnum Shot, based on race, weapon, etc.

GetRndRightHandDamage ( ) : float

Calculates random damage for the right hand (default).

Method is used for bare hand attacks as well, if right hand is empty, use bare hand attack values. Uses bare hand damage if creature has 0 stamina.

GetRndTotalDamage ( ) : float

Calculates the damage of left-and-right slots together

GetSpeed ( ) : float

Returns current movement speed (x/s).

GetSplashAngle ( Item item ) : float

Returns creature's splash angle, based on given weapon.

GetSplashDamage ( Item item ) : float

Returns creature's splash damage, based on given weapon.

GetSplashRadius ( Item item ) : float

Returns creature's splash radius, based on given weapon.

GetTargetableCreaturesAround ( Position position, int range, TargetableOptions options = TargetableOptions.None ) : ICollection

Returns targetable creatures in given range around position. Optionally factors in attack range.

GetTargetableCreaturesInCone ( Position position, Position targetPosition, float radius, float angle, TargetableOptions options = TargetableOptions.None ) : ICollection

Returns targetable creatures in cone, based on the given parameters, with direction of cone being based on the given positions.

GetTargetableCreaturesInCone ( Position targetPosition, float radius, float angle, TargetableOptions options = TargetableOptions.None ) : ICollection

Returns targetable creatures in cone, based on the given parameters, with direction of cone being based on the creature's and the target's position.

GetTargetableCreaturesInCone ( Position position, float direction, float radius, float angle, TargetableOptions options = TargetableOptions.None ) : ICollection

Returns targetable creatures in cone, based on the given parameters.

GetTargetableCreaturesInRange ( int range, TargetableOptions options = TargetableOptions.None ) : ICollection

Returns targetable creatures in given range around creature.

GetTopDamageDealer ( ) : HitTracker

Returns the tracker for the creature that did the most damage.

GetTopHitter ( ) : HitTracker

Returns the tracker for the creature that did the most hits.

GetTotalCritChance ( float protection ) : float

Calculates total crit chance, taking stat bonuses and given protection and bonus into consideration. Capped at 0~30.

GetTotalCritChance ( float protection, bool magic ) : float

Calculates total crit chance, taking stat bonuses and given protection and bonus into consideration. Capped at 0~30.

GetTotalHits ( ) : int

Returns the total number of hits the creature took.

GetTotalSplashAngle ( ) : float

Returns creature's splash angle, based on equipment.

GetTotalSplashDamage ( ) : float

Returns creature's splash damage, based on equipment.

GetTotalSplashRadius ( ) : float

Returns creature's splash radius, based on equipment.

GiveAp ( int amount ) : void

Increases AP and updates client.

GiveExp ( long val ) : void

Increases exp and levels up creature if appropriate.

GiveItem ( Item item ) : bool

Adds item to creature's inventory.

GiveItem ( int itemId, int amount = 1 ) : bool

Adds item to creature's inventory.

GiveItemWithEffect ( Item item ) : void

Adds item to creature's inventory and shows it above head.

HandleInquiry ( byte id ) : void

Calls inquiry callback for id if there is one.

Has ( CreatureStates state ) : bool
HasTag ( string tag ) : bool

Returns true if creature's race data has the tag.

Inquiry ( Action callback, string format ) : void

Sends a msg box to creature's client, asking a question. The callback is executed if the box is answered with OK.

Is ( RaceStands stand ) : bool
Jump ( Position position ) : void

Warps creature to given coordinates in its current region.

Jump ( int x, int y ) : void

Warps creature to given coordinates in its current region.

Kill ( Creature killer ) : void

Kills creature.

LoadDefault ( ) : void

Loads race and handles some basic stuff, like adding regens.

Has to be called before anything is actually done with the creature, as it initializes the race data, the inventory, and other vital parts.

Lock ( Locks locks, bool updateClient = false ) : Locks

Activates given Locks for creature.

Some locks are lifted automatically on Warp, SkillComplete, and SkillCancel. Only sending the locks when they actually changed can cause problems, e.g. if a lock is removed during a cutscene (skill running out) the unlock after the cutscene isn't sent. The client actually has counted locks, unlike us atm. Implementing those will fix the problem. TODO.

ModifyLife ( float amount ) : void

Changes life and sends stat update.

Move ( Position destination, bool walking ) : void

Starts movement from current position to destination. Sends Running|Walking.

OnMabiTick ( ErinnTime time ) : void

Called every 5 minutes, checks changes through food.

RemoveFromRegion ( ) : void

Removes creature from its current region.

RemoveItem ( int itemId, int amount = 1 ) : void

Removes items with the given id from the creature's inventory.

ResetPosition ( Position pos ) : void

Stops movement and resets creature to the given position.

Revive ( ReviveOptions option ) : void

Revives creature.

SetLocation ( Location loc ) : void

Sets RegionId and position.

SetLocation ( int region, int x, int y ) : void

Sets RegionId and position.

SetLocationNear ( Entity entity, int range ) : void

Sets region, x, and y, to be near entity. Also randomizes direction.

SetPosition ( int x, int y ) : Position

Sets position and destination.

Shove ( Creature target, int distance ) : Position

Sets new position for target, based on attacker's position and the distance, takes collision into consideration.

StopMove ( ) : Position

Stops movement, returning new current position. Sends Force(Walk|Run)To.

TakeDamage ( float damage, Creature from ) : void

Applies damage to Life, kills creature if necessary.

TalkToNpc ( string npcName, string npcNameLocal = null ) : bool

Starts dialog with NPC, returns false if NPC couldn't be found.

TurnTo ( Position pos ) : void

Turns creature in direction of position.

TurnTo ( float x, float y ) : void

Turns creature in given direction.

Unlock ( Locks locks, bool updateClient = false ) : Locks

Deactivates given Locks for creature.

Unlocking movement on the client apparently resets skill stuns.

Warp ( Location loc ) : bool

Warps creature to target location, returns false if warp is unsuccessful.

Warp ( int regionId, Position position ) : bool

Warps creature to target location, returns false if warp is unsuccessful.

Warp ( int regionId, int x, int y ) : bool

Warps creature to target location, returns false if warp is unsuccessful.

Warp ( string locationPath ) : bool

Warps creature to target location path, returns false if warp is unsuccessful.

Parses location paths like Uladh_main/SomeArea/SomeEvent and calls Warp with the resulting values.

Protected Methods

Method Description
Creature ( ) : System
GetRndDamage ( float min, float max, int balance ) : float

Calculates random damage with the given min/max and balance values. Adds attack mods and stat bonuses automatically and randomizes the balance.

ShouldSurvive ( float damage, Creature from, float lifeBefore ) : bool

Returns true if creature should go into deadly by the attack.

Private Methods

Method Description
DropGold ( Creature killer, Random rnd, Position pos ) : void

Drops creature's gold.

DropItems ( Creature killer, Random rnd, Position pos ) : void

Drops creature's drop items.

DropItems ( Creature killer, Random rnd, Position pos, IEnumerable dataCollection ) : void

Handles dropping of items in given collection.

EquipmentDecay ( ) : void

Called regularly to reduce equipments durability and give proficiency to armors.

http://wiki.mabinogiworld.com/view/Durability#Per_Tick http://wiki.mabinogiworld.com/view/Proficiency The dura loss actually doesn't seem to be fixed, I've logged varying values on NA. However, *most* of the time the values below are used.

GetCritChance ( float baseCritical, float protection ) : float

Adds stat bonuses to base and calculates crit chance, taking protection into consideration. Capped at 0~30.

OnPlayTimeTick ( ErinnTime now ) : void

Called every 9 minutes, increases play points.

OnSecondsTimeTick ( ErinnTime time ) : void

Called once per second, running updates on different creature components.

UpdateBody ( ) : void

Called regularly to update body, based on what the creature ate.

Method Details

AcquireItem() public method

Adds item to creature's inventory and shows an acquire window.
public AcquireItem ( Item item ) : void
item Item
return void

Activate() public method

public Activate ( CreatureStates state ) : void
state CreatureStates
return void

Activate() public method

public Activate ( CreatureStatesEx state ) : void
state CreatureStatesEx
return void

AgeUp() public method

Increases age by years and sends update packets.
public AgeUp ( short years ) : void
years short
return void

Aggro() public abstract method

Aggroes target, setting target and putting creature in battle stance.
public abstract Aggro ( Creature target ) : void
target Creature
return void

AttackRangeFor() public method

Returns the max distance the creature can have to attack.
This might not be the 100% accurate formula, but it should be good enough to work with for now.
public AttackRangeFor ( Creature target ) : int
target Creature
return int

Bless() public method

Blesses given items and updates client.
public Bless ( ) : void
return void

BlessAll() public method

Blesses all main equip items and updates client.
public BlessAll ( ) : void
return void

BurnMana() public method

Removes the given percentage of the creature's mana and updates client.
public BurnMana ( float amount = 100 ) : void
amount float
return void

CalculateElementalDamageMultiplier() public method

Calculates the creature's elemental damage modifier, against the target's elements.
public CalculateElementalDamageMultiplier ( Creature target ) : float
target Creature
return float

CalculateElementalDamageMultiplier() public method

Calculates the elemental damage modifier, based on the given affinities, against target.
public CalculateElementalDamageMultiplier ( int myLightning, int myFire, int myIce, Creature target ) : float
myLightning int
myFire int
myIce int
target Creature
return float

CalculateElementalDamageMultiplier() public method

Calculates the elemental damage modifier, between the "my" and the "target" affinities.
Since nobody seems to know the exact way elementals work, this function is mostly based on guess. First, all elementals are stacked against each other. If you have 1 affinity for an element that the enemy has as well, you lose 11.1% damage. Afterwards, you gain 11.1% for each very effective combination, and 3.7% for each slightly effective combination. The basic idea is that the same elements cancel each other out, while Fire and Ice are very, and Ice and Lightning are slightly effective against each other, as is hinted at in the in-game book "Understanding Elementals". The book also mentions that Fire and Lightning don't affect each other. The acual values, 11.1 and 3.7 (11.1 / 3) are based on the max affinity number 9, 11.1 * 9 being 99.9, and findings of the community, stating the need for at least 3 affinity for a noticible effect.
public CalculateElementalDamageMultiplier ( int myLightning, int myFire, int myIce, int targetLightning, int targetFire, int targetIce ) : float
myLightning int
myFire int
myIce int
targetLightning int
targetFire int
targetIce int
return float

Can() public method

Returns true if given lock isn't activated.
public Can ( System.Collections.Generic.Locks locks ) : bool
locks System.Collections.Generic.Locks
return bool

CanPickUp() public method

Returns whether creature is allowed to pick up the given item from the ground.
public CanPickUp ( Item item ) : bool
item Item
return bool

CanTarget() public method

Returns true if creature is able to attack this creature.
public CanTarget ( Creature creature ) : bool
creature Creature
return bool

Creature() protected method

protected Creature ( ) : System
return System

Deactivate() public method

public Deactivate ( CreatureStates state ) : void
state CreatureStates
return void

Deactivate() public method

public Deactivate ( CreatureStatesEx state ) : void
state CreatureStatesEx
return void

Disappear() public method

Disposes creature and removes it from its current region.
public Disappear ( ) : void
return void

Dispose() public method

Called when creature is removed from the server. (Killed NPC, disconnect, etc)
public Dispose ( ) : void
return void

FullHeal() public method

Heals all life, mana, stamina, hunger, and wounds and updates client.
public FullHeal ( ) : void
return void

FullLifeHeal() public method

Fully heals life and updates client.
public FullLifeHeal ( ) : void
return void

GetActualCreature() public method

If this creature is an RP character, it returns the player's character behind the RP character, if not it just returns itself.
Use in cases where you want to execute an action on the actual player character, but you don't know if you're working with an RP character or not. For example, maybe you want to give a player a quest item at the end of the dungeon, but the dungeon can be played as RP or non-RP. Using just the creature would give it to the RP character, with the player never getting it.
public GetActualCreature ( ) : Creature
return Creature

GetAdjustedManaCost() public method

Returns given Mana cost adjusted for this creature, factoring in bonuses and modifications.
public GetAdjustedManaCost ( float baseVal ) : float
baseVal float
return float

GetAllHitters() public method

Returns all creatures that have hit this creature and are still in the same region.
public GetAllHitters ( ) : List
return List

GetChainCastLevel() public method

Returns the chain cast level the creature can use for the given skill.
Checks passive monster skill and upgrades of equipped weapons.
public GetChainCastLevel ( SkillId skillId ) : int
skillId SkillId
return int

GetDestination() public method

Returns current destination.
public GetDestination ( ) : Position
return Position

GetHitTracker() public method

Returns the tracker for the creature with the given id, or null if it doesn't exist.
public GetHitTracker ( long entityId ) : HitTracker
entityId long
return HitTracker

GetLeftCritChance() public method

Calculates left hand crit chance, taking stat bonuses and given protection into consideration. Capped at 0~30.
public GetLeftCritChance ( float protection ) : float
protection float
return float

GetPosition() public method

Returns current position.
public GetPosition ( ) : Position
return Position

GetPowerRating() public method

Returns the power rating (Weak, Boss, etc) of compareCreature towards creature.
public GetPowerRating ( Creature compareCreature ) : PowerRating
compareCreature Creature Creature to compare to
return PowerRating

GetProductionPartyBonus() public method

Returns party production bonus for the given skill if creature is in a party.
http://wiki.mabinogiworld.com/view/Party#Production_Bonus
public GetProductionPartyBonus ( Skill skill ) : float
skill Skill
return float

GetProductionSuccessChance() public method

Calculates and returns general production skill success chance.
Unofficial, but seems to work fine in most cases. Dex bonus: http://mabination.com/threads/57123-Chaos-Life-Skill-Guide-Refining
public GetProductionSuccessChance ( Skill skill, ProductionCategory category, int baseChance, int rainBonus ) : float
skill Skill
category ProductionCategory
baseChance int
rainBonus int
return float

GetRestPose() public method

Returns Rest pose based on skill's rank.
public GetRestPose ( ) : byte
return byte

GetRightCritChance() public method

Calculates right (or bare) hand crit chance, taking stat bonuses and given protection into consideration. Capped at 0~30.
public GetRightCritChance ( float protection ) : float
protection float
return float

GetRndBalance() public method

Calculates random balance with given base balance, adding the dex bonus along the way.
public GetRndBalance ( int baseBalance ) : int
baseBalance int
return int

GetRndDamage() protected method

Calculates random damage with the given min/max and balance values. Adds attack mods and stat bonuses automatically and randomizes the balance.
protected GetRndDamage ( float min, float max, int balance ) : float
min float
max float
balance int
return float

GetRndLeftHandDamage() public method

Calculates random damage for the left hand (off-hand).
Uses bare hand damage if creature has 0 stamina.
public GetRndLeftHandDamage ( ) : float
return float

GetRndMagicBalance() public method

Calculates random magic balance (0.0~1.0).
public GetRndMagicBalance ( int baseBalance = BaseMagicBalance ) : int
baseBalance int
return int

GetRndMagicDamage() public method

Calculates random base Magic damage for skill, using the given values.
http://wiki.mabinogiworld.com/view/Stats#Magic_Damage
public GetRndMagicDamage ( Skill skill, float baseMin, float baseMax ) : float
skill Skill
baseMin float
baseMax float
return float

GetRndRangedDamage() public method

Returns random base damage for a ranged attack, e.g. Ranged Attack or Magnum Shot, based on race, weapon, etc.
public GetRndRangedDamage ( ) : float
return float

GetRndRightHandDamage() public method

Calculates random damage for the right hand (default).
Method is used for bare hand attacks as well, if right hand is empty, use bare hand attack values. Uses bare hand damage if creature has 0 stamina.
public GetRndRightHandDamage ( ) : float
return float

GetRndTotalDamage() public method

Calculates the damage of left-and-right slots together
public GetRndTotalDamage ( ) : float
return float

GetSpeed() public method

Returns current movement speed (x/s).
public GetSpeed ( ) : float
return float

GetSplashAngle() public method

Returns creature's splash angle, based on given weapon.
public GetSplashAngle ( Item item ) : float
item Item
return float

GetSplashDamage() public method

Returns creature's splash damage, based on given weapon.
public GetSplashDamage ( Item item ) : float
item Item
return float

GetSplashRadius() public method

Returns creature's splash radius, based on given weapon.
public GetSplashRadius ( Item item ) : float
item Item
return float

GetTargetableCreaturesAround() public method

Returns targetable creatures in given range around position. Optionally factors in attack range.
public GetTargetableCreaturesAround ( Position position, int range, TargetableOptions options = TargetableOptions.None ) : ICollection
position Position Reference position.
range int Radius around position.
options TargetableOptions Options to change the result.
return ICollection

GetTargetableCreaturesInCone() public method

Returns targetable creatures in cone, based on the given parameters, with direction of cone being based on the given positions.
public GetTargetableCreaturesInCone ( Position position, Position targetPosition, float radius, float angle, TargetableOptions options = TargetableOptions.None ) : ICollection
position Position Pointy end of the cone.
targetPosition Position Target's position, used as reference for the direction of the cone.
radius float Cone's radius.
angle float Cone's angle in degree.
options TargetableOptions Options to change the result.
return ICollection

GetTargetableCreaturesInCone() public method

Returns targetable creatures in cone, based on the given parameters, with direction of cone being based on the creature's and the target's position.
public GetTargetableCreaturesInCone ( Position targetPosition, float radius, float angle, TargetableOptions options = TargetableOptions.None ) : ICollection
targetPosition Position Target's position, used as reference for the direction of the cone.
radius float Cone's radius.
angle float Cone's angle in degree.
options TargetableOptions Options to change the result.
return ICollection

GetTargetableCreaturesInCone() public method

Returns targetable creatures in cone, based on the given parameters.
public GetTargetableCreaturesInCone ( Position position, float direction, float radius, float angle, TargetableOptions options = TargetableOptions.None ) : ICollection
position Position Pointy end of the cone.
direction float Cone's direction as radian.
radius float Cone's radius.
angle float Cone's angle in degree.
options TargetableOptions Options to change the result.
return ICollection

GetTargetableCreaturesInRange() public method

Returns targetable creatures in given range around creature.
public GetTargetableCreaturesInRange ( int range, TargetableOptions options = TargetableOptions.None ) : ICollection
range int Radius around position.
options TargetableOptions Options to change the result.
return ICollection

GetTopDamageDealer() public method

Returns the tracker for the creature that did the most damage.
public GetTopDamageDealer ( ) : HitTracker
return HitTracker

GetTopHitter() public method

Returns the tracker for the creature that did the most hits.
public GetTopHitter ( ) : HitTracker
return HitTracker

GetTotalCritChance() public method

Calculates total crit chance, taking stat bonuses and given protection and bonus into consideration. Capped at 0~30.
public GetTotalCritChance ( float protection ) : float
protection float Protection to subtract from crit.
return float

GetTotalCritChance() public method

Calculates total crit chance, taking stat bonuses and given protection and bonus into consideration. Capped at 0~30.
public GetTotalCritChance ( float protection, bool magic ) : float
protection float Protection to subtract from crit.
magic bool If true, weapon crit bonuses only apply if weapon is a wand.
return float

GetTotalHits() public method

Returns the total number of hits the creature took.
public GetTotalHits ( ) : int
return int

GetTotalSplashAngle() public method

Returns creature's splash angle, based on equipment.
public GetTotalSplashAngle ( ) : float
return float

GetTotalSplashDamage() public method

Returns creature's splash damage, based on equipment.
public GetTotalSplashDamage ( ) : float
return float

GetTotalSplashRadius() public method

Returns creature's splash radius, based on equipment.
public GetTotalSplashRadius ( ) : float
return float

GiveAp() public method

Increases AP and updates client.
public GiveAp ( int amount ) : void
amount int
return void

GiveExp() public method

Increases exp and levels up creature if appropriate.
public GiveExp ( long val ) : void
val long
return void

GiveItem() public method

Adds item to creature's inventory.
public GiveItem ( Item item ) : bool
item Item
return bool

GiveItem() public method

Adds item to creature's inventory.
public GiveItem ( int itemId, int amount = 1 ) : bool
itemId int
amount int
return bool

GiveItemWithEffect() public method

Adds item to creature's inventory and shows it above head.
public GiveItemWithEffect ( Item item ) : void
item Item
return void

HandleInquiry() public method

Calls inquiry callback for id if there is one.
public HandleInquiry ( byte id ) : void
id byte
return void

Has() public method

public Has ( CreatureStates state ) : bool
state CreatureStates
return bool

HasTag() public method

Returns true if creature's race data has the tag.
public HasTag ( string tag ) : bool
tag string
return bool

Inquiry() public method

Sends a msg box to creature's client, asking a question. The callback is executed if the box is answered with OK.
public Inquiry ( Action callback, string format ) : void
callback Action
format string
return void

Is() public method

public Is ( RaceStands stand ) : bool
stand RaceStands
return bool

Jump() public method

Warps creature to given coordinates in its current region.
public Jump ( Position position ) : void
position Position
return void

Jump() public method

Warps creature to given coordinates in its current region.
public Jump ( int x, int y ) : void
x int
y int
return void

Kill() public method

Kills creature.
public Kill ( Creature killer ) : void
killer Creature
return void

LoadDefault() public method

Loads race and handles some basic stuff, like adding regens.
Has to be called before anything is actually done with the creature, as it initializes the race data, the inventory, and other vital parts.
public LoadDefault ( ) : void
return void

Lock() public method

Activates given Locks for creature.
Some locks are lifted automatically on Warp, SkillComplete, and SkillCancel. Only sending the locks when they actually changed can cause problems, e.g. if a lock is removed during a cutscene (skill running out) the unlock after the cutscene isn't sent. The client actually has counted locks, unlike us atm. Implementing those will fix the problem. TODO.
public Lock ( Locks locks, bool updateClient = false ) : Locks
locks Locks Locks to activate.
updateClient bool Sends CharacterLock to client if true.
return Locks

ModifyLife() public method

Changes life and sends stat update.
public ModifyLife ( float amount ) : void
amount float
return void

Move() public method

Starts movement from current position to destination. Sends Running|Walking.
public Move ( Position destination, bool walking ) : void
destination Position
walking bool
return void

OnMabiTick() public method

Called every 5 minutes, checks changes through food.
public OnMabiTick ( ErinnTime time ) : void
time ErinnTime
return void

RemoveFromRegion() public method

Removes creature from its current region.
public RemoveFromRegion ( ) : void
return void

RemoveItem() public method

Removes items with the given id from the creature's inventory.
public RemoveItem ( int itemId, int amount = 1 ) : void
itemId int
amount int
return void

ResetPosition() public method

Stops movement and resets creature to the given position.
public ResetPosition ( Position pos ) : void
pos Position
return void

Revive() public method

Revives creature.
public Revive ( ReviveOptions option ) : void
option ReviveOptions Determines the penalty and stat recovery.
return void

SetLocation() public method

Sets RegionId and position.
public SetLocation ( Location loc ) : void
loc Location
return void

SetLocation() public method

Sets RegionId and position.
public SetLocation ( int region, int x, int y ) : void
region int
x int
y int
return void

SetLocationNear() public method

Sets region, x, and y, to be near entity. Also randomizes direction.
public SetLocationNear ( Entity entity, int range ) : void
entity Entity
range int
return void

SetPosition() public method

Sets position and destination.
public SetPosition ( int x, int y ) : Position
x int
y int
return Position

ShouldSurvive() protected abstract method

Returns true if creature should go into deadly by the attack.
protected abstract ShouldSurvive ( float damage, Creature from, float lifeBefore ) : bool
damage float
from Creature
lifeBefore float
return bool

Shove() public method

Sets new position for target, based on attacker's position and the distance, takes collision into consideration.
public Shove ( Creature target, int distance ) : Position
target Creature Entity to be knocked back
distance int Distance to knock back the target
return Position

StopMove() public method

Stops movement, returning new current position. Sends Force(Walk|Run)To.
public StopMove ( ) : Position
return Position

TakeDamage() public method

Applies damage to Life, kills creature if necessary.
public TakeDamage ( float damage, Creature from ) : void
damage float
from Creature
return void

TalkToNpc() public method

Starts dialog with NPC, returns false if NPC couldn't be found.
public TalkToNpc ( string npcName, string npcNameLocal = null ) : bool
npcName string The ident for the NPC, e.g. _duncan.
npcNameLocal string Defaults to npcName if null.
return bool

TurnTo() public method

Turns creature in direction of position.
public TurnTo ( Position pos ) : void
pos Position
return void

TurnTo() public method

Turns creature in given direction.
public TurnTo ( float x, float y ) : void
x float
y float
return void

Unlock() public method

Deactivates given Locks for creature.
Unlocking movement on the client apparently resets skill stuns.
public Unlock ( Locks locks, bool updateClient = false ) : Locks
locks Locks Locks to deactivate.
updateClient bool Sends CharacterUnlock to client if true.
return Locks

Warp() public method

Warps creature to target location, returns false if warp is unsuccessful.
public Warp ( Location loc ) : bool
loc Location
return bool

Warp() public method

Warps creature to target location, returns false if warp is unsuccessful.
public Warp ( int regionId, Position position ) : bool
regionId int
position Position
return bool

Warp() public abstract method

Warps creature to target location, returns false if warp is unsuccessful.
public abstract Warp ( int regionId, int x, int y ) : bool
regionId int
x int
y int
return bool

Warp() public method

Warps creature to target location path, returns false if warp is unsuccessful.
Parses location paths like Uladh_main/SomeArea/SomeEvent and calls Warp with the resulting values.
public Warp ( string locationPath ) : bool
locationPath string
return bool

Property Details

_battleStance protected_oe property

protected bool _battleStance
return bool

_hitTrackerIds public_oe property

public long _hitTrackerIds
return long

_hitTrackers public_oe property

public Dictionary _hitTrackers
return HitTracker>.Dictionary

_totalHits public_oe property

public int _totalHits
return int