C# Класс Aura.Channel.World.Entities.Creature

Base class for all "creaturly" entities.
Наследование: Entity, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
_hitTrackerIds long
_hitTrackers HitTracker>.Dictionary
_totalHits int

Защищенные свойства (Protected)

Свойство Тип Описание
_battleStance bool

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

AcquireItem() публичный Метод

Adds item to creature's inventory and shows an acquire window.
public AcquireItem ( Item item ) : void
item Item
Результат void

Activate() публичный Метод

public Activate ( CreatureStates state ) : void
state CreatureStates
Результат void

Activate() публичный Метод

public Activate ( CreatureStatesEx state ) : void
state CreatureStatesEx
Результат void

AgeUp() публичный Метод

Increases age by years and sends update packets.
public AgeUp ( short years ) : void
years short
Результат void

Aggro() публичный абстрактный Метод

Aggroes target, setting target and putting creature in battle stance.
public abstract Aggro ( Creature target ) : void
target Creature
Результат void

AttackRangeFor() публичный Метод

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
Результат int

Bless() публичный Метод

Blesses given items and updates client.
public Bless ( ) : void
Результат void

BlessAll() публичный Метод

Blesses all main equip items and updates client.
public BlessAll ( ) : void
Результат void

BurnMana() публичный Метод

Removes the given percentage of the creature's mana and updates client.
public BurnMana ( float amount = 100 ) : void
amount float
Результат void

CalculateElementalDamageMultiplier() публичный Метод

Calculates the creature's elemental damage modifier, against the target's elements.
public CalculateElementalDamageMultiplier ( Creature target ) : float
target Creature
Результат float

CalculateElementalDamageMultiplier() публичный Метод

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
Результат float

CalculateElementalDamageMultiplier() публичный Метод

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
Результат float

Can() публичный Метод

Returns true if given lock isn't activated.
public Can ( System.Collections.Generic.Locks locks ) : bool
locks System.Collections.Generic.Locks
Результат bool

CanPickUp() публичный Метод

Returns whether creature is allowed to pick up the given item from the ground.
public CanPickUp ( Item item ) : bool
item Item
Результат bool

CanTarget() публичный Метод

Returns true if creature is able to attack this creature.
public CanTarget ( Creature creature ) : bool
creature Creature
Результат bool

Creature() защищенный Метод

protected Creature ( ) : System
Результат System

Deactivate() публичный Метод

public Deactivate ( CreatureStates state ) : void
state CreatureStates
Результат void

Deactivate() публичный Метод

public Deactivate ( CreatureStatesEx state ) : void
state CreatureStatesEx
Результат void

Disappear() публичный Метод

Disposes creature and removes it from its current region.
public Disappear ( ) : void
Результат void

Dispose() публичный Метод

Called when creature is removed from the server. (Killed NPC, disconnect, etc)
public Dispose ( ) : void
Результат void

FullHeal() публичный Метод

Heals all life, mana, stamina, hunger, and wounds and updates client.
public FullHeal ( ) : void
Результат void

FullLifeHeal() публичный Метод

Fully heals life and updates client.
public FullLifeHeal ( ) : void
Результат void

GetActualCreature() публичный Метод

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
Результат Creature

GetAdjustedManaCost() публичный Метод

Returns given Mana cost adjusted for this creature, factoring in bonuses and modifications.
public GetAdjustedManaCost ( float baseVal ) : float
baseVal float
Результат float

GetAllHitters() публичный Метод

Returns all creatures that have hit this creature and are still in the same region.
public GetAllHitters ( ) : List
Результат List

GetChainCastLevel() публичный Метод

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
Результат int

GetDestination() публичный Метод

Returns current destination.
public GetDestination ( ) : Position
Результат Position

GetHitTracker() публичный Метод

Returns the tracker for the creature with the given id, or null if it doesn't exist.
public GetHitTracker ( long entityId ) : HitTracker
entityId long
Результат HitTracker

GetLeftCritChance() публичный Метод

Calculates left hand crit chance, taking stat bonuses and given protection into consideration. Capped at 0~30.
public GetLeftCritChance ( float protection ) : float
protection float
Результат float

GetPosition() публичный Метод

Returns current position.
public GetPosition ( ) : Position
Результат Position

GetPowerRating() публичный Метод

