Aura.Channel.Skills.Base.ProductionSkill.CheckTools C# (CSharp) 메소드

CheckTools() 보호된 메소드

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
리턴 bool
		protected virtual bool CheckTools(Creature creature, Skill skill, ProductionData productData)
		{
			// Sanity checks, the client should be handling this.

			// If null, anything can be equipped
			if (productData.Tool == null)
				return true;

			if (productData.Tool == "/barehand/")
			{
				// Fail if bare hand required but an item is equipped
				if (creature.RightHand != null)
				{
					Log.Warning("ProductionSkill.Complete: User '{0}' tried to produce without empty hands.", creature.Client.Account.Id);
					return false;
				}
			}
			else
			{
				// Fail if no item or the wrong one is equipped
				if (creature.RightHand == null || !creature.RightHand.HasTag(productData.Tool))
				{
					Log.Warning("ProductionSkill.Complete: Creature '{0:X16}' tried to produce without the appropriate tool.", creature.EntityId);
					return false;
				}
			}

			// TODO: Check durability? What happens if tool is unusable?

			return true;
		}