﻿<?xml version="1.0" encoding="utf-16"?>
<FightClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <FightClassGeneralSettings>
    <FightClassName>Test</FightClassName>
    <Range>30</Range>
    <AdditionalCode>[Serializable]
public class TestSettings : Settings {

  [Setting, DefaultValue(0)]
  [Category("Test")]
  [DisplayName("Test Spell")]
  [Description("Print here any known spell")]
  public string testSpell { get; set; }

  private TestSettings(){
    ConfigWinForm(new System.Drawing.Point(400, 400), "Test " + Translate.Get("Settings"));
  }

  public static TestSettings CurrentSetting { get; set; }

  public bool Save() {
    try {
      return Save(AdviserFilePathAndName("CustomClass-Test", ObjectManager.Me.Name + "." + Usefuls.RealmName));
    } catch (Exception e) {
      Logging.WriteError("TestSettings &gt; Save(): " + e);
      return false;
    }
  }

  public static bool Load() {
    try {
      if (File.Exists(AdviserFilePathAndName("CustomClass-Test", ObjectManager.Me.Name + "." + Usefuls.RealmName))) {
        CurrentSetting =
          Load&lt;TestSettings&gt;(AdviserFilePathAndName("CustomClass-Test",
                                 ObjectManager.Me.Name + "." + Usefuls.RealmName));
        return true;
      }
      CurrentSetting = new TestSettings();
    } catch (Exception e) {
      Logging.WriteError("TestSettings &gt; Load(): " + e);
    }
    return false;
  }
}

public bool castSpell() {
  SpellManager.CastSpellByNameLUA(Main.TestSettings.CurrentSetting.testSpell);
  Usefuls.WaitIsCasting();
  return true;
}</AdditionalCode>
  </FightClassGeneralSettings>
  <FightClassSpells>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>CSharpCode</ContionType>
          <Param xsi:type="FightClassConditionString">
            <Value>castSpell()</Value>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>/**** spell casted ****/</SpellName>
      <Priority>1</Priority>
      <NotSpellIsCSharpCode>true</NotSpellIsCSharpCode>
      <Debug>true</Debug>
      <LockFrame>false</LockFrame>
    </FightClassSpell>
  </FightClassSpells>
</FightClass>