Returns the power rating (Weak, Boss, etc) of compareCreature towards creature.
public GetPowerRating ( Creature compareCreature ) : PowerRating
compareCreature Creature Creature to compare to
Результат PowerRating

GetProductionPartyBonus() публичный Метод

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
Результат float

GetProductionSuccessChance() публичный Метод

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
Результат float

GetRestPose() публичный Метод

Returns Rest pose based on skill's rank.
public GetRestPose ( ) : byte
Результат byte

GetRightCritChance() публичный Метод

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
Результат float

GetRndBalance() публичный Метод

Calculates random balance with given base balance, adding the dex bonus along the way.
public GetRndBalance ( int baseBalance ) : int
baseBalance int
Результат int

GetRndDamage() защищенный Метод

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
Результат float

GetRndLeftHandDamage() публичный Метод

Calculates random damage for the left hand (off-hand).
Uses bare hand damage if creature has 0 stamina.
public GetRndLeftHandDamage ( ) : float
Результат float

GetRndMagicBalance() публичный Метод

Calculates random magic balance (0.0~1.0).
public GetRndMagicBalance ( int baseBalance = BaseMagicBalance ) : int
baseBalance int
Результат int

GetRndMagicDamage() публичный Метод

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
Результат float

GetRndRangedDamage() публичный Метод

Returns random base damage for a ranged attack, e.g. Ranged Attack or Magnum Shot, based on race, weapon, etc.
public GetRndRangedDamage ( ) : float
Результат float

GetRndRightHandDamage() публичный Метод

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
Результат float

GetRndTotalDamage() публичный Метод

Calculates the damage of left-and-right slots together
public GetRndTotalDamage ( ) : float
Результат float

GetSpeed() публичный Метод

Returns current movement speed (x/s).
public GetSpeed ( ) : float
Результат float

GetSplashAngle() публичный Метод

Returns creature's splash angle, based on given weapon.
public GetSplashAngle ( Item item ) : float
item Item
Результат float

GetSplashDamage() публичный Метод

Returns creature's splash damage, based on given weapon.
public GetSplashDamage ( Item item ) : float
item Item
Результат float

GetSplashRadius() публичный Метод

Returns creature's splash radius, based on given weapon.
public GetSplashRadius ( Item item ) : float
item Item
Результат float

GetTargetableCreaturesAround() публичный Метод

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.
Результат ICollection

GetTargetableCreaturesInCone() публичный Метод

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.
Результат ICollection

GetTargetableCreaturesInCone() публичный Метод

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.
Результат ICollection

GetTargetableCreaturesInCone() публичный Метод

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.
Результат ICollection

GetTargetableCreaturesInRange() публичный Метод

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.
Результат ICollection

GetTopDamageDealer() публичный Метод

Returns the tracker for the creature that did the most damage.
public GetTopDamageDealer ( ) : HitTracker
Результат HitTracker

GetTopHitter() публичный Метод

Returns the tracker for the creature that did the most hits.
public GetTopHitter ( ) : HitTracker
Результат HitTracker

GetTotalCritChance() публичный Метод

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.
Результат float

GetTotalCritChance() публичный Метод

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.
Результат float

GetTotalHits() публичный Метод

Returns the total number of hits the creature took.
public GetTotalHits ( ) : int
Результат int

GetTotalSplashAngle() публичный Метод

Returns creature's splash angle, based on equipment.
public GetTotalSplashAngle ( ) : float
Результат float

GetTotalSplashDamage() публичный Метод

Returns creature's splash damage, based on equipment.
public GetTotalSplashDamage ( ) : float
Результат float

GetTotalSplashRadius() публичный Метод

Returns creature's splash radius, based on equipment.
public GetTotalSplashRadius ( ) : float
Результат float

GiveAp() публичный Метод

Increases AP and updates client.
public GiveAp ( int amount ) : void
amount int
Результат void

GiveExp() публичный Метод

Increases exp and levels up creature if appropriate.
public GiveExp ( long val ) : void
val long
Результат void

GiveItem() публичный Метод

Adds item to creature's inventory.
public GiveItem ( Item item ) : bool
item Item
Результат bool

GiveItem() публичный Метод

Adds item to creature's inventory.
public GiveItem ( int itemId, int amount = 1 ) : bool
itemId int
amount int
Результат bool

GiveItemWithEffect() публичный Метод

Adds item to creature's inventory and shows it above head.
public GiveItemWithEffect ( Item item ) : void
item Item
Результат void

