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

Base class for all "creaturly" entities.
Inheritance: Entity, IDisposable
Afficher le fichier Open project: aura-project/aura Class Usage Examples

Méthodes publiques

Свойство Type Description
_hitTrackerIds long
_hitTrackers HitTracker>.Dictionary
_totalHits int

Protected Properties

Свойство Type Description
_battleStance bool

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode 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 méthode

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

Activate() public méthode

public Activate ( CreatureStates state ) : void
state CreatureStates
Résultat void

Activate() public méthode

public Activate ( CreatureStatesEx state ) : void
state CreatureStatesEx
Résultat void

AgeUp() public méthode

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

Aggro() public abstract méthode

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

AttackRangeFor() public méthode

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
Résultat int

Bless() public méthode

Blesses given items and updates client.
public Bless ( ) : void
Résultat void

BlessAll() public méthode

Blesses all main equip items and updates client.
public BlessAll ( ) : void
Résultat void

BurnMana() public méthode

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

CalculateElementalDamageMultiplier() public méthode

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

CalculateElementalDamageMultiplier() public méthode

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
Résultat float

CalculateElementalDamageMultiplier() public méthode

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
Résultat float

Can() public méthode

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

CanPickUp() public méthode

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

CanTarget() public méthode

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

Creature() protected méthode

protected Creature ( ) : System
Résultat System

Deactivate() public méthode

public Deactivate ( CreatureStates state ) : void
state CreatureStates
Résultat void

Deactivate() public méthode

public Deactivate ( CreatureStatesEx state ) : void
state CreatureStatesEx
Résultat void

Disappear() public méthode

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

Dispose() public méthode

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

FullHeal() public méthode

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

FullLifeHeal() public méthode

Fully heals life and updates client.
public FullLifeHeal ( ) : void
Résultat void

GetActualCreature() public méthode

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
Résultat Creature

GetAdjustedManaCost() public méthode

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

GetAllHitters() public méthode

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

GetChainCastLevel() public méthode

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
Résultat int

GetDestination() public méthode

Returns current destination.
public GetDestination ( ) : Position
Résultat Position

GetHitTracker() public méthode

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

GetLeftCritChance() public méthode

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

GetPosition() public méthode

Returns current position.
public GetPosition ( ) : Position
Résultat Position

GetPowerRating() public méthode

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

GetProductionPartyBonus() public méthode

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
Résultat float

GetProductionSuccessChance() public méthode

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
Résultat float

GetRestPose() public méthode

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

GetRightCritChance() public méthode

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
Résultat float

GetRndBalance() public méthode

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

GetRndDamage() protected méthode

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
Résultat float

GetRndLeftHandDamage() public méthode

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

GetRndMagicBalance() public méthode

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

GetRndMagicDamage() public méthode

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
Résultat float

GetRndRangedDamage() public méthode

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

GetRndRightHandDamage() public méthode

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
Résultat float

GetRndTotalDamage() public méthode

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

GetSpeed() public méthode

Returns current movement speed (x/s).
public GetSpeed ( ) : float
Résultat float

GetSplashAngle() public méthode

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

GetSplashDamage() public méthode

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

GetSplashRadius() public méthode

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

GetTargetableCreaturesAround() public méthode

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.
Résultat ICollection

GetTargetableCreaturesInCone() public méthode

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.
Résultat ICollection

GetTargetableCreaturesInCone() public méthode

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.
Résultat ICollection

GetTargetableCreaturesInCone() public méthode

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.
Résultat ICollection

GetTargetableCreaturesInRange() public méthode

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.
Résultat ICollection

GetTopDamageDealer() public méthode

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

GetTopHitter() public méthode

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

GetTotalCritChance() public méthode

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.
Résultat float

GetTotalCritChance() public méthode

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.
Résultat float

GetTotalHits() public méthode

Returns the total number of hits the creature took.
public GetTotalHits ( ) : int
Résultat int

GetTotalSplashAngle() public méthode

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

GetTotalSplashDamage() public méthode

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

GetTotalSplashRadius() public méthode

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

GiveAp() public méthode

Increases AP and updates client.
public GiveAp ( int amount ) : void
amount int
Résultat void

GiveExp() public méthode

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

GiveItem() public méthode

Adds item to creature's inventory.
public GiveItem ( Item item ) : bool
item Item
Résultat bool

GiveItem() public méthode

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

GiveItemWithEffect() public méthode

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

HandleInquiry() public méthode

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

Has() public méthode

public Has ( CreatureStates state ) : bool
state CreatureStates
Résultat bool

HasTag() public méthode

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

Inquiry() public méthode

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
Résultat void

Is() public méthode

public Is ( RaceStands stand ) : bool
stand RaceStands
Résultat bool

Jump() public méthode

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

Jump() public méthode

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

Kill() public méthode

Kills creature.
public Kill ( Creature killer ) : void
killer Creature
Résultat void

LoadDefault() public méthode

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
Résultat void

Lock() public méthode

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.
Résultat Locks

ModifyLife() public méthode

Changes life and sends stat update.
public ModifyLife ( float amount ) : void
amount float
Résultat void

Move() public méthode

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

OnMabiTick() public méthode

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

RemoveFromRegion() public méthode

Removes creature from its current region.
public RemoveFromRegion ( ) : void
Résultat void

RemoveItem() public méthode

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

ResetPosition() public méthode

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

Revive() public méthode

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

SetLocation() public méthode

Sets RegionId and position.
public SetLocation ( Location loc ) : void
loc Location
Résultat void

SetLocation() public méthode

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

SetLocationNear() public méthode

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

SetPosition() public méthode

Sets position and destination.
public SetPosition ( int x, int y ) : Position
x int
y int
Résultat Position

ShouldSurvive() protected abstract méthode

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
Résultat bool

Shove() public méthode

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
Résultat Position

StopMove() public méthode

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

TakeDamage() public méthode

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

TalkToNpc() public méthode

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.
Résultat bool

TurnTo() public méthode

Turns creature in direction of position.
public TurnTo ( Position pos ) : void
pos Position
Résultat void

TurnTo() public méthode

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

Unlock() public méthode

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.
Résultat Locks

Warp() public méthode

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

Warp() public méthode

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

Warp() public abstract méthode

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
Résultat bool

Warp() public méthode

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
Résultat bool

Property Details

_battleStance protected_oe property

protected bool _battleStance
Résultat bool

_hitTrackerIds public_oe property

public long _hitTrackerIds
Résultat long

_hitTrackers public_oe property

public Dictionary _hitTrackers
Résultat HitTracker>.Dictionary

_totalHits public_oe property

public int _totalHits
Résultat int