Ejemplo n.º 1
0
        public MainWindow(EliteAPI core)
        {
            InitializeComponent();
            api = core;

            #region Final Fantasy XI [POL]
            var data = Process.GetProcessesByName("pol");

            if (data.Count() != 0)
            {
                var proc = Process.GetProcessesByName("pol").First().Id;
                api = new EliteAPI(proc);

                foreach (var dats in data)
                {
                    EliteMMO_PROC?.Items.Add(dats.MainWindowTitle);
                }

                if (EliteMMO_PROC != null)
                    EliteMMO_PROC.SelectedIndex = 0;

                xStatusLabel.Text = @":: " + api.Entity.GetLocalPlayer().Name + @" ::";
            }
            else
            {
                xStatusLabel.Text = @":: Final Fantasy Not Found ::";
            }
            #endregion

            x1 = new ScriptFarmDNC(api);
            x2 = new ScriptHealing(api);
            x3 = new ScriptNaviMap(api);
            x4 = new ScriptOnEventTool(api);
        }
Ejemplo n.º 2
0
 public FFACE(int id)
 {
     var eliteApi = new EliteAPI(id);
     Chat = new ChatTools(eliteApi);
     Item = new ItemTools(eliteApi);
     Menu = new MenuTools(eliteApi);
     NPC = new NPCTools(eliteApi);
     Player = new PlayerTools(eliteApi);
     Target = new TargetTools(eliteApi);
     Windower = new WindowerTools(eliteApi);
 }
Ejemplo n.º 3
0
        public EliteMMOWrapper(int pid)
        {
            EliteAPI = new EliteAPI(pid);
            Navigator = new NavigationTools(EliteAPI);
            NPC = new NPCTools(EliteAPI);
            PartyMember = new Dictionary<byte, IPartyMemberTools>();
            Player = new PlayerTools(EliteAPI);
            Target = new TargetTools(EliteAPI);
            Timer = new TimerTools(EliteAPI);
            Windower = new WindowerTools(EliteAPI);

            for (byte i = 0; i < 16; i++)
            {
                PartyMember.Add(i, new PartyMemberTools(EliteAPI, i));
            }
        }
Ejemplo n.º 4
0
 public ScriptSkillup(EliteAPI core)
 {
     InitializeComponent();
     api = core;
 }
Ejemplo n.º 5
0
        public static int CurrentSCHCharges(this EliteAPI api)
        {
            if (api != null)
            {
                int MainJob = api.Player.MainJob;
                int SubJob  = api.Player.SubJob;

                if (MainJob == (int)Job.SCH || SubJob == (int)Job.SCH)
                {
                    if (api.HasStatus(StatusEffect.Light_Arts) || api.HasStatus(StatusEffect.Addendum_White))
                    {
                        // Stragem charge recast = ability ID 231?
                        int currentRecastTimer = api.Recast.GetAbilityRecast(231);

                        int SpentPoints = api.Player.GetJobPoints((int)Job.SCH).SpentJobPoints;

                        int MainLevel = api.Player.MainJobLevel;
                        int SubLevel  = api.Player.SubJobLevel;

                        int baseTimer   = 240;
                        int baseCharges = 1;

                        // Generate the correct timer between charges depending on level / Job Points
                        if (MainJob == (int)Job.SCH)
                        {
                            if (SpentPoints >= 550)
                            {
                                baseTimer   = 33;
                                baseCharges = 5;
                            }
                            else if (MainLevel >= 90)
                            {
                                baseTimer   = 48;
                                baseCharges = 5;
                            }
                            else if (MainLevel >= 70 && MainLevel < 90)
                            {
                                baseTimer   = 60;
                                baseCharges = 4;
                            }
                            else if (MainLevel >= 50 && MainLevel < 70)
                            {
                                baseTimer   = 80;
                                baseCharges = 3;
                            }
                            else if (MainLevel >= 30 && MainLevel < 50)
                            {
                                baseTimer   = 120;
                                baseCharges = 2;
                            }
                            else if (MainLevel >= 10 && MainLevel < 30)
                            {
                                baseTimer   = 240;
                                baseCharges = 1;
                            }
                        }
                        else if (SubJob == (int)Job.SCH)
                        {
                            if (SubLevel >= 30 && SubLevel < 50)
                            {
                                baseTimer   = 120;
                                baseCharges = 2;
                            }
                        }

                        // Now knowing what the time between charges is lets calculate how many
                        // charges are available

                        if (currentRecastTimer == 0)
                        {
                            return(baseCharges);
                        }
                        else
                        {
                            int t = currentRecastTimer / 60;

                            int stratsUsed = t / baseTimer;

                            int currentCharges = (int)Math.Ceiling((decimal)baseCharges - stratsUsed);

                            return((baseTimer == 120) ? currentCharges-- : currentCharges);
                        }
                    }
                }
            }

            return(-1);
        }
