public void AddSpellToInterrupt(int spellID, params string[] tags) { if (this.Spells.ContainsKey(spellID)) { dlog("Spell with ID = " + spellID + " already exists, skipping."); return; } InterrupterSpell spell = new InterrupterSpell(spellID, true, this.Tags, tags); this.Spells.Add(spell.ID, spell); dlog("Succesfully added: " + this.Spells[spell.ID].Name + " (" + this.Spells.Last().Key + ") ShouldInterrupt = " + this.Spells[spell.ID].Include + ", tag groups used: " + this.Spells[spell.ID].TagGroupIDs.ToRealString()); }
public static void OnProcessSpellCast(Obj_AI_Base sender, Obj_AI_BaseMissileClientDataEventArgs args) { if (!MenuConfig.Miscellaneous["Interrupt"].Enabled || sender == null) { return; } if (SpellConfig.E.Ready && (TargetedSpells.Contains(args.SpellData.Name) || DamageSpells.Contains(args.SpellData.Name)) && args.Target.IsMe) { SpellConfig.E.Cast(Game.CursorPos); } if (SpellConfig.W.Ready && sender.IsValidTarget(SpellConfig.W.Range) && InterrupterSpell.Contains(args.SpellData.Name)) { SpellConfig.W.Cast(); } }
static public InterrupterDatabase ReadDatabaseFromFile(string path) { string line; InterrupterDatabase output = new InterrupterDatabase(); using (StreamReader file = new StreamReader(path)) { while ((line = file.ReadLine()) != null) { string[] parts = line.Split('\t'); if (parts[0] == "Tag group:") { SpellTagGroup tag = new SpellTagGroup(parts[2].ToBoolean(), parts[3].ToBoolean(), parts[1], parts[4].Split(',')); output.Tags.Add(tag.GroupID, tag); } else if (parts[0] == "Spell:") { InterrupterSpell spell = new InterrupterSpell(parts[2].ToInt32(), parts[3].ToBoolean(), output.Tags, parts[4].Split(',')); output.Spells.Add(spell.ID, spell); } else if (parts[0] == "Unit:") { output.Units.Add(parts[1].ToString(), parts[2].ToBoolean()); } else if (parts[0].StartsWith("//")) { continue; } else { Logging.WriteDebug("<Interrupter Ultimate> Invalid database line: " + line); } } } return(output); }
public static InterrupterDatabase ReadDatabaseFromFile(string path) { string line; InterrupterDatabase output = new InterrupterDatabase(); using (StreamReader file = new StreamReader(path)) { while ((line = file.ReadLine()) != null) { string[] parts = line.Split('\t'); if (parts[0] == "Tag group:") { SpellTagGroup tag = new SpellTagGroup(parts[2].ToBoolean(), parts[3].ToBoolean(), parts[1], parts[4].Split(',')); output.Tags.Add(tag.GroupID, tag); } else if (parts[0] == "Spell:") { InterrupterSpell spell = new InterrupterSpell(parts[2].ToInt32(), parts[3].ToBoolean(), output.Tags, parts[4].Split(',')); output.Spells.Add(spell.ID, spell); } else if (parts[0] == "Unit:") { output.Units.Add(parts[1].ToString(), parts[2].ToBoolean()); } else if (parts[0].StartsWith("//")) { continue; } else { Logging.WriteDebug("<Interrupter Ultimate> Invalid database line: " + line); } } } return output; }