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

Inheritance: ISkillHandler, IPreparable, IReadyable, IUseable, ICancelable
Exibir arquivo Open project: aura-project/aura

Public Methods

Method Description
Cancel ( Creature creature, Skill skill ) : void

Cancels skill, removing prop.

CheckEquipment ( Creature creature ) : bool

Returns true if creature has valid fishing equipment equipped.

OnResponse ( Creature creature, FishingMethod method, bool success ) : void

Called once ready to pull the fish out.

When you catch something just before running out of bait, and you send MotionCancel2 from Cancel, there's a visual bug on Aura, where the item keeps flying to you until you move. This does not happen on NA for unknown reason. The workaround: Check for cancellation in advance and only send the real in effect if the skill wasn't canceled.

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

Loads skill.

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

Readies skill.

StartFishing ( Creature creature, int delay ) : void

Starts fishing with given delay.

This method uses async Tasks to control when the skill continues (basically timers). Since the player could cancel the skill before the method continues, or props could be removed because of a reload, we need to make sure not to continue and not to crash because of a change in the prop situation. TODO: Use cancellation tokens? TODO: Don't reload spawned props, but only scripted ones?

Training ( Creature creature, Skill skill, bool success, Item item ) : void

Handles skill training.

Use ( Creature creature, Skill skill, Packet packet ) : void

Starts fishing at target location.

Private Methods

Method Description
GetFishingDrop ( Creature creature, Random rnd ) : DropData

Finds best fishing ground match for creature's current fishing prop and gets a random item from it.

Method Details

Cancel() public method

Cancels skill, removing prop.
public Cancel ( Creature creature, Skill skill ) : void
creature Aura.Channel.World.Entities.Creature
skill Skill
return void

CheckEquipment() public method

Returns true if creature has valid fishing equipment equipped.
public CheckEquipment ( Creature creature ) : bool
creature Aura.Channel.World.Entities.Creature
return bool

OnResponse() public method

Called once ready to pull the fish out.
When you catch something just before running out of bait, and you send MotionCancel2 from Cancel, there's a visual bug on Aura, where the item keeps flying to you until you move. This does not happen on NA for unknown reason. The workaround: Check for cancellation in advance and only send the real in effect if the skill wasn't canceled.
public OnResponse ( Creature creature, FishingMethod method, bool success ) : void
creature Aura.Channel.World.Entities.Creature
method FishingMethod Method used on this try
success bool Success of manual try
return void

Prepare() public method

Loads skill.
public Prepare ( Creature creature, Skill skill, Packet packet ) : bool
creature Aura.Channel.World.Entities.Creature
skill Skill
packet Packet
return bool

Ready() public method

Readies skill.
public Ready ( Creature creature, Skill skill, Packet packet ) : bool
creature Aura.Channel.World.Entities.Creature
skill Skill
packet Packet
return bool

StartFishing() public method

Starts fishing with given delay.
This method uses async Tasks to control when the skill continues (basically timers). Since the player could cancel the skill before the method continues, or props could be removed because of a reload, we need to make sure not to continue and not to crash because of a change in the prop situation. TODO: Use cancellation tokens? TODO: Don't reload spawned props, but only scripted ones?
public StartFishing ( Creature creature, int delay ) : void
creature Aura.Channel.World.Entities.Creature
delay int
return void

Training() public method

Handles skill training.
public Training ( Creature creature, Skill skill, bool success, Item item ) : void
creature Aura.Channel.World.Entities.Creature
skill Skill
success bool
item Item
return void

Use() public method

Starts fishing at target location.
public Use ( Creature creature, Skill skill, Packet packet ) : void
creature Aura.Channel.World.Entities.Creature
skill Skill
packet Packet
return void