C# Class Aura.Channel.Skills.Base.ProductionSkill

Base class for production skills, like Handicraft and Weaving.
Starting production calls Prepare, once the creation process is done, Complete is called. There is no way to cancel the skill once Prepare was called. While the client tells us how many items are gonna be produced, it Prepares the skill again and again, so we must only create one product at a time.
Inheritance: IPreparable, ICompletable
Datei anzeigen Open project: aura-project/aura

Public Methods

Method Description
Complete ( Creature creature, Skill skill, Packet packet ) : void

Completes production.

Prepare ( Creature creature, Skill skill, Packet packet ) : bool

Starts production, finished in Complete.

Protected Methods

Method Description
CheckCategory ( Creature creature, ProductionCategory category ) : bool

Checks if category can be handled by this skill, returns false if not.

CheckProp ( Creature creature, long propEntityId ) : bool

Checks if prop is valid and in range, returns false if not.

CheckTools ( Creature creature, Skill skill, ProductionData productData ) : bool

Checks tools from Prepare, to maybe cancel skill.

OnUse ( Creature creature, Skill skill ) : void

Called from successful Prepare.

SkillTraining ( Creature creature, Skill skill, ProductionData data, bool success ) : void

Handles skill training.

UpdateTool ( Creature creature, ProductionData productData ) : void

Updates tool's durability and proficiency.

Private Methods

Method Description
CheckMana ( Creature creature, ProductionData productData ) : bool

Checks if creature has enough mana to produce product, returns false if not. Handles notices.

Method Details

CheckCategory() protected abstract method

Checks if category can be handled by this skill, returns false if not.
protected abstract CheckCategory ( Creature creature, ProductionCategory category ) : bool
creature Aura.Channel.World.Entities.Creature
category ProductionCategory
return bool

CheckProp() protected method

Checks if prop is valid and in range, returns false if not.
protected CheckProp ( Creature creature, long propEntityId ) : bool
creature Aura.Channel.World.Entities.Creature
propEntityId long
return bool

CheckTools() protected method

Checks tools from Prepare, to maybe cancel skill.
protected CheckTools ( Creature creature, Skill skill, ProductionData productData ) : bool
creature Aura.Channel.World.Entities.Creature
skill Skill
productData ProductionData
return bool

Complete() public method

Completes production.
public Complete ( Creature creature, Skill skill, Packet packet ) : void
creature Aura.Channel.World.Entities.Creature
skill Skill
packet Packet
return void

OnUse() protected method

Called from successful Prepare.
protected OnUse ( Creature creature, Skill skill ) : void
creature Aura.Channel.World.Entities.Creature
skill Skill
return void

Prepare() public method

Starts production, finished in Complete.
public Prepare ( Creature creature, Skill skill, Packet packet ) : bool
creature Aura.Channel.World.Entities.Creature
skill Skill
packet Packet
return bool

SkillTraining() protected abstract method

Handles skill training.
protected abstract SkillTraining ( Creature creature, Skill skill, ProductionData data, bool success ) : void
creature Aura.Channel.World.Entities.Creature
skill Skill
data ProductionData
success bool
return void

UpdateTool() protected method

Updates tool's durability and proficiency.
protected UpdateTool ( Creature creature, ProductionData productData ) : void
creature Aura.Channel.World.Entities.Creature
productData ProductionData
return void