Пример #1
0
        protected override void ExportStats(IDictionary <StatsType, object> stats)
        {
            base.ExportStats(stats);
            stats[StatsType.AccountId] = AccountId;
            stats[StatsType.Name]      = Name;

            stats[StatsType.Experience]     = Experience - GetLevelExp(Level);
            stats[StatsType.ExperienceGoal] = ExperienceGoal;
            stats[StatsType.Level]          = Level;

            stats[StatsType.CurrentFame] = CurrentFame;
            stats[StatsType.Fame]        = Fame;
            stats[StatsType.FameGoal]    = FameGoal;
            stats[StatsType.Stars]       = Stars;

            stats[StatsType.Guild]     = Guild;
            stats[StatsType.GuildRank] = GuildRank;

            stats[StatsType.Credits]    = Credits;
            stats[StatsType.Tokens]     = Tokens;
            stats[StatsType.NameChosen] = NameChosen ? 1 : 0;
            stats[StatsType.Texture1]   = Texture1;
            stats[StatsType.Texture2]   = Texture2;

            if (Glowing)
            {
                stats[StatsType.Glowing] = 1;
            }

            stats[StatsType.HP] = HP;
            stats[StatsType.MP] = Mp;

            stats[StatsType.Inventory0]  = Inventory[0]?.ObjectType ?? -1;
            stats[StatsType.Inventory1]  = Inventory[1]?.ObjectType ?? -1;
            stats[StatsType.Inventory2]  = Inventory[2]?.ObjectType ?? -1;
            stats[StatsType.Inventory3]  = Inventory[3]?.ObjectType ?? -1;
            stats[StatsType.Inventory4]  = Inventory[4]?.ObjectType ?? -1;
            stats[StatsType.Inventory5]  = Inventory[5]?.ObjectType ?? -1;
            stats[StatsType.Inventory6]  = Inventory[6]?.ObjectType ?? -1;
            stats[StatsType.Inventory7]  = Inventory[7]?.ObjectType ?? -1;
            stats[StatsType.Inventory8]  = Inventory[8]?.ObjectType ?? -1;
            stats[StatsType.Inventory9]  = Inventory[9]?.ObjectType ?? -1;
            stats[StatsType.Inventory10] = Inventory[10]?.ObjectType ?? -1;
            stats[StatsType.Inventory11] = Inventory[11]?.ObjectType ?? -1;

            if (Boost == null)
            {
                CalcBoost();
            }

            if (Boost != null)
            {
                stats[StatsType.MaximumHP] = Stats[0] + Boost[0];
                stats[StatsType.MaximumMP] = Stats[1] + Boost[1];
                stats[StatsType.Attack]    = Stats[2] + Boost[2];
                stats[StatsType.Defense]   = Stats[3] + Boost[3];
                stats[StatsType.Speed]     = Stats[4] + Boost[4];
                stats[StatsType.Vitality]  = Stats[5] + Boost[5];
                stats[StatsType.Wisdom]    = Stats[6] + Boost[6];
                stats[StatsType.Dexterity] = Stats[7] + Boost[7];

                stats[StatsType.HPBoost]        = Boost[0];
                stats[StatsType.MPBoost]        = Boost[1];
                stats[StatsType.AttackBonus]    = Boost[2];
                stats[StatsType.DefenseBonus]   = Boost[3];
                stats[StatsType.SpeedBonus]     = Boost[4];
                stats[StatsType.VitalityBonus]  = Boost[5];
                stats[StatsType.WisdomBonus]    = Boost[6];
                stats[StatsType.DexterityBonus] = Boost[7];
            }

            stats[StatsType.Size] = Resize16x16Skins.IsSkin16x16Type(PlayerSkin) ? 70 : setTypeSkin?.Size ?? Size;

            stats[StatsType.Has_Backpack] = HasBackpack.GetHashCode();

            stats[StatsType.Backpack0] = HasBackpack ? (Inventory[12]?.ObjectType ?? -1) : -1;
            stats[StatsType.Backpack1] = HasBackpack ? (Inventory[13]?.ObjectType ?? -1) : -1;
            stats[StatsType.Backpack2] = HasBackpack ? (Inventory[14]?.ObjectType ?? -1) : -1;
            stats[StatsType.Backpack3] = HasBackpack ? (Inventory[15]?.ObjectType ?? -1) : -1;
            stats[StatsType.Backpack4] = HasBackpack ? (Inventory[16]?.ObjectType ?? -1) : -1;
            stats[StatsType.Backpack5] = HasBackpack ? (Inventory[17]?.ObjectType ?? -1) : -1;
            stats[StatsType.Backpack6] = HasBackpack ? (Inventory[18]?.ObjectType ?? -1) : -1;
            stats[StatsType.Backpack7] = HasBackpack ? (Inventory[19]?.ObjectType ?? -1) : -1;

            stats[StatsType.Skin]            = setTypeSkin?.SkinType ?? PlayerSkin;
            stats[StatsType.HealStackCount]  = HealthPotions;
            stats[StatsType.MagicStackCount] = MagicPotions;

            if (Owner?.Name == "Ocean Trench")
            {
                stats[StatsType.OxygenBar] = OxygenBar;
            }

            stats[StatsType.XpBoosterActive]    = XpBoosted ? 1 : 0;
            stats[StatsType.XpBoosterTime]      = (int)XpBoostTimeLeft;
            stats[StatsType.LootDropBoostTimer] = (int)LootDropBoostTimeLeft;
            stats[StatsType.LootTierBoostTimer] = (int)LootTierBoostTimeLeft;

            stats[StatsType.AccountType] = (int)AccountType;
            stats[StatsType.Admin]       = Admin;
        }
        protected override void ExportStats(IDictionary <StatsType, object> stats)
        {
            base.ExportStats(stats);
            stats[StatsType.ACCOUNT_ID_STAT] = AccountId;
            stats[StatsType.NAME_STAT]       = Name;

            stats[StatsType.EXP_STAT]            = Experience - GetExperience(Level, ExpType.Level);
            stats[StatsType.NEXT_LEVEL_EXP_STAT] = ExperienceGoal - GetExperience(Level, ExpType.Level);
            stats[StatsType.LEVEL_STAT]          = Level;

            stats[StatsType.ATTACK_EXP_STAT]      = AttackExperience - GetExperience(AttackLevel - 10, ExpType.Stat);
            stats[StatsType.NEXT_ATTACK_EXP_STAT] = AttackGoalExperience - GetExperience(AttackLevel - 10, ExpType.Stat);
            stats[StatsType.ATTACK_LEVEL_STAT]    = AttackLevel;

            stats[StatsType.DEFENSE_EXP_STAT]      = DefenseExperience - GetExperience(DefenseLevel - 10, ExpType.Stat);
            stats[StatsType.NEXT_DEFENSE_EXP_STAT] = DefenseGoalExperience - GetExperience(DefenseLevel - 10, ExpType.Stat);
            stats[StatsType.DEFENSE_LEVEL_STAT]    = DefenseLevel;

            stats[StatsType.FAME_STAT]                  = CurrentFame;
            stats[StatsType.CURR_FAME_STAT]             = Fame;
            stats[StatsType.NEXT_CLASS_QUEST_FAME_STAT] = FameGoal;
            stats[StatsType.NUM_STARS_STAT]             = Stars;

            stats[StatsType.GUILD_NAME_STAT] = Guild;
            stats[StatsType.GUILD_RANK_STAT] = GuildRank;

            stats[StatsType.CREDITS_STAT]       = Credits;
            stats[StatsType.FORTUNE_TOKEN_STAT] = Tokens;
            stats[StatsType.NAME_CHOSEN_STAT]   = NameChosen ? 1 : 0;
            stats[StatsType.TEX1_STAT]          = Texture1;
            stats[StatsType.TEX2_STAT]          = Texture2;

            if (Glowing)
            {
                stats[StatsType.GLOW_COLOR_STAT] = 1;
            }

            if (AccountType >= (int)Core.config.AccountType.VIP)
            {
                stats[StatsType.GLOW_COLOR_STAT] = new Random().Next(0x000000, 0xffffff);
            }

            stats[StatsType.HP_STAT] = HP;
            stats[StatsType.MP_STAT] = MP;

            stats[StatsType.INVENTORY_0_STAT]  = Inventory[0]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_1_STAT]  = Inventory[1]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_2_STAT]  = Inventory[2]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_3_STAT]  = Inventory[3]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_4_STAT]  = Inventory[4]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_5_STAT]  = Inventory[5]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_6_STAT]  = Inventory[6]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_7_STAT]  = Inventory[7]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_8_STAT]  = Inventory[8]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_9_STAT]  = Inventory[9]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_10_STAT] = Inventory[10]?.ObjectType ?? -1;
            stats[StatsType.INVENTORY_11_STAT] = Inventory[11]?.ObjectType ?? -1;

            if (Boost == null)
            {
                CalculateBoost();
            }

            if (Boost != null)
            {
                stats[StatsType.MAX_HP_STAT]    = Stats[0] + Boost[0];
                stats[StatsType.MAX_MP_STAT]    = Stats[1] + Boost[1];
                stats[StatsType.ATTACK_STAT]    = Stats[2] + Boost[2];
                stats[StatsType.DEFENSE_STAT]   = Stats[3] + Boost[3];
                stats[StatsType.SPEED_STAT]     = Stats[4] + Boost[4];
                stats[StatsType.VITALITY_STAT]  = Stats[5] + Boost[5];
                stats[StatsType.WISDOM_STAT]    = Stats[6] + Boost[6];
                stats[StatsType.DEXTERITY_STAT] = Stats[7] + Boost[7];

                stats[StatsType.MAX_HP_BOOST_STAT]    = Boost[0];
                stats[StatsType.MAX_MP_BOOST_STAT]    = Boost[1];
                stats[StatsType.ATTACK_BOOST_STAT]    = Boost[2];
                stats[StatsType.DEFENSE_BOOST_STAT]   = Boost[3];
                stats[StatsType.SPEED_BOOST_STAT]     = Boost[4];
                stats[StatsType.VITALITY_BOOST_STAT]  = Boost[5];
                stats[StatsType.WISDOM_BOOST_STAT]    = Boost[6];
                stats[StatsType.DEXTERITY_BOOST_STAT] = Boost[7];
            }

            stats[StatsType.SIZE_STAT] = (int)((Resize16x16Skins.IsSkin16x16Type(PlayerSkin) ? 70 : setTypeSkin?.Size ?? Size) * ((Client?.Character?.Size ?? 100) / 100.0f));

            stats[StatsType.HASBACKPACK_STAT] = HasBackpack.GetHashCode();

            stats[StatsType.BACKPACK_0_STAT] = HasBackpack ? (Inventory[12]?.ObjectType ?? -1) : -1;
            stats[StatsType.BACKPACK_1_STAT] = HasBackpack ? (Inventory[13]?.ObjectType ?? -1) : -1;
            stats[StatsType.BACKPACK_2_STAT] = HasBackpack ? (Inventory[14]?.ObjectType ?? -1) : -1;
            stats[StatsType.BACKPACK_3_STAT] = HasBackpack ? (Inventory[15]?.ObjectType ?? -1) : -1;
            stats[StatsType.BACKPACK_4_STAT] = HasBackpack ? (Inventory[16]?.ObjectType ?? -1) : -1;
            stats[StatsType.BACKPACK_5_STAT] = HasBackpack ? (Inventory[17]?.ObjectType ?? -1) : -1;
            stats[StatsType.BACKPACK_6_STAT] = HasBackpack ? (Inventory[18]?.ObjectType ?? -1) : -1;
            stats[StatsType.BACKPACK_7_STAT] = HasBackpack ? (Inventory[19]?.ObjectType ?? -1) : -1;

            stats[StatsType.TEXTURE_STAT]             = setTypeSkin?.SkinType ?? PlayerSkin;
            stats[StatsType.HEALTH_POTION_STACK_STAT] = HealthPotions;
            stats[StatsType.MAGIC_POTION_STACK_STAT]  = MagicPotions;

            if (Owner?.Name == "Ocean Trench")
            {
                stats[StatsType.BREATH_STAT] = OxygenBar;
            }

            stats[StatsType.XP_BOOSTED_STAT] = XpBoosted ? 1 : 0;
            stats[StatsType.XP_TIMER_STAT]   = (int)XpBoostTimeLeft;
            stats[StatsType.LD_TIMER_STAT]   = (int)LootDropBoostTimeLeft;
            stats[StatsType.LT_TIMER_STAT]   = (int)LootTierBoostTimeLeft;

            stats[StatsType.ACCOUNT_TYPE] = AccountType;
            stats[StatsType.ADMIN]        = Admin;

            stats[StatsType.PET_OBJECT_ID] = PetID;

            if (PetID != 0)
            {
                try
                {
                    if (PetHealing != null)
                    {
                        stats[StatsType.PET_HP_HEALING_AVERAGE_MIN]   = PetHealing[0][0];
                        stats[StatsType.PET_HP_HEALING_AVERAGE_MAX]   = PetHealing[0][1];
                        stats[StatsType.PET_HP_HEALING_AVERAGE_BONUS] = PetHealing[0][2];
                        stats[StatsType.PET_MP_HEALING_AVERAGE_MIN]   = PetHealing[1][0];
                        stats[StatsType.PET_MP_HEALING_AVERAGE_MAX]   = PetHealing[1][1];
                        stats[StatsType.PET_MP_HEALING_AVERAGE_BONUS] = PetHealing[1][2];
                    }
                    if (PetAttack != null)
                    {
                        stats[StatsType.PET_ATTACK_COOLDOWN]   = PetAttack[0];
                        stats[StatsType.PET_ATTACK_CHANCE]     = PetAttack[1];
                        stats[StatsType.PET_ATTACK_DAMAGE_MIN] = PetAttack[2];
                        stats[StatsType.PET_ATTACK_DAMAGE_MAX] = PetAttack[3];
                    }
                }
                catch { } // just don't return errors, hold this exception without export any value
            }
        }