Exemplo n.º 1
0
            private void run_npc(NpcData data)
            {
                List <NpcDropGroup> items = data.GetDropGroups();

                if (items == null)
                {
                    return;
                }
                //
                NpcDropGroup item;
                decimal      sum         = 0m;
                bool         has_changes = false;
                int          c           = items.Count;

                for (int i = 0; i < c; i++)
                {
                    item = items[i];
                    if (item.GetSum(ref sum))
                    {
                        item.BalanceRemainders(ref sum);
                        has_changes = true;
                        count++;
                    }
                    Total++;
                }
                //
                if (has_changes)
                {
                    data.SetDropGroups(items);
                    NpcMgr.HasChanges = true;
                }
            }
Exemplo n.º 2
0
        private void loadDropGroups(NpcData data)
        {
            hasDropChanges = false;
            lstDropGroups.Children.Clear();
            List <NpcDropGroup> drop_groups = data.GetDropGroups();

            if (drop_groups != null)
            {
                foreach (NpcDropGroup i in drop_groups)
                {
                    appendDropPanel(i);
                }
            }
        }
Exemplo n.º 3
0
            private void run_npc(NpcData data)
            {
                List <NpcDropGroup> items = data.GetDropGroups();

                if (items == null)
                {
                    return;
                }
                //
                PreviewItem  preview_item;
                NpcDropGroup group, src_group;
                decimal      sum = 0m;
                int          cc, c = items.Count;

                for (int i = 0; i < c; i++)
                {
                    src_group = items[i];
                    if (src_group.GetSum(ref sum))
                    {
                        group = src_group.Clone();
                        group.BalanceRemainders(ref sum);
                        //
                        NpcDropItem item, src_item;
                        cc = group.Items.Count;
                        for (int y = 0; y < cc; y++)
                        {
                            item                    = group.Items[y];
                            src_item                = src_group.Items[y];
                            preview_item            = new PreviewItem(data, item);
                            preview_item.ChancePre  = src_item.Chance.ToString("#,##0.#####");
                            preview_item.ChancePost = item.Chance.ToString("#,##0.#####");
                            if (y > 0)
                            {
                                preview_item.NpcName = null;
                            }
                            PreviewItems.Add(preview_item);
                        }
                        count++;
                    }
                    Total++;
                }
            }
Exemplo n.º 4
0
            private void run_npc(NpcData data)
            {
                if (data.AdjustRates(exp_f, sp_f, ref exp_count, ref sp_count))
                {
                    npc_mgr.HasChanges = true;
                }
                //
                if (adena_f == 1f)
                {
                    return;
                }
                //
                bool has_changes          = false;
                List <NpcDropGroup> items = data.GetDropGroups();

                if (items == null)
                {
                    return;
                }
                //
                int c = items.Count;

                for (int i = 0; i < c; i++)
                {
                    if (items[i].AdjustRates(adena_f, true, true, ref adena_count))
                    {
                        has_changes = true;
                    }
                }
                //
                if (has_changes)
                {
                    data.SetDropGroups(items);
                    npc_mgr.HasChanges = true;
                }
            }