Ejemplo n.º 1
0
        private static void LoadPlugin()
        {
            var typeName = "UBAddons.Champions." + Player.Instance.Hero + "." + Player.Instance.Hero;

            var type = Type.GetType(typeName);

            if (type == null)
            {
                return;
            }

            PluginInstance = (IHeroBase)Activator.CreateInstance(type);
            Libs.Dictionary.FleeSpell.Initialize();
            Core.DelayAction(() =>
            {
                if (Initialize(PluginInstance))
                {
                    UtilityPlugin.OnLoad();
                    if (UBCore.CoreMenu.UseOnTick)
                    {
                        Game.OnTick += UtilityPlugin.OnUpdate;
                    }
                    if (UBCore.CoreMenu.UseOnUpdate)
                    {
                        Game.OnUpdate += UtilityPlugin.OnUpdate;
                    }
                }
            }, 200);
        }
Ejemplo n.º 2
0
        public Type GetGraphType(int i)
        {
            if (this.typeNames[i] == null)
            {
                return(null);
            }
            Type type = UtilityPlugin.GetType(this.typeNames[i]);

            if (!object.Equals(type, null))
            {
                return(type);
            }
            throw new Exception("No graph of type '" + this.typeNames[i] + "' could be created, type does not exist");
        }
Ejemplo n.º 3
0
        public Object DeserializeUnityObject()
        {
            int num = this.reader.ReadInt32();

            if (num == 2147483647)
            {
                return(null);
            }
            string text  = this.reader.ReadString();
            string text2 = this.reader.ReadString();
            string text3 = this.reader.ReadString();
            Type   type  = UtilityPlugin.GetType(text2);

            if (type == null)
            {
                Debug.LogError("Could not find type '" + text2 + "'. Cannot deserialize Unity reference");
                return(null);
            }
            if (!string.IsNullOrEmpty(text3))
            {
                UnityReferenceHelper[] array = Object.FindObjectsOfType(typeof(UnityReferenceHelper)) as UnityReferenceHelper[];
                int i = 0;
                while (i < array.Length)
                {
                    if (array[i].GetGUID() == text3)
                    {
                        if (type == typeof(GameObject))
                        {
                            return(array[i].gameObject);
                        }
                        return(array[i].GetComponent(type));
                    }
                    else
                    {
                        i++;
                    }
                }
            }
            Object[] array2 = Resources.LoadAll(text, type);
            for (int j = 0; j < array2.Length; j++)
            {
                if (array2[j].name == text || array2.Length == 1)
                {
                    return(array2[j]);
                }
            }
            return(null);
        }
Ejemplo n.º 4
0
 protected void RegisterTriggers(List <int> in_triggerList, AkTriggerBase.Trigger in_delegate)
 {
     foreach (uint num in in_triggerList)
     {
         string str = string.Empty;
         if (((triggerTypes.TryGetValue(num, out str) && (str != "Awake")) && (str != "Start")) && (str != "Destroy"))
         {
             AkTriggerBase component = (AkTriggerBase)base.GetComponent(UtilityPlugin.GetType(str));
             if (component == null)
             {
                 component = (AkTriggerBase)base.gameObject.AddComponent(UtilityPlugin.GetType(str));
             }
             component.triggerDelegate = (AkTriggerBase.Trigger)Delegate.Combine(component.triggerDelegate, in_delegate);
         }
     }
 }
Ejemplo n.º 5
0
 public static System.Type GetType2(string typeName)
 {
     System.Type type = UtilityPlugin.GetType(typeName);
     if (type != null)
     {
         return(type);
     }
     foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
     {
         type = assembly.GetType(typeName);
         if (type != null)
         {
             Debug.Log("GetType2 find " + typeName + "FullName= " + assembly.FullName);
             return(type);
         }
     }
     return(null);
 }
Ejemplo n.º 6
0
        public static Type GetType2(string typeName)
        {
            Type type = UtilityPlugin.GetType(typeName);

            if (type != null)
            {
                return(type);
            }
            Assembly[] assemblies = AppDomain.get_CurrentDomain().GetAssemblies();
            for (int i = 0; i < assemblies.Length; i++)
            {
                Assembly assembly = assemblies[i];
                type = assembly.GetType(typeName);
                if (type != null)
                {
                    Debug.Log("GetType2 find " + typeName + "FullName= " + assembly.get_FullName());
                    return(type);
                }
            }
            return(null);
        }
