C# Class Aura.Channel.Skills.Life.Cooking

Inheritance: IPreparable, ICompletable, IInitiableSkillHandler
Show file Open project: aura-project/aura

Public Methods

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

Completes skill, creating the item.

GetTime ( string method ) : int
Init ( ) : void

Sets up subscriptions required for skill training.

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

Prepares skill, specifying the ingredients.

Private Methods

Method Description
CheckProp ( Creature creature, string method, long propEntityId ) : bool

Checks prop for method, returns true if everything is in order.

CheckRank ( Creature creature, string method, SkillRank skillRank ) : bool

Checks rank for method, returns true if everything is in order.

CheckTools ( Creature creature, string method ) : bool

Checks tools for method, returns true if everything is in order.

GetRating ( int val ) : Rating

Returns star rating based on quality.

JudgeQuality ( RecipeData recipe, List ingredients ) : Judgement

Calculates quality based on recipe and ingredients.

The formula used in this method is unofficial. While it does feel very similar in some test cases, it could potentially create very different results. Officials also RNG the results, which this method currently does not. The Help fields in the return value specify a tip on what went wrong with the cooking attempt, if certain requirements are fulfilled. In that case it will set the item to the item in question, and the amount to the amount the ingredient differed from the recipe. If the value is lower than 0, it was less, if it's greater, it was more. If no helpful tip could be found, item is null.

OnPlayerUsesItem ( Creature creature, Item item ) : void

Handles part of the skill training.

OnSuccessfulCooking ( Creature creature, Skill skill, string method, Item item, Rating rating ) : void

Handles part of the skill training.

Method Details

Complete() public method

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

GetTime() public method

public GetTime ( string method ) : int
method string
return int

Init() public method

Sets up subscriptions required for skill training.
public Init ( ) : void
return void

Prepare() public method

Prepares skill, specifying the ingredients.
public Prepare ( Creature creature, Skill skill, Packet packet ) : bool
creature Aura.Channel.World.Entities.Creature
skill Skill
packet Packet
return bool