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); }
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); }
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)); } }
public ScriptSkillup(EliteAPI core) { InitializeComponent(); api = core; }
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); }
private void AddLine(EliteAPI.ChatEntry line) { var para = new Paragraph(); para = ProcessLine(line, para); if (para != null) { ChatLog.Blocks.Add(para); } }
public ScriptNaviMap(EliteAPI core) { InitializeComponent(); api = core; }
public string GetSubob(EliteAPI instance) { return(GetSubJob(instance.Player.MainJob)); }
public NpcTools(EliteAPI api) { _api = api; }
public NavigationTools(EliteAPI api) { _api = api; }
public static bool HasMPFor(this EliteAPI api, string spell) { return(api.Player.MP >= Data.SpellCosts[spell]); }
public TimerTools(EliteAPI api) { _api = api; }
public WindowerTools(EliteAPI api) { _api = api; }
public TargetTools(EliteAPI api) { _api = api; }
public PlayerTools(EliteAPI api) { _api = api; }
public PartyMemberTools(EliteAPI api, int index) { _api = api; _index = index; }
public static ushort GetItemId(this EliteAPI api, string name) { IItem item = api.Resources.GetItem(name, 0); return(item != null ? (ushort)item.ItemID : (ushort)0); }
public static void Abort(EliteAPI api) { Player.Search.isSearching = false; Player.Search.status = Structs.Search.idle; Chat.SendEcho(api, Chat.Search.abort); }
public static void CastSpell(this EliteAPI api, string spell, string target) { api.ThirdParty.SendString("/ma \"" + spell + "\" " + target); }
public PlayerTools(EliteAPI api) { this.api = api; }
public static bool HasStatus(this EliteAPI api, short effectId) { return(api.Player.Buffs.Any(buff => buff == effectId)); }
public NavigationTools(EliteAPI api) { this.api = api; }
public MenuTools(EliteAPI eliteApi) { _eliteApi = eliteApi; }
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; }
public TimerTools(EliteAPI api) { this.api = api; }
public WindowerTools(EliteAPI eliteApi) { _eliteApi = eliteApi; }
public ScriptHealing(EliteAPI core) { InitializeComponent(); api = core; }
public ItemTools(EliteAPI eliteApi) { _eliteApi = eliteApi; }
public NPCTools(EliteAPI eliteApi) { _eliteApi = eliteApi; }
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); }; }
public PlayerTools(EliteAPI eliteApi) { _eliteApi = eliteApi; }
public static bool SamePartyAs(this EliteAPI api, EliteAPI other) { int relativePartyIndex = api.GetPartyRelativeTo(other); return(relativePartyIndex == 1); }
public TargetTools(EliteAPI eliteApi) { _eliteApi = eliteApi; }
public static IEnumerable <PartyMember> GetActivePartyMembers(this EliteAPI api) { return(api.Party.GetPartyMembers().Where(pm => pm.Active > 0 && pm.CurrentHP > 0).OrderBy(pm => pm.CurrentHPP)); }
public ChatTools(EliteAPI eliteApi) { _eliteApi = eliteApi; }
public static void UseJobAbility(this EliteAPI api, string ability) { api.ThirdParty.SendString("/ja \"" + ability + "\" <me>"); }
public ScriptFarmDNC(EliteAPI core) { InitializeComponent(); api = core; }
public static bool EntityWithin(this EliteAPI api, int distance, uint targetIndex) { var entity = api.Entity.GetEntity((int)targetIndex); return(entity.Distance < distance); }
public ScriptOnEventTool(EliteAPI core) { InitializeComponent(); api = core; }
public static bool HasStatus(this EliteAPI api, StatusEffect effect) { return(api.HasStatus((short)effect)); }
public MoonPhaseForm(PolTool iPol) { InitializeComponent(); pol = iPol; api = iPol.EliteAPI; }
public BuffEngine(EliteAPI pl, EliteAPI mon) { PL = pl; Monitored = mon; }
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); } }
public NPCTools(EliteAPI api) { this.api = api; }
public PartyMemberTools(EliteAPI api, int index) { this.api = api; this.index = index; }
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"); }
public TargetTools(EliteAPI api) { this.api = api; }
public static void SetSpeed(EliteAPI api, float speed) { expected = speed; api.Player.Speed = speed; }
public WindowerTools(EliteAPI api) { this.api = api; }
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; }
public CureEngine(EliteAPI pl, EliteAPI mon) { PL = pl; Monitored = mon; }
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); }