// Token: 0x06003446 RID: 13382 RVA: 0x00154BA0 File Offset: 0x00152FA0 public static bool doesLogicPass <T>(ENPCLogicType logicType, T a, T b) where T : IComparable { int num = a.CompareTo(b); switch (logicType) { case ENPCLogicType.LESS_THAN: return(num < 0); case ENPCLogicType.LESS_THAN_OR_EQUAL_TO: return(num <= 0); case ENPCLogicType.EQUAL: return(num == 0); case ENPCLogicType.NOT_EQUAL: return(num != 0); case ENPCLogicType.GREATER_THAN_OR_EQUAL_TO: return(num >= 0); case ENPCLogicType.GREATER_THAN: return(num > 0); default: return(false); } }
// Token: 0x06001C15 RID: 7189 RVA: 0x000993A7 File Offset: 0x000977A7 public NPCShortFlagCondition(ushort newID, short newValue, bool newAllowUnset, ENPCLogicType newLogicType, string newText, bool newShouldReset) : base(newID, newAllowUnset, newLogicType, newText, newShouldReset) { this.value = newValue; }
public NPCReputationCondition(int newReputation, ENPCLogicType newLogicType, string newText) : base(newLogicType, newText, false) { this.reputation = newReputation; }
// Token: 0x06001B8F RID: 7055 RVA: 0x00097ECC File Offset: 0x000962CC public NPCExperienceCondition(uint newExperience, ENPCLogicType newLogicType, string newText, bool newShouldReset) : base(newLogicType, newText, newShouldReset) { this.experience = newExperience; }
// Token: 0x06001BE7 RID: 7143 RVA: 0x00098DD3 File Offset: 0x000971D3 public NPCPlayerLifeVirusCondition(int newVirus, ENPCLogicType newLogicType, string newText) : base(newLogicType, newText, false) { this.virus = newVirus; }
// Token: 0x06001BD3 RID: 7123 RVA: 0x00098C3B File Offset: 0x0009703B public NPCPlayerKillsCondition(ushort newID, short newValue, short newTheirRep, ENPCLogicType newTheirRepLogic, string newText, bool newShouldReset) : base(newText, newShouldReset) { this.id = newID; this.value = newValue; this.theirRep = newTheirRep; this.theirRepLogic = newTheirRepLogic; }
public NPCQuestCondition(ushort newID, ENPCQuestStatus newStatus, bool newIgnoreNPC, ENPCLogicType newLogicType, string newText, bool newShouldReset) : base(newLogicType, newText, newShouldReset) { this.id = newID; this.status = newStatus; this.ignoreNPC = newIgnoreNPC; }
// Token: 0x06001BEB RID: 7147 RVA: 0x00098E0F File Offset: 0x0009720F public NPCPlayerLifeWaterCondition(int newWater, ENPCLogicType newLogicType, string newText) : base(newLogicType, newText, false) { this.water = newWater; }
// Token: 0x06003447 RID: 13383 RVA: 0x00154C10 File Offset: 0x00153010 public static void readConditions(Data data, Local localization, string prefix, INPCCondition[] conditions, string errorMessageSource) { for (int i = 0; i < conditions.Length; i++) { if (!data.has(prefix + i + "_Type")) { Assets.errors.Add(string.Concat(new object[] { "Missing condition ", prefix, i, " type" })); throw new NotSupportedException(string.Concat(new object[] { "Missing condition ", prefix, i, " type" })); } ENPCConditionType enpcconditionType = (ENPCConditionType)Enum.Parse(typeof(ENPCConditionType), data.readString(prefix + i + "_Type"), true); string text = localization.read(prefix + i); text = ItemTool.filterRarityRichText(text); bool newShouldReset = data.has(prefix + i + "_Reset"); ENPCLogicType newLogicType = ENPCLogicType.NONE; if (data.has(prefix + i + "_Logic")) { newLogicType = (ENPCLogicType)Enum.Parse(typeof(ENPCLogicType), data.readString(prefix + i + "_Logic"), true); } switch (enpcconditionType) { case ENPCConditionType.EXPERIENCE: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Experience condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCExperienceCondition(data.readUInt32(prefix + i + "_Value"), newLogicType, text, newShouldReset); break; case ENPCConditionType.REPUTATION: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Reputation condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCReputationCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.FLAG_BOOL: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Bool flag condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Bool flag condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCBoolFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.FLAG_SHORT: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Short flag condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Short flag condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCShortFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.QUEST: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Quest condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Status")) { Assets.errors.Add(string.Concat(new object[] { "Quest condition ", prefix, i, " missing _Status in: ", errorMessageSource })); } conditions[i] = new NPCQuestCondition(data.readUInt16(prefix + i + "_ID"), (ENPCQuestStatus)Enum.Parse(typeof(ENPCQuestStatus), data.readString(prefix + i + "_Status"), true), data.has(prefix + i + "_Ignore_NPC"), newLogicType, text, newShouldReset); break; case ENPCConditionType.SKILLSET: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Skillset condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCSkillsetCondition((EPlayerSkillset)Enum.Parse(typeof(EPlayerSkillset), data.readString(prefix + i + "_Value"), true), newLogicType, text); break; case ENPCConditionType.ITEM: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Item condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Amount")) { Assets.errors.Add(string.Concat(new object[] { "Item condition ", prefix, i, " missing _Amount in: ", errorMessageSource })); } conditions[i] = new NPCItemCondition(data.readUInt16(prefix + i + "_ID"), data.readUInt16(prefix + i + "_Amount"), text, newShouldReset); break; case ENPCConditionType.KILLS_ZOMBIE: { if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Zombie kills condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Zombie kills condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } EZombieSpeciality newZombie = EZombieSpeciality.NONE; if (data.has(prefix + i + "_Zombie")) { newZombie = (EZombieSpeciality)Enum.Parse(typeof(EZombieSpeciality), data.readString(prefix + i + "_Zombie"), true); } else { Assets.errors.Add(string.Concat(new object[] { "Zombie kills condition ", prefix, i, " missing _Zombie in: ", errorMessageSource })); } conditions[i] = new NPCZombieKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), newZombie, data.has(prefix + i + "_Spawn"), data.readByte(prefix + i + "_Nav"), text, newShouldReset); break; } case ENPCConditionType.KILLS_HORDE: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Horde kills condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Horde kills condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Nav")) { Assets.errors.Add(string.Concat(new object[] { "Horde kills condition ", prefix, i, " missing _Nav in: ", errorMessageSource })); } conditions[i] = new NPCHordeKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.readByte(prefix + i + "_Nav"), text, newShouldReset); break; case ENPCConditionType.KILLS_ANIMAL: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Animal kills condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Animal kills condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Animal")) { Assets.errors.Add(string.Concat(new object[] { "Animal kills condition ", prefix, i, " missing _Animal in: ", errorMessageSource })); } conditions[i] = new NPCAnimalKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.readUInt16(prefix + i + "_Animal"), text, newShouldReset); break; case ENPCConditionType.COMPARE_FLAGS: if (!data.has(prefix + i + "_A_ID")) { Assets.errors.Add(string.Concat(new object[] { "Compare flags condition ", prefix, i, " missing _A_ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_B_ID")) { Assets.errors.Add(string.Concat(new object[] { "Compare flags condition ", prefix, i, " missing _B_ID in: ", errorMessageSource })); } conditions[i] = new NPCCompareFlagsCondition(data.readUInt16(prefix + i + "_A_ID"), data.readUInt16(prefix + i + "_B_ID"), data.has(prefix + i + "_Allow_A_Unset"), data.has(prefix + i + "_Allow_B_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.TIME_OF_DAY: if (!data.has(prefix + i + "_Second")) { Assets.errors.Add(string.Concat(new object[] { "Time of day condition ", prefix, i, " missing _Second in: ", errorMessageSource })); } conditions[i] = new NPCTimeOfDayCondition(data.readInt32(prefix + i + "_Second"), newLogicType, text, newShouldReset); break; case ENPCConditionType.PLAYER_LIFE_HEALTH: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Player life health condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCPlayerLifeHealthCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.PLAYER_LIFE_FOOD: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Player life food condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCPlayerLifeFoodCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.PLAYER_LIFE_WATER: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Player life water condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCPlayerLifeWaterCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.PLAYER_LIFE_VIRUS: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Player life virus condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCPlayerLifeVirusCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; } } }
// Token: 0x06001B9A RID: 7066 RVA: 0x00097BAC File Offset: 0x00095FAC public NPCFlagCondition(ushort newID, bool newAllowUnset, ENPCLogicType newLogicType, string newText, bool newShouldReset) : base(newLogicType, newText, newShouldReset) { this.id = newID; this.allowUnset = newAllowUnset; }
// Token: 0x06001B81 RID: 7041 RVA: 0x00097D5C File Offset: 0x0009615C public NPCCompareFlagsCondition(ushort newFlag_A_ID, ushort newFlag_B_ID, bool newAllowFlag_A_Unset, bool newAllowFlag_B_Unset, ENPCLogicType newLogicType, string newText, bool newShouldReset) : base(newLogicType, newText, newShouldReset) { this.flag_A_ID = newFlag_A_ID; this.allowFlag_A_Unset = newAllowFlag_A_Unset; this.flag_B_ID = newFlag_B_ID; this.allowFlag_B_Unset = newAllowFlag_B_Unset; }
public NPCLogicCondition(ENPCLogicType newLogicType, string newText, bool newShouldReset) : base(newText, newShouldReset) { this.logicType = newLogicType; }
// Token: 0x06001BE3 RID: 7139 RVA: 0x00098D97 File Offset: 0x00097197 public NPCPlayerLifeHealthCondition(int newHealth, ENPCLogicType newLogicType, string newText) : base(newLogicType, newText, false) { this.health = newHealth; }
// Token: 0x06001C2B RID: 7211 RVA: 0x0009958B File Offset: 0x0009798B public NPCTimeOfDayCondition(int newSecond, ENPCLogicType newLogicType, string newText, bool newShouldReset) : base(newLogicType, newText, newShouldReset) { this.second = newSecond; }
// Token: 0x06001BDF RID: 7135 RVA: 0x00098D5B File Offset: 0x0009715B public NPCPlayerLifeFoodCondition(int newFood, ENPCLogicType newLogicType, string newText) : base(newLogicType, newText, false) { this.food = newFood; }
public NPCSkillsetCondition(EPlayerSkillset newSkillset, ENPCLogicType newLogicType, string newText) : base(newLogicType, newText, false) { this.skillset = newSkillset; }
public static void readConditions(Data data, Local localization, string prefix, INPCCondition[] conditions) { for (int i = 0; i < conditions.Length; i++) { if (!data.has(prefix + i + "_Type")) { throw new NotSupportedException("Missing condition type"); } ENPCConditionType enpcconditionType = (ENPCConditionType)Enum.Parse(typeof(ENPCConditionType), data.readString(prefix + i + "_Type"), true); string text = localization.read(prefix + i); text = ItemTool.filterRarityRichText(text); bool newShouldReset = data.has(prefix + i + "_Reset"); ENPCLogicType newLogicType = ENPCLogicType.NONE; if (data.has(prefix + i + "_Logic")) { newLogicType = (ENPCLogicType)Enum.Parse(typeof(ENPCLogicType), data.readString(prefix + i + "_Logic"), true); } switch (enpcconditionType) { case ENPCConditionType.EXPERIENCE: conditions[i] = new NPCExperienceCondition(data.readUInt32(prefix + i + "_Value"), newLogicType, text, newShouldReset); break; case ENPCConditionType.REPUTATION: conditions[i] = new NPCReputationCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.FLAG_BOOL: conditions[i] = new NPCBoolFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.FLAG_SHORT: conditions[i] = new NPCShortFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.QUEST: conditions[i] = new NPCQuestCondition(data.readUInt16(prefix + i + "_ID"), (ENPCQuestStatus)Enum.Parse(typeof(ENPCQuestStatus), data.readString(prefix + i + "_Status"), true), data.has(prefix + i + "_Ignore_NPC"), newLogicType, text, newShouldReset); break; case ENPCConditionType.SKILLSET: conditions[i] = new NPCSkillsetCondition((EPlayerSkillset)Enum.Parse(typeof(EPlayerSkillset), data.readString(prefix + i + "_Value"), true), newLogicType, text); break; case ENPCConditionType.ITEM: conditions[i] = new NPCItemCondition(data.readUInt16(prefix + i + "_ID"), data.readUInt16(prefix + i + "_Amount"), text, newShouldReset); break; case ENPCConditionType.KILLS_ZOMBIE: { EZombieSpeciality newZombie = EZombieSpeciality.NONE; if (data.has(prefix + i + "_Zombie")) { newZombie = (EZombieSpeciality)Enum.Parse(typeof(EZombieSpeciality), data.readString(prefix + i + "_Zombie"), true); } conditions[i] = new NPCZombieKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), newZombie, data.has(prefix + i + "_Spawn"), data.readByte(prefix + i + "_Nav"), text, newShouldReset); break; } case ENPCConditionType.KILLS_HORDE: conditions[i] = new NPCHordeKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.readByte(prefix + i + "_Nav"), text, newShouldReset); break; } } }