using System.Linq; public class DialogRequirementHasCurrentOrder : BaseDialogRequirement { public override bool CheckRequirement(EntityPlayer player, EntityNPC talkingTo) { EntityAliveV2 myEntity = (EntityAliveV2)talkingTo; if (myEntity != null) { // Split the Value string by commas, parse each part to an integer, and create a list var values = Value.Split(',') .Select(v => int.Parse(v.Trim())) .ToList(); // Get the CurrentOrder from myEntity int currentOrder = (int)myEntity.Buffs.GetCustomVar("CurrentOrder"); // Check if CurrentOrder is one of the values if (values.Contains(currentOrder)) { //Log.Out("DialogRequirementHasCurrentOrder-CheckRequirement true"); return true; } } //Log.Out("DialogRequirementHasCurrentOrder-CheckRequirement false"); return false; } }