private bool CheckProp(Creature creature, string method, long propEntityId)
{
switch (method)
{
// Does't require a prop
case CookingMethod.Mixing:
case CookingMethod.Kneading:
case CookingMethod.NoodleMaking:
case CookingMethod.PastaMaking:
case CookingMethod.PieMaking:
return true;
// Requires a prop, continue to checks.
case CookingMethod.Baking:
case CookingMethod.Simmering:
case CookingMethod.Boiling:
case CookingMethod.DeepFrying:
case CookingMethod.StirFrying:
case CookingMethod.JamMaking:
case CookingMethod.Steaming:
break;
default:
Log.Error("Cooking.CheckProp: Unknown cooking method.");
return false;
}
// Check prop id
if (propEntityId == 0)
return false;
// Check prop
var prop = creature.Region.GetProp(propEntityId);
if (prop == null)
return false;
// Check range
if (!creature.GetPosition().InRange(prop.GetPosition(), 500))
{
Send.Notice(creature, Localization.Get("You are too far away."));
return false;
}
// Check prop type
if (!prop.HasTag("/cooker/"))
return false;
return true;
}