private void GetAbnormality(string Type, Int64 AbnormalityAddress, int AbnormNumber, string AbnormInternalID, bool IsDebuff, bool HasConditions = false, int ConditionOffset = 0, bool IsInfinite = false, int DoubleBuffStack = 0, int ParentOffset = 0) { float Duration = Scanner.READ_FLOAT(AbnormalityAddress); byte Stack; // Palico and misc buffs don't stack switch (Type) { case "HUNTINGHORN": Stack = Scanner.READ_BYTE(AbnormalityAddress + (0x12C - (0x3 * ((ParentOffset - 0x38) / 4)))); break; case "MISC": if (HasConditions) { Stack = (byte)(Scanner.READ_BYTE(AbnormalityAddress + ConditionOffset)); if (Stack == (byte)0) { HasConditions = false; } } else { Stack = 0; } break; default: Stack = 0; break; } if ((int)Duration <= 0 && !HasConditions) { // Check if there's an abnormality with that ID if (Abnormalities[AbnormInternalID] != null) { Abnormalities.Remove(AbnormInternalID); } else { return; } } else { if ((int)Duration <= 0 && !IsInfinite) { if (Abnormalities[AbnormInternalID] != null) { Abnormalities.Remove(AbnormInternalID); } return; } if (Stack < DoubleBuffStack) { return; } // Check for existing abnormalities before making a new one if (Abnormalities[AbnormInternalID] != null) { Abnormalities[AbnormInternalID].UpdateAbnormalityInfo(Type, AbnormInternalID, Duration, Stack, AbnormNumber, IsDebuff, IsInfinite, AbnormalityData.GetAbnormalityIconByID(Type, AbnormNumber)); } else { Abnormality NewAbnorm = new Abnormality(); NewAbnorm.UpdateAbnormalityInfo(Type, AbnormInternalID, Duration, Stack, AbnormNumber, IsDebuff, IsInfinite, AbnormalityData.GetAbnormalityIconByID(Type, AbnormNumber)); Abnormalities.Add(AbnormInternalID, NewAbnorm); } } }