public void Load(IAccount account, string path) { _totalSpellLauch = 0; _account = account; _spells = ScriptsManager.LoadSpellsFromIA($"{path}.lua"); var spellsId = _account.Character.Spells.Select(s => s.SpellId).ToList(); foreach (var spell in _spells) { if (spellsId.Contains(spell.SpellId)) { continue; } var spellTmp = _spells.FirstOrDefault(s => s.SpellId == spell.SpellId); if (spellTmp != null) { _spells.Remove(spellTmp); } } /*foreach (var spell in _spells) * { * Logger.Default.Log(spell.SpellId.ToString()); * }*/ _account.Character.Fight.FightStarted += StartFight; _account.Character.Fight.TurnStarted += ExecuteSpell; _account.Character.Fight.FightEnded += FightEnd; }
public void OnCommand(IAccount account, string[] args) { if (args.Length < 1) { Logger.Default.Log("Erreur argument command ." + CommandName + ", LogMessageType.Public"); return; } var spells = ScriptsManager.LoadSpellsFromIA($"{args[0]}"); if (spells == null) { return; } foreach (var spell in spells) { Logger.Default.Log( $@"Spell ({spell.SpellId}), Target: {spell.Target}, Relaunchs: {spell.Relaunchs}, Condition: { spell.HandToHand }"); } if (((Character)account.Character).Ia == null) { ((Character)account.Character).Ia = new ArtificialIntelligence(); } ((Character)account.Character).Ia.Load(account, args[0]); }
public void OnCommand(IAccount account, string[] args) { if (args.Length < 1) { Logger.Default.Log("Erreur argument command ." + CommandName + ", LogMessageType.Public"); return; } var spells = ScriptsManager.LoadSpellsFromIA($"{args[0]}.lua"); if (spells == null) { return; } foreach (var spell in spells) { Logger.Default.Log( $@"Spell ({spell.SpellId}), Target: {spell.Target}, Relaunchs: {spell.Relaunchs}, Condition: { spell.Condition }"); } }