Ejemplo n.º 7
0
 protected void RegisterTriggers(List <int> in_triggerList, AkTriggerBase.Trigger in_delegate)
 {
     using (List <int> .Enumerator enumerator = in_triggerList.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             uint   current = (uint)enumerator.get_Current();
             string empty   = string.Empty;
             if (AkUnityEventHandler.triggerTypes.TryGetValue(current, ref empty) && !(empty == "Awake") && !(empty == "Start") && !(empty == "Destroy"))
             {
                 AkTriggerBase akTriggerBase = (AkTriggerBase)base.GetComponent(UtilityPlugin.GetType(empty));
                 if (akTriggerBase == null)
                 {
                     akTriggerBase = (AkTriggerBase)base.gameObject.AddComponent(UtilityPlugin.GetType(empty));
                 }
                 AkTriggerBase akTriggerBase2 = akTriggerBase;
                 akTriggerBase2.triggerDelegate = (AkTriggerBase.Trigger)Delegate.Combine(akTriggerBase2.triggerDelegate, in_delegate);
             }
         }
     }
 }
Ejemplo n.º 8
0
 static Viktor()
 {
     Q = new Spell.Targeted(SpellSlot.Q, 650, DamageType.Magical);
     W = new Spell.Skillshot(SpellSlot.W, 700, SkillShotType.Circular, 250, int.MaxValue, 300)
     {
         AllowedCollisionCount = int.MaxValue,
     };
     E = new Spell.Skillshot(SpellSlot.E, 1225, SkillShotType.Linear, 50, 1050, 100)
     {
         AllowedCollisionCount = int.MaxValue,
     };
     E1 = new Spell.SimpleSkillshot(SpellSlot.E, 525, DamageType.Magical)
     {
         CastDelay = 50,
     };
     R = new Spell.Skillshot(SpellSlot.R, 700, SkillShotType.Circular, 250, int.MaxValue, 450)
     {
         AllowedCollisionCount = int.MaxValue,
     };
     UtilityPlugin.AddPlugin(EUtility.ImmobileTracker);
     DamageIndicator.DamageDelegate = HandleDamageIndicator;
 }
Ejemplo n.º 9
0
 public UnityEngine.Object DeserializeUnityObject()
 {
     if (this.reader.ReadInt32() != 0x7fffffff)
     {
         string      path     = this.reader.ReadString();
         string      typeName = this.reader.ReadString();
         string      str3     = this.reader.ReadString();
         System.Type type     = UtilityPlugin.GetType(typeName);
         if (type == null)
         {
             Debug.LogError("Could not find type '" + typeName + "'. Cannot deserialize Unity reference");
             return(null);
         }
         if (!string.IsNullOrEmpty(str3))
         {
             UnityReferenceHelper[] helperArray = UnityEngine.Object.FindObjectsOfType(typeof(UnityReferenceHelper)) as UnityReferenceHelper[];
             for (int j = 0; j < helperArray.Length; j++)
             {
                 if (helperArray[j].GetGUID() == str3)
                 {
                     if (type == typeof(GameObject))
                     {
                         return(helperArray[j].gameObject);
                     }
                     return(helperArray[j].GetComponent(type));
                 }
             }
         }
         UnityEngine.Object[] objArray = Resources.LoadAll(path, type);
         for (int i = 0; i < objArray.Length; i++)
         {
             if ((objArray[i].name == path) || (objArray.Length == 1))
             {
                 return(objArray[i]);
             }
         }
     }
     return(null);
 }