HandleInquiry() публичный Метод

Calls inquiry callback for id if there is one.
public HandleInquiry ( byte id ) : void
id byte
Результат void

Has() публичный Метод

public Has ( CreatureStates state ) : bool
state CreatureStates
Результат bool

HasTag() публичный Метод

Returns true if creature's race data has the tag.
public HasTag ( string tag ) : bool
tag string
Результат bool

Inquiry() публичный Метод

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
Результат void

Is() публичный Метод

public Is ( RaceStands stand ) : bool
stand RaceStands
Результат bool

Jump() публичный Метод

Warps creature to given coordinates in its current region.
public Jump ( Position position ) : void
position Position
Результат void

Jump() публичный Метод

Warps creature to given coordinates in its current region.
public Jump ( int x, int y ) : void
x int
y int
Результат void

Kill() публичный Метод

Kills creature.
public Kill ( Creature killer ) : void
killer Creature
Результат void

LoadDefault() публичный Метод

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
Результат void

Lock() публичный Метод

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.
Результат Locks

ModifyLife() публичный Метод

Changes life and sends stat update.
public ModifyLife ( float amount ) : void
amount float
Результат void

Move() публичный Метод

Starts movement from current position to destination. Sends Running|Walking.
public Move ( Position destination, bool walking ) : void
destination Position
walking bool
Результат void

OnMabiTick() публичный Метод

Called every 5 minutes, checks changes through food.
public OnMabiTick ( ErinnTime time ) : void
time ErinnTime
Результат void

RemoveFromRegion() публичный Метод

Removes creature from its current region.
public RemoveFromRegion ( ) : void
Результат void

RemoveItem() публичный Метод

Removes items with the given id from the creature's inventory.
public RemoveItem ( int itemId, int amount = 1 ) : void
itemId int
amount int
Результат void

ResetPosition() публичный Метод

Stops movement and resets creature to the given position.
public ResetPosition ( Position pos ) : void
pos Position
Результат void

Revive() публичный Метод

Revives creature.
public Revive ( ReviveOptions option ) : void
option ReviveOptions Determines the penalty and stat recovery.
Результат void

SetLocation() публичный Метод

Sets RegionId and position.
public SetLocation ( Location loc ) : void
loc Location
Результат void

SetLocation() публичный Метод

Sets RegionId and position.
public SetLocation ( int region, int x, int y ) : void
region int
x int
y int
Результат void

SetLocationNear() публичный Метод

Sets region, x, and y, to be near entity. Also randomizes direction.
public SetLocationNear ( Entity entity, int range ) : void
entity Entity
range int
Результат void

SetPosition() публичный Метод

Sets position and destination.
public SetPosition ( int x, int y ) : Position
x int
y int
Результат Position

ShouldSurvive() защищенный абстрактный Метод

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
Результат bool

Shove() публичный Метод

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
Результат Position

StopMove() публичный Метод

Stops movement, returning new current position. Sends Force(Walk|Run)To.
public StopMove ( ) : Position
Результат Position

TakeDamage() публичный Метод

Applies damage to Life, kills creature if necessary.
public TakeDamage ( float damage, Creature from ) : void
damage float
from Creature
Результат void

TalkToNpc() публичный Метод

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.
Результат bool

TurnTo() публичный Метод

Turns creature in direction of position.
public TurnTo ( Position pos ) : void
pos Position
Результат void

TurnTo() публичный Метод

Turns creature in given direction.
public TurnTo ( float x, float y ) : void
x float
y float
Результат void

Unlock() публичный Метод

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.
Результат Locks

Warp() публичный Метод

Warps creature to target location, returns false if warp is unsuccessful.
public Warp ( Location loc ) : bool
loc Location
Результат bool

Warp() публичный Метод

Warps creature to target location, returns false if warp is unsuccessful.
public Warp ( int regionId, Position position ) : bool
regionId int
position Position
Результат bool

Warp() публичный абстрактный Метод

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
Результат bool

Warp() публичный Метод

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
Результат bool

Описание свойств

_battleStance защищенное свойство

protected bool _battleStance
Результат bool

_hitTrackerIds публичное свойство

public long _hitTrackerIds
Результат long

_hitTrackers публичное свойство

public Dictionary _hitTrackers
Результат HitTracker>.Dictionary

_totalHits публичное свойство

public int _totalHits
Результат int