public void AddSpells(INonPlayerCharacter npc, IGuild guild) { foreach (GuildAbility ability in guild.Spells) { if (ability.Level <= npc.Level) { BaseDamageSpell baseDamageSpell = ability.Abiltiy as BaseDamageSpell; if (baseDamageSpell != null) { npc.SpellBook.Add(baseDamageSpell.SpellName.ToUpper(), baseDamageSpell); DamageSpells.Add(baseDamageSpell); } BaseCureSpell baseCureSpell = ability.Abiltiy as BaseCureSpell; if (baseCureSpell != null) { npc.SpellBook.Add(baseCureSpell.SpellName.ToUpper(), baseCureSpell); CureSpell.Add(baseCureSpell); } } } DamageSpells = DamageSpells.OrderByDescending(e => e.ManaCost).ToList(); CureSpell = CureSpell.OrderByDescending(e => e.ManaCost).ToList(); }
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(); } }