示例#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;
                }
            }
        private void saveDropGroups(NpcData data)
        {
            GroupPanel          panel;
            List <NpcDropGroup> drop_groups = new List <NpcDropGroup>();
            int c = lstDropGroups.Children.Count;

            for (int i = 0; i < c; i++)
            {
                panel = (GroupPanel)lstDropGroups.Children[i];
                drop_groups.Add(panel.Write());
            }
            data.SetDropGroups(drop_groups);
        }
示例#3
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;
                }
            }