using Newtonsoft.Json; using SCHALE.Common.Database; using SCHALE.Common.FlatData; using System.Net.NetworkInformation; namespace SCHALE.Common.Parcel { public class CurrencyValue { public Dictionary Values { get; set; } public Dictionary Tickets { get; set; } public Dictionary Property { get; set; } public long Gold { get; set; } public long Gem { get; set; } public long GemBonus { get; set; } public long GemPaid { get; set; } public long ActionPoint { get; set; } public long ArenaTicket { get; set; } public long RaidTicket { get; set; } public long WeekDungeonChaserATicket { get; set; } public long WeekDungeonChaserBTicket { get; set; } public long WeekDungeonChaserCTicket { get; set; } public long WeekDungeonFindGiftTicket { get; set; } public long WeekDungeonBloodTicket { get; set; } public long AcademyTicket { get; set; } public long SchoolDungeonATicket { get; set; } public long SchoolDungeonBTicket { get; set; } public long SchoolDungeonCTicket { get; set; } public long TimeAttackDungeonTicket { get; set; } public long MasterCoin { get; set; } public long WorldRaidTicketA { get; set; } public long WorldRaidTicketB { get; set; } public long WorldRaidTicketC { get; set; } public long ChaserTotalTicket { get; set; } public long SchoolDungeonTotalTicket { get; set; } public long EliminateTicketA { get; set; } public long EliminateTicketB { get; set; } public long EliminateTicketC { get; set; } public bool IsEmpty { get; set; } } public class FavorExpTransaction { public ParcelType Type { get; set; } public IEnumerable ParcelInfos { get; set; } public long TargetCharacterUniqueId { get; set; } public long Amount { get; set; } public long Prob { get; set; } } public class FavorParcelValue { public int FavorRank { get; set; } public int FavorExp { get; set; } //public IList Rewards { get; set; } public bool IsEmpty { get; set; } } public class LocationExpTransaction { public ParcelType Type { get; set; } public IEnumerable ParcelInfos { get; set; } public long TargetLocationUniqueId { get; set; } public long Amount { get; set; } } public abstract class ParcelBase { public abstract ParcelType Type { get; } [JsonIgnore] public abstract IEnumerable ParcelInfos { get; } } public class ParcelCost { public List ParcelInfos { get; set; } public CurrencyTransaction Currency { get; set; } public List EquipmentDBs { get; set; } public List ItemDBs { get; set; } public List FurnitureDBs { get; set; } public bool HasCurrency { get; set; } public bool HasItem { get; set; } public IEnumerable ConsumableItemBaseDBs { get; set; } public ConsumeCondition ConsumeCondition { get; set; } } public class ParcelDetail { public ParcelInfo OriginParcel { get; set; } public ParcelInfo MailSendParcel { get; set; } public List ConvertedParcelInfos { get; set; } public ParcelChangeType ParcelChangeType { get; set; } } [Serializable] public struct BasisPoint : IEquatable, IComparable { [JsonIgnore] public long RawValue { get { return this.rawValue; } } private static readonly long Multiplier; private static readonly double OneOver10_4 = 1.0 / 10000.0; public static readonly BasisPoint Zero; public static readonly BasisPoint One; public static readonly BasisPoint Epsilon; public static readonly double DoubleEpsilon; [JsonProperty] private long rawValue; public BasisPoint(long rawValue) { this.rawValue = rawValue; } public bool Equals(BasisPoint other) { return this.rawValue == other.rawValue; } public int CompareTo(BasisPoint other) { return rawValue.CompareTo(other.rawValue); } public static long operator *(long value, BasisPoint other) { return MultiplyLong(value, other); } public static long MultiplyLong(long value, BasisPoint other) { double result = OneOver10_4 * ((double)other.rawValue * value); if (double.IsInfinity(result)) return long.MaxValue; return (long)result; } } public class ParcelInfo : IEquatable { public long Amount { get; set; } public ParcelKeyPair Key { get; set; } public BasisPoint Multiplier { get; set; } public long MultipliedAmount { get { return Amount * Multiplier; } } public BasisPoint Probability { get; set; } public bool Equals(ParcelInfo? other) { return this.Key.Id.Equals(other.Key.Id); } } public class ParcelKeyPair : IEquatable, IComparable { public static readonly ParcelKeyPair Empty; public ParcelType Type { get; set; } public long Id { get; set; } public int CompareTo(ParcelKeyPair? other) { return Id.CompareTo(other.Id); } public bool Equals(ParcelKeyPair? other) { return Id.Equals(other.Id); } } public class ParcelResultDB { public AccountDB AccountDB { get; set; } public List AcademyLocationDBs { get; set; } public AccountCurrencyDB AccountCurrencyDB { get; set; } public List CharacterDBs { get; set; } public List WeaponDBs { get; set; } public List CostumeDBs { get; set; } public List TSSCharacterDBs { get; set; } public Dictionary EquipmentDBs { get; set; } public List RemovedEquipmentIds { get; set; } public Dictionary ItemDBs { get; set; } public List RemovedItemIds { get; set; } public Dictionary FurnitureDBs { get; set; } public List RemovedFurnitureIds { get; set; } public Dictionary IdCardBackgroundDBs { get; set; } public List EmblemDBs { get; set; } public List StickerDBs { get; set; } public List MemoryLobbyDBs { get; set; } public List CharacterNewUniqueIds { get; set; } public Dictionary SecretStoneCharacterIdAndCounts { get; set; } public List DisplaySequence { get; set; } public List ParcelForMission { get; set; } public List ParcelResultStepInfoList { get; set; } public long BaseAccountExp { get; set; } public long AdditionalAccountExp { get; set; } public List GachaResultCharacters { get; set; } } public enum ParcelProcessActionType { // Token: 0x04009F7B RID: 40827 None, // Token: 0x04009F7C RID: 40828 Cost, // Token: 0x04009F7D RID: 40829 Reward } public class ParcelResultStepInfo { public ParcelProcessActionType ParcelProcessActionType { get; set; } public List StepParcelDetails { get; set; } } public class AccountExpTransaction { public ParcelType Type { get; set; } public IEnumerable ParcelInfos { get; set; } public long Amount { get; set; } } public class CharacterExpTransaction { public ParcelType Type { get; set; } public IEnumerable ParcelInfos { get; set; } public long TargetCharacterUniqueId { get; set; } public long Amount { get; set; } } public class CurrencySnapshot { public AccountCurrencyDB LastAccountCurrencyDB { get; set; } public Dictionary CurrencyValues { get; set; } public CurrencyValue currencyValue { get; set; } public DateTime ServerTimeSnapshot { get; set; } public long Gold { get; set; } public long Gem { get; set; } public long GemBonus { get; set; } public long GemPaid { get; set; } public long ActionPoint { get; set; } public long ArenaTicket { get; set; } public long RaidTicket { get; set; } public long WeekDungeonChaserATicket { get; set; } public long WeekDungeonChaserBTicket { get; set; } public long WeekDungeonChaserCTicket { get; set; } public long WeekDungeonFindGiftTicket { get; set; } public long WeekDungeonBloodTicket { get; set; } public long AcademyTicket { get; set; } public long SchoolDungeonATicket { get; set; } public long SchoolDungeonBTicket { get; set; } public long SchoolDungeonCTicket { get; set; } public long TimeAttackDungeonTicket { get; set; } public long MasterCoin { get; set; } public long WorldRaidTicketA { get; set; } public long WorldRaidTicketB { get; set; } public long WorldRaidTicketC { get; set; } public long ChaserTotalTicket { get; set; } public long SchoolDungeonTotalTicket { get; set; } public long EliminateTicketA { get; set; } public long EliminateTicketB { get; set; } public long EliminateTicketC { get; set; } } public class CurrencyTransaction { public CurrencyValue currencyValue { get; set; } public ParcelType Type { get; set; } public IEnumerable ParcelInfos { get; set; } public IDictionary CurrencyValues { get; set; } public CurrencyTransaction Inverse { get; set; } public bool IsEmpty { get; set; } public long Gold { get; set; } public long Gem { get; set; } public long GemBonus { get; set; } public long GemPaid { get; set; } public long ActionPoint { get; set; } public long ArenaTicket { get; set; } public long RaidTicket { get; set; } public long WeekDungeonChaserATicket { get; set; } public long WeekDungeonChaserBTicket { get; set; } public long WeekDungeonChaserCTicket { get; set; } public long WeekDungeonFindGiftTicket { get; set; } public long WeekDungeonBloodTicket { get; set; } public long AcademyTicket { get; set; } public long SchoolDungeonATicket { get; set; } public long SchoolDungeonBTicket { get; set; } public long SchoolDungeonCTicket { get; set; } public long TimeAttackDungeonTicket { get; set; } public long MasterCoin { get; set; } public long WorldRaidTicketA { get; set; } public long WorldRaidTicketB { get; set; } public long WorldRaidTicketC { get; set; } public long ChaserTotalTicket { get; set; } public long SchoolDungeonTotalTicket { get; set; } public long EliminateTicketA { get; set; } public long EliminateTicketB { get; set; } public long EliminateTicketC { get; set; } } }