Ejemplo n.º 1
0
        public override void DoAction(IEventArgs args)
        {
            FreeRuleEventArgs fr = (FreeRuleEventArgs)args;

            if (StringUtil.IsNullOrEmpty(count) || count.Equals("0"))
            {
                count = INI_COUNT;
            }
            int      c    = FreeUtil.ReplaceInt(count, args);
            FreeItem item = FreeItemManager.GetItem(fr, FreeUtil.ReplaceVar(key, args), c);

            if (item != null)
            {
                if (!StringUtil.IsNullOrEmpty(time))
                {
                    ((FreeGameItem)item).SetTime(time);
                }
                item.Drop(fr, pos.Select(args));
                if (action != null)
                {
                    args.TempUse(ParaConstant.PARA_ITEM, item);
                    action.Act(args);
                    args.Resume(ParaConstant.PARA_ITEM);
                }
            }
        }
Ejemplo n.º 2
0
        public override void DoAction(IEventArgs args)
        {
            FreeRuleEventArgs fr = (FreeRuleEventArgs)args;
            IParable          pe = args.GetUnit(item);

            if (pe != null && pe is FreeItem)
            {
                FreeItem fi = (FreeItem)pe;
                if (!StringUtil.IsNullOrEmpty(time))
                {
                    ((FreeGameItem)fi).SetTime(time);
                }
                fi.Drop(fr, pos.Select(args));
            }
        }