Ejemplo n.º 6
0
        private void AddLine(EliteAPI.ChatEntry line)
        {
            var para = new Paragraph();

            para = ProcessLine(line, para);
            if (para != null)
            {
                ChatLog.Blocks.Add(para);
            }
        }
Ejemplo n.º 7
0
 public ScriptNaviMap(EliteAPI core)
 {
     InitializeComponent();
     api = core;
 }
Ejemplo n.º 8
0
 public string GetSubob(EliteAPI instance)
 {
     return(GetSubJob(instance.Player.MainJob));
 }
Ejemplo n.º 9
0
 public NpcTools(EliteAPI api)
 {
     _api = api;
 }
Ejemplo n.º 10
0
 public NavigationTools(EliteAPI api)
 {
     _api = api;
 }
Ejemplo n.º 11
0
 public static bool HasMPFor(this EliteAPI api, string spell)
 {
     return(api.Player.MP >= Data.SpellCosts[spell]);
 }
Ejemplo n.º 12
0
 public TimerTools(EliteAPI api)
 {
     _api = api;
 }
Ejemplo n.º 13
0
 public WindowerTools(EliteAPI api)
 {
     _api = api;
 }
Ejemplo n.º 14
0
 public TargetTools(EliteAPI api)
 {
     _api = api;
 }
Ejemplo n.º 15
0
 public PlayerTools(EliteAPI api)
 {
     _api = api;
 }
Ejemplo n.º 16
0
 public PartyMemberTools(EliteAPI api, int index)
 {
     _api   = api;
     _index = index;
 }
Ejemplo n.º 17
0
        public static ushort GetItemId(this EliteAPI api, string name)
        {
            IItem item = api.Resources.GetItem(name, 0);

            return(item != null ? (ushort)item.ItemID : (ushort)0);
        }
Ejemplo n.º 18
0
 public static void Abort(EliteAPI api)
 {
     Player.Search.isSearching = false;
     Player.Search.status      = Structs.Search.idle;
     Chat.SendEcho(api, Chat.Search.abort);
 }
Ejemplo n.º 19
0
 public static void CastSpell(this EliteAPI api, string spell, string target)
 {
     api.ThirdParty.SendString("/ma \"" + spell + "\" " + target);
 }
Ejemplo n.º 20
0
 public PlayerTools(EliteAPI api)
 {
     this.api = api;
 }
Ejemplo n.º 21
0
 public static bool HasStatus(this EliteAPI api, short effectId)
 {
     return(api.Player.Buffs.Any(buff => buff == effectId));
 }
Ejemplo n.º 22
0
 public NavigationTools(EliteAPI api)
 {
     this.api = api;
 }
Ejemplo n.º 23
0
 public MenuTools(EliteAPI eliteApi)
 {
     _eliteApi = eliteApi;
 }
Ejemplo n.º 24
0
        public Paragraph ProcessLine(EliteAPI.ChatEntry chatline, Paragraph para)
        {
            if (para == null)
            {
                throw new ArgumentNullException("para");
            }

            if (!_filters.Contains((ChatMode)chatline.ChatType) && _filters.Count != 0)
            {
                return null;
            }

            para = new Paragraph();
            var range = new TextRange(para.ContentStart, para.ContentEnd);
            range.Text += "("+((int)chatline.ChatType).ToString("X2") + ")";
            //range.Text += chatline.Now;
            range.Text += chatline.Timestamp; // unsure if this is correct for what its purpose is..

            range.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.SteelBlue);
            range.ApplyPropertyValue(TextElement.FontWeightProperty, System.Windows.FontWeights.Bold);
            var endOfPrefix = range.End;

            para.Inlines.Add(chatline.Text);
            range = new TextRange(endOfPrefix, para.ContentEnd);
            range.ApplyPropertyValue(TextElement.ForegroundProperty, ChatColorConverter(chatline.ChatColor));
            range.ApplyPropertyValue(TextElement.FontWeightProperty, System.Windows.FontWeights.Bold);
            para.LineHeight = 0.5;
            return para;
        }
