示例#1
0
        public static void OnDropLootEnd(int x, int y, int width, int height, int type, int stack = 1, bool noBroadcast = false, int prefix = 0, bool noGrabDelay = false, bool reverseLookup = false)
        {
            var ctx = new HookContext();
            var args = new HookArgs.NpcDropLoot()
            {
                State = MethodState.End,

                X = x,
                Y = y,
                Width = width,
                Height = height,
                Type = type,
                Stack = stack,
                NoBroadcast = noBroadcast,
                Prefix = prefix,
                NoGrabDelay = noGrabDelay,
                ReverseLookup = reverseLookup
            };

            HookPoints.NpcDropLoot.Invoke(ref ctx, ref args);
        }
示例#2
0
        public static bool OnDropLootBegin(ref int itemId, int x, int y, int width, int height, int type, int stack = 1, bool noBroadcast = false, int prefix = 0, bool noGrabDelay = false, bool reverseLookup = false)
        {
            itemId = 0;

            var ctx = new HookContext();
            var args = new HookArgs.NpcDropLoot()
            {
                State = MethodState.Begin,

                X = x,
                Y = y,
                Width = width,
                Height = height,
                Type = type,
                Stack = stack,
                NoBroadcast = noBroadcast,
                Prefix = prefix,
                NoGrabDelay = noGrabDelay,
                ReverseLookup = reverseLookup
            };

            HookPoints.NpcDropLoot.Invoke(ref ctx, ref args);

            if (ctx.ResultParam != null && ctx.ResultParam is int)
                itemId = (int)ctx.ResultParam;
            else if (ctx.Result == HookResult.IGNORE)
                itemId = -1;

            return ctx.Result == HookResult.DEFAULT; //If default then continue on to vanillacode
        }