吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 7496|回复: 15
收起左侧

[C&C++ 转载] 关于英雄联盟无限红蓝源代码

[复制链接]
xh5510 发表于 2014-11-19 19:52
[Asm] 纯文本查看 复制代码
//rito hire me pls

#region

using System;
using System.Collections.Generic;
using System.Linq;
using LeagueSharp;
using LeagueSharp.Common;

#endregion

namespace RefundExploiter
{
    internal class Program
    {
        public static Menu Menu;

        public static List<int> Consumables = new List<int> { 2003, 2004, 2009, 2010, 2037, 2039, 2043, 2044, 2047 };
        public static List<int> NoCD = new List<int> { 3074, 3140, 3153, };

        public static int RefundItemId = 0;
        private static byte RefundInventorySlot;

        public static bool Swapped = false;
        public static bool Refunded = false;
        public static bool BotrkInSlot = false;

        private static void Main(string[] args)
        {
            CustomEvents.Game.OnGameLoad += Game_OnGameLoad;
        }

        private static void Game_OnGameLoad(EventArgs args)
        {
            Menu = new Menu("RefundExploiter", "RefundExploiter", true);
            Menu.AddItem(new MenuItem("Enabled", "Enabled").SetValue(false));
            Menu.AddItem(new MenuItem("Consumables", "Exploit Consumables").SetValue(true));
            Menu.AddItem(new MenuItem("NoCD", "Exploit No-CD Items").SetValue(true));
            Menu.AddItem(new MenuItem("Cast", "Cast").SetValue(new KeyBind(32, KeyBindType.Press)));
            Menu.AddToMainMenu();

            Game.OnGameProcessPacket += Game_OnGameProcessPacket;
            Game.OnGameUpdate += Game_OnGameUpdate;
            Game.PrintChat("Refund Exploit by Trees and blm95 loaded!");
            //rito hire me pls
        }

        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (!BotrkInSlot || !Menu.Item("Cast").GetValue<KeyBind>().Active)
            {
                return;
            }

            ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);

            foreach (var p in
                ObjectManager.Get<Obj_AI_Hero>()
                    .Where(h => h.IsValidTarget(500))
                    .Select(enemy => new Packet.C2S.Cast.Struct(enemy.NetworkId, SpellSlot.Trinket)))
            {
                Packet.C2S.Cast.Encoded(p).Send();
            }
        }

        private static void Game_OnGameProcessPacket(GamePacketEventArgs args)
        {
            if (!Menu.Item("Enabled").GetValue<bool>())
            {
                return;
            }

            if (args.PacketData[0] == Packet.S2C.BuyItemAns.Header)
            {
                var dp = Packet.S2C.BuyItemAns.Decoded(args.PacketData);
                if (dp.NetworkId != ObjectManager.Player.NetworkId || dp.SpellSlot == SpellSlot.Trinket)
                {
                    return;
                }

                if ((Consumables.Contains(dp.Item.Id) && Menu.Item("Consumables").GetValue<bool>()))
                {
                    Refunded = true;
                    Packet.C2S.Undo.Encoded().Send();
                }
                else if (NoCD.Contains(dp.Item.Id) && Menu.Item("NoCD").GetValue<bool>())
                {
                    Refunded = true;
                    RefundItemId = dp.Item.Id;
                    RefundInventorySlot = dp.InventorySlot;
                    Packet.C2S.Undo.Encoded().Send();
                }
            }
            else if (args.PacketData[0] == Packet.MultiPacket.Header &&
                     args.PacketData[5] == Packet.MultiPacket.UndoConfirm.SubHeader && Refunded)
            {
                Refunded = false;

                if (RefundItemId == 0) // consumable item
                {
                    args.Process = false;
                    return;
                }

                if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.Trinket).Name == "nospelldata")
                {
                    SwapToTrinket();
                    return;
                }

                SellTrinket();
            }
            else if (args.PacketData[0] == Packet.S2C.SwapItemAns.Header && RefundItemId != 0 && Swapped)
            {
                var dp = Packet.S2C.SwapItemAns.Decoded(args.PacketData);
                if (dp.ToInventorySlot == 6)
                {
                    RecvItemToTrinket(RefundItemId);
                    RefundItemId = 0;
                    RefundInventorySlot = 0;
                    Swapped = false;
                }
            }
            else if (args.PacketData[0] == Packet.S2C.SellItemAns.Header)
            {
                var dp = Packet.S2C.SellItemAns.Decoded(args.PacketData);
                if (dp.SpellSlot == SpellSlot.Trinket)
                {
                    SwapToTrinket();
                }
            }
        }

        private static void SellTrinket(int networkId = -1)
        {
            var p = new GamePacket(0x9);
            p.WriteInteger(networkId == -1 ? ObjectManager.Player.NetworkId : networkId);
            p.WriteByte(6);
            p.WriteByte(0);
            p.Send();
        }

        private static void SwapToTrinket()
        {
            Swapped = true;
            BotrkInSlot = true;
            Packet.C2S.SwapItem.Encoded(new Packet.C2S.SwapItem.Struct(RefundInventorySlot, 6)).Send();
        }

        private static void RecvItemToTrinket(int id)
        {
            var trinketId = 0;
            switch (Game.MapId)
            {
                case GameMapId.SummonersRift:
                    trinketId = 3340;
                    break;
                case GameMapId.CrystalScar:
                    trinketId = 3345;
                    break;
                case GameMapId.HowlingAbyss:
                    trinketId = 2052;
                    break;
                default:
                    return;
            }

            Packet.S2C.BuyItemAns.Encoded(new Packet.S2C.BuyItemAns.Struct(trinketId, 6, 0xA9)).Process();
        }
    }
}

免费评分

参与人数 1热心值 +1 收起 理由
Kenley + 1 无限喝药已经和谐了

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

幕拂晓 发表于 2014-11-19 19:59
代码怎么使用呢?

点评

貌似是L#代码  发表于 2014-11-19 20:03
Ls雷 发表于 2014-11-22 14:50
怎么没有主函数- -也没有注释,这个东西怎么运行?
mofa005 发表于 2014-12-14 17:34
你骗我们不懂啊?这明显是C#的代码,你咋说是VC的。
amscracker 发表于 2014-11-19 19:59
没一个中文解释?
cnmmb 发表于 2014-11-19 20:07
什么级别丹丹,看不懂
bigharvest 发表于 2014-11-19 20:07
膜拜下  表示看的头晕啊
Kenley 发表于 2014-11-19 20:12
无限喝药已经和谐了
954995880 发表于 2014-11-19 20:16
表示不懂看看
linhongkai2010 发表于 2014-11-19 20:24
意思是红药和蓝药可以一直嗑不停吗?怎么用?
manbajie 发表于 2014-11-19 20:37
啊哈  这么强悍的吗?
bsbaotou 发表于 2014-11-19 20:37
听说挺不错的。。不是说和谐了么
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-15 11:12

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表