Ejemplo n.º 25
0
 public TimerTools(EliteAPI api)
 {
     this.api = api;
 }
Ejemplo n.º 26
0
 public WindowerTools(EliteAPI eliteApi)
 {
     _eliteApi = eliteApi;
 }
Ejemplo n.º 27
0
 public ScriptHealing(EliteAPI core)
 {
     InitializeComponent();
     api = core;
 }
Ejemplo n.º 28
0
 public ItemTools(EliteAPI eliteApi)
 {
     _eliteApi = eliteApi;
 }
Ejemplo n.º 29
0
 public ScriptNaviMap(EliteAPI core)
 {
     InitializeComponent();
     api = core;
 }
Ejemplo n.º 30
0
 public NPCTools(EliteAPI eliteApi)
 {
     _eliteApi = eliteApi;
 }
Ejemplo n.º 31
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();
            equipmentDef.canDrop          = false;
            equipmentDef.enigmaCompatible = false;
            equipmentDef.cooldown         = 60;

            var buffDef = new RoR2.BuffDef
            {
                name      = EliteBuffName,
                buffColor = new Color32(255, 255, 255, byte.MaxValue),
                iconPath  = EliteBuffIconPath,
                canStack  = false,
            };

            buffDef.eliteIndex = EliteIndex;
            var buffIndex = new CustomBuff(buffDef);

            EliteBuffIndex           = BuffAPI.Add(buffIndex);
            equipmentDef.passiveBuff = EliteBuffIndex;

            var eliteDef = new RoR2.EliteDef
            {
                name          = ElitePrefixName,
                modifierToken = EliteModifierString,
                color         = buffDef.buffColor,
            };

            eliteDef.eliteEquipmentIndex = equipmentDef.equipmentIndex;
            var eliteIndex = new CustomElite(eliteDef, EliteTier);

            EliteIndex = EliteAPI.Add(eliteIndex);

            var card = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 30.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 4.5f,
                eliteOnlyScaling = 0.5f,
                eliteType        = EliteIndex
            };

            EsoLib.Cards.Add(card);
            EliteCard = card;

            LanguageAPI.Add(eliteDef.modifierToken, ElitePrefixName + " {0}");

            //If we want to load a base game material, then we use this.

            /*GameObject worm = Resources.Load<GameObject>("Prefabs/characterbodies/ElectricWormBody");
             * Debug.Log($"WORM: {worm}");
             * var modelLocator = worm.GetComponent<ModelLocator>();
             * Debug.Log($"MODEL LOCATOR: {modelLocator}");
             * var model = modelLocator.modelTransform.GetComponent<CharacterModel>();
             * Debug.Log($"MODEL: {model}");
             * if (model)
             * {
             *  var rendererInfos = model.baseRendererInfos;
             *  foreach (CharacterModel.RendererInfo renderer in rendererInfos)
             *  {
             *      if (renderer.defaultMaterial.name == "matElectricWorm")
             *      {
             *          HyperchargedMaterial = renderer.defaultMaterial;
             *      }
             *  }
             * }*/

            //If we want to load our own, uncomment the one below.
            EliteMaterial = Resources.Load <Material>("@Aetherium:Assets/Textures/Materials/TheirReminder.mat");

            HyperchargedProjectile = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/Projectiles/LightningStake"), "HyperchargedProjectile", true);

            var controller = HyperchargedProjectile.GetComponent <ProjectileController>();

            controller.startSound = "Play_titanboss_shift_shoot";

            var impactExplosion = HyperchargedProjectile.GetComponent <RoR2.Projectile.ProjectileImpactExplosion>();

            impactExplosion.lifetime        = 0.5f;
            impactExplosion.impactEffect    = Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/LightningStrikeImpact");
            impactExplosion.blastRadius     = 7f;
            impactExplosion.bonusBlastForce = new Vector3(0, 750, 0);

            // register it for networking
            if (HyperchargedProjectile)
            {
                PrefabAPI.RegisterNetworkPrefab(HyperchargedProjectile);
            }

            // add it to the projectile catalog or it won't work in multiplayer
            RoR2.ProjectileCatalog.getAdditionalEntries += list =>
            {
                list.Add(HyperchargedProjectile);
            };
        }