Ejemplo n.º 10
0
        static CoreMenu()
        {
            try
            {
                Core = MainMenu.AddMenu("UBAddons", "UBAddons.Core", "Core of UBAddons");
                Core.AddGroupLabel("UBAddons - version " + typeof(CoreMenu).Assembly.GetName().Version.ToString());
                Core.AddLabel("Made by Uzumaki Boruto. ~Dattebasa~");
                Core.AddGroupLabel("Inject Option");
                Core.Add("Core.Activator", new CheckBox("Inject Activator"));
                Core.Add("Core.BaseUlt", new CheckBox("Inject BaseUlt"));
                Core.Add("Core.AutoLv", new CheckBox("Inject Auto level up"));
                //Core.Add("Core.Surrender", new CheckBox("Inject Surrender Tracker", false)); this is no need
                if (Variables.IsADC)
                {
                    Core.Add("Core.Orbwalker", new CheckBox("Inject Extension for OrbWalker"));
                }
                Core.AddGroupLabel("FPS Protector");
                Core.Add("Core.Enable.FPS", new CheckBox("Enable FPS Protection"));
                Core.Add("Core.Min.FPS", new Slider("Min Fps", 45, 1, 300));
                Core.Add("Core.Calculate", new Slider("Calculations per second", 35, 1, 350));
                Core.AddGroupLabel("Global Settings");
                Core.AddLabel("Must F5 to take effect");
                var OnTickButton   = Core.Add("Core.OnTick", new CheckBox("Use Game.OnTick (More fps)"));
                var OnUpdateButton = Core.Add("Core.OnUpdate", new CheckBox("Use Game.OnUpdate (Faster rection)", false));
                OnUpdateButton.OnValueChange += delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                {
                    if (args.NewValue)
                    {
                        OnTickButton.CurrentValue = false;
                        return;
                    }
                    if (!OnTickButton.CurrentValue)
                    {
                        OnUpdateButton.CurrentValue = true;
                    }
                };
                OnTickButton.OnValueChange += delegate(ValueBase <bool> sender, ValueBase <bool> .ValueChangeArgs args)
                {
                    if (args.NewValue)
                    {
                        OnUpdateButton.CurrentValue = false;
                        return;
                    }
                    if (!OnUpdateButton.CurrentValue)
                    {
                        OnTickButton.CurrentValue = true;
                    }
                };

                if (UBAddons.PluginInstance != null)
                {
                    GapCloser = Core.AddSubMenu("GapCloser", "UBAddons.Core.GapCloser", "General GapCloser");
                    GapCloser.Add("UBAddons.Core.GapCloser.Melee", new CheckBox("Anti Melee Champ GapCloser"));
                    GapCloser.Add("UBAddons.Core.GapCloser.Flash", new CheckBox("Anti Flash GapCloser"));
                    GapCloser.Add("UBAddons.Core.GapCloser.Dash", new CheckBox("Anti Dash GapCloser"));

                    if (IplayEkko)
                    {
                        SpotJump = Core.AddSubMenu("Dash", "UBAddons.Core." + Player.Instance.Hero, "You're using " + Player.Instance.Hero);
                        {
                            SpotJump.Add("UBAddons.Core." + Player.Instance.Hero + ".Spot", new CheckBox("Load Dash Spot"));
                            SpotJump.Add("UBAddons.Core." + Player.Instance.Hero + ".Range", new Slider("Range of Click", 75, 15, 150));
                            SpotJump.Add("UBAddons.Core." + Player.Instance.Hero + ".Spot.Draw", new CheckBox("Draw Dash Spot"));
                            SpotJump.Add("UBAddons.Core." + Player.Instance.Hero + ".Spot.Color", new ColorPicker("Spot Color", ColorReader.Load("UBAddons.Core." + Player.Instance.Hero + ".Spot.Color", System.Drawing.Color.Green)));
                            if (Game.MapId.Equals(GameMapId.SummonersRift) && SpotJump.VChecked("UBAddons.Core." + Player.Instance.Hero + ".Spot"))
                            {
                                UtilityPlugin.AddPlugin(EUtility.JumpSpot);
                            }
                        }
                    }
                    if (IplayVelkoz)
                    {
                        RDirect = Core.AddSubMenu("Direct", "UBAddons.Core.Velkoz", "You're using Velkoz");
                        {
                            RDirect.Add("UBAddons.Core.Velkoz.Change.Direct", new CheckBox("Auto Follow R"));
                            RDirect.Add("UBAddons.Core.Velkoz.Change.Direct.Only.Combo", new CheckBox("Combo Only"));
                        }
                        Interrupter.OnInterruptableSpell += delegate(Obj_AI_Base sender, Interrupter.InterruptableSpellEventArgs e)
                        {
                            if (sender.IsMe)
                            {
                                if (Player.Instance.Spellbook.IsChanneling)
                                {
                                    var target = Champions.Velkoz.Velkoz.R.GetTarget();
                                    if (target != null)
                                    {
                                        var screenPos = target.Position.WorldToScreen();
                                        System.Windows.Forms.Cursor.Position = new System.Drawing.Point((int)screenPos.X, (int)screenPos.Y);
                                    }
                                }
                            }
                        };
                    }
                    Obj_AI_Base.OnBasicAttack      += AIHeroClient_OnBasicAttack;
                    Obj_AI_Base.OnProcessSpellCast += AIHeroClient_OnProcessSpellCast;
                    Dash.OnDash += Dash_OnDash;
                }
                if (Core.VChecked("Core.Activator"))
                {
                    UtilityPlugin.AddPlugin(EUtility.Activator);
                }
                if (Core.VChecked("Core.BaseUlt"))
                {
                    UtilityPlugin.AddPlugin(EUtility.BaseUlt);
                }
                if (Core.VChecked("Core.AutoLv"))
                {
                    UtilityPlugin.AddPlugin(EUtility.AutoLv);
                }
                if (Variables.IsADC && Core.VChecked("Core.Orbwalker"))
                {
                    UtilityPlugin.AddPlugin(EUtility.ADOrbwalker);
                }
            }
            catch (Exception e)
            {
                Log.Debug.Print(e.ToString(), General.Console_Message.Error);
            }
        }