Ejemplo n.º 32
0
 public PlayerTools(EliteAPI eliteApi)
 {
     _eliteApi = eliteApi;
 }
Ejemplo n.º 33
0
        public static bool SamePartyAs(this EliteAPI api, EliteAPI other)
        {
            int relativePartyIndex = api.GetPartyRelativeTo(other);

            return(relativePartyIndex == 1);
        }
Ejemplo n.º 34
0
 public TargetTools(EliteAPI eliteApi)
 {
     _eliteApi = eliteApi;
 }
Ejemplo n.º 35
0
 public static IEnumerable <PartyMember> GetActivePartyMembers(this EliteAPI api)
 {
     return(api.Party.GetPartyMembers().Where(pm => pm.Active > 0 && pm.CurrentHP > 0).OrderBy(pm => pm.CurrentHPP));
 }
Ejemplo n.º 36
0
 public ChatTools(EliteAPI eliteApi)
 {
     _eliteApi = eliteApi;
 }
Ejemplo n.º 37
0
 public static void UseJobAbility(this EliteAPI api, string ability)
 {
     api.ThirdParty.SendString("/ja \"" + ability + "\" <me>");
 }
Ejemplo n.º 38
0
 public ScriptFarmDNC(EliteAPI core)
 {
     InitializeComponent();
     api = core;
 }
Ejemplo n.º 39
0
        public static bool EntityWithin(this EliteAPI api, int distance, uint targetIndex)
        {
            var entity = api.Entity.GetEntity((int)targetIndex);

            return(entity.Distance < distance);
        }
Ejemplo n.º 40
0
 public ScriptOnEventTool(EliteAPI core)
 {
     InitializeComponent();
     api = core;
 }
Ejemplo n.º 41
0
 public static bool HasStatus(this EliteAPI api, StatusEffect effect)
 {
     return(api.HasStatus((short)effect));
 }
Ejemplo n.º 42
0
 public MoonPhaseForm(PolTool iPol)
 {
     InitializeComponent();
     pol = iPol;
     api = iPol.EliteAPI;
 }
Ejemplo n.º 43
0
 public BuffEngine(EliteAPI pl, EliteAPI mon)
 {
     PL        = pl;
     Monitored = mon;
 }
Ejemplo n.º 44
0
        private static IEnumerable <(bool HasSpell, string Name, string Type)> GetTrusts(EliteAPI instance)
        {
            // Iterate from 0 to 10,000 because I dunno how to get every spell that exists. It seems to be fast this way anyways
            for (uint n = 0; n < 10000; n++)
            {
                // Try and build the spell
                var spell = instance.Resources.GetSpell(n);

                // Is it a Trust?
                if (spell?.MagicType != (int)MagicType.Trust)
                {
                    continue;
                }

                // Load up info on the spell
                var name = spell.Name.FirstOrDefault()?.Trim();

                // Filter away placeholders
                if (string.IsNullOrEmpty(name))
                {
                    continue;
                }

                // Ignore Unity Trusts too
                if (name.Contains("(UC)"))
                {
                    continue;
                }

                var hasTrust = instance.Player.HasSpell(spell.Index);
                var icon     = spell.ListIcon2;

                var type =
                    icon <= 1009
                        ? "Tank"
                        : icon <= 1018
                            ? "Melee Fighter"
                            : icon <= 1027
                                ? "Ranged Fighter"
                                : icon <= 1036
                                    ? "Offensive Caster"
                                    : icon <= 1045
                                        ? "Healer"
                                        : icon <= 1054
                                            ? "Support"
                                            : "Other";


                // Ok yeah it is a real trust
                yield return(hasTrust, name, type);
            }
        }
Ejemplo n.º 45
0
 public NPCTools(EliteAPI api)
 {
     this.api = api;
 }
Ejemplo n.º 46
0
 public ScriptOnEventTool(EliteAPI core)
 {
     InitializeComponent();
     api = core;
 }
Ejemplo n.º 47
0
 public PartyMemberTools(EliteAPI api, int index)
 {
     this.api = api;
     this.index = index;
 }
Ejemplo n.º 48
0
        public override void SetupAttributes()
        {
            base.SetupAttributes();
            equipmentDef.canDrop          = false;
            equipmentDef.enigmaCompatible = false;
            equipmentDef.cooldown         = 40;

            var buffDef = new RoR2.BuffDef
            {
                name      = EliteBuffName,
                buffColor = new Color32(255, 255, 255, byte.MaxValue),
                iconPath  = EliteBuffIconPath,
                canStack  = false,
            };

            buffDef.eliteIndex = EliteIndex;
            var buffIndex = new CustomBuff(buffDef);

            EliteBuffIndex           = BuffAPI.Add(buffIndex);
            equipmentDef.passiveBuff = EliteBuffIndex;

            var eliteDef = new RoR2.EliteDef
            {
                name          = ElitePrefixName,
                modifierToken = EliteModifierString,
                color         = buffDef.buffColor,
            };

            eliteDef.eliteEquipmentIndex = equipmentDef.equipmentIndex;
            var eliteIndex = new CustomElite(eliteDef, EliteTier);

            EliteIndex = EliteAPI.Add(eliteIndex);

            var card = new EliteAffixCard
            {
                spawnWeight      = 0.5f,
                costMultiplier   = 30.0f,
                damageBoostCoeff = 2.0f,
                healthBoostCoeff = 4.5f,
                eliteOnlyScaling = 0.5f,
                eliteType        = EliteIndex
            };

            EsoLib.Cards.Add(card);
            EliteCard = card;

            LanguageAPI.Add(eliteDef.modifierToken, ElitePrefixName + " {0}");

            RadiantProjectile = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/Projectiles/Thermite"), "RadiantProjectile", true);

            var damage = RadiantProjectile.GetComponent <RoR2.Projectile.ProjectileDamage>();

            damage.damageType = DamageType.IgniteOnHit;

            var simpleProjectile = RadiantProjectile.GetComponent <ProjectileSimple>();

            simpleProjectile.velocity           = 100;
            simpleProjectile.oscillateMagnitude = 0;

            if (RadiantProjectile)
            {
                PrefabAPI.RegisterNetworkPrefab(RadiantProjectile);
            }

            RoR2.ProjectileCatalog.getAdditionalEntries += list =>
            {
                list.Add(RadiantProjectile);
            };

            //If we want to load a base game material, then we use this.

            /*GameObject worm = Resources.Load<GameObject>("Prefabs/characterbodies/ElectricWormBody");
             * Debug.Log($"WORM: {worm}");
             * var modelLocator = worm.GetComponent<ModelLocator>();
             * Debug.Log($"MODEL LOCATOR: {modelLocator}");
             * var model = modelLocator.modelTransform.GetComponent<CharacterModel>();
             * Debug.Log($"MODEL: {model}");
             * if (model)
             * {
             *  var rendererInfos = model.baseRendererInfos;
             *  foreach (CharacterModel.RendererInfo renderer in rendererInfos)
             *  {
             *      if (renderer.defaultMaterial.name == "matElectricWorm")
             *      {
             *          HyperchargedMaterial = renderer.defaultMaterial;
             *      }
             *  }
             * }*/

            //If we want to load our own, uncomment the one below.
            EliteMaterial = Resources.Load <Material>("@Aetherium:Assets/Textures/Materials/ApollosBrillianceMain.mat");
            //Shader hotpoo = Resources.Load<Shader>("Shaders/Deferred/hgstandard");
        }
Ejemplo n.º 49
0
 public TargetTools(EliteAPI api)
 {
     this.api = api;
 }
Ejemplo n.º 50
0
 public static void SetSpeed(EliteAPI api, float speed)
 {
     expected         = speed;
     api.Player.Speed = speed;
 }
Ejemplo n.º 51
0
 public WindowerTools(EliteAPI api)
 {
     this.api = api;
 }
Ejemplo n.º 52
0
 public void SetStatus(EliteAPI api, uint status)
 {
     api.Player.Status = status;
 }
 public bool RunAssist(EliteAPI.XiEntity assisted)
 {
     if (Math.Truncate(assisted.Distance) <= (float)assistDist.Value)
     {
         SetTarget((int)assisted.TargetID);
         Thread.Sleep(TimeSpan.FromSeconds(0.4));
         WindowInfo.SendText("/assist <t>");
         Thread.Sleep(TimeSpan.FromSeconds(2));
         while (PlayerInfo.Status == 0)
         {
             if (assisted.Status == 0 || PlayerInfo.Status != 0)
                 break;
             api.ThirdParty.SendString("/attack <t>");
             Thread.Sleep(TimeSpan.FromSeconds(1.0));
         }
         //TargetInfo.Attack();
         Thread.Sleep(TimeSpan.FromSeconds(1.0));
         return true;
     }
     return false;
 }
Ejemplo n.º 54
0
 public CureEngine(EliteAPI pl, EliteAPI mon)
 {
     PL        = pl;
     Monitored = mon;
 }
Ejemplo n.º 55
0
 public ScriptFarmDNC(EliteAPI core)
 {
     InitializeComponent();
     api = core;
 }
Ejemplo n.º 56
0
        public MainWindow(EliteAPI core)
        {
            InitializeComponent();
            api = core;
            #region Final Fantasy XI [POL]
            var data = Process.GetProcessesByName("pol");

            if (data.Count() != 0)
            {
                var proc = Process.GetProcessesByName("pol").First().Id;
                api = new EliteAPI(proc);

                foreach (var dats in data)
                {
                    EliteMMO_PROC?.Items.Add(dats.MainWindowTitle);
                }

                if (EliteMMO_PROC != null)
                    EliteMMO_PROC.SelectedIndex = 0;

                xStatusLabel.Text = @":: " + api.Entity.GetLocalPlayer().Name + @" ::";
            }
            else
            {
                xStatusLabel.Text = @":: Final Fantasy Not Found ::";
            }
            #endregion

            farmbot = new ScriptFarmDNC(api);
            x1 = farmbot;
            x2 = new ScriptHealing(api);
            navbot = new ScriptNaviMap(api);
            x3 = navbot;
            oneventbot = new ScriptOnEventTool(api);
            x4 = oneventbot;
            skillupbot = new ScriptSkillup(api);
            x5 = skillupbot;

            string apidll = "";
            string mmodll = "";
            if (File.Exists(Application.StartupPath + @"\EliteAPI.dll"))
                apidll = (FileVersionInfo.GetVersionInfo(Application.StartupPath + @"\EliteAPI.dll").FileVersion ?? "");
            if (File.Exists(Application.StartupPath + @"\EliteMMO.API.dll"))
                mmodll = (FileVersionInfo.GetVersionInfo(Application.StartupPath + @"\EliteMMO.API.dll").FileVersion ?? "");
            string memmo = "";
            if (apidll == "" || GetStringFromUrl("http://ext.elitemmonetwork.com/downloads/eliteapi/index.php?v") != apidll)
            {
                memmo = "\nEliteAPI.dll";
            }
            if (mmodll == "" || GetStringFromUrl("http://ext.elitemmonetwork.com/downloads/elitemmo_api/index.php?v") != mmodll)
            {
                memmo = "\nEliteMMO.API.dll";
            }
            if (memmo != "")
                MessageBox.Show("You Need To Update" + memmo + "\nThen Restart Scripted", "!UPDATE NEEDED!");
            var symbolicLink = "";
            if (windowername == "Ashita")
                symbolicLink = dlllocation + @"\Scripts\Addons\ScriptedExtender";
            else if (windowername == "Windower")
                symbolicLink = dlllocation + @"\addons\ScriptedExtender";
            if (symbolicLink != "" && !System.IO.Directory.Exists(symbolicLink))
                CreateSymbolicLink(symbolicLink, Application.StartupPath + @"\ScriptedExtender", SymbolicLink.Directory);
        }