[
  {
    "id": "xedra_magic_generic",
    "type": "magic_type",
    "energy_source": "MANA"
  },
  {
    "id": "xedra_dream_magic",
    "type": "magic_type",
    "energy_source": "MANA",
    "get_level_formula_id": "xedra_dream_formula_get_level",
    "exp_for_level_formula_id": "xedra_dream_formula_exp_for_level",
    "casting_xp_formula_id": "xedra_dream_casting_xp_formula",
    "failure_cost_percent": 0.1,
    "failure_exp_percent": 1,
    "max_book_level": 0
  },
  {
    "id": "night_sight",
    "type": "SPELL",
    "name": "Night Sight",
    "description": "Gives you the power to see in the dark.",
    "message": "Your eyes glow lavender for a moment.  Now your sight can pierce the darkest shadows.",
    "valid_targets": [ "self" ],
    "effect": "attack",
    "effect_str": "night_sight",
    "skill": "deduction",
    "shape": "blast",
    "base_casting_time": 2000,
    "base_energy_cost": 1200,
    "magic_type": "xedra_magic_generic",
    "difficulty": 6,
    "max_level": 20,
    "min_duration": { "math": [ "spell_time(time(' 3 m'))" ] },
    "max_duration": { "math": [ "spell_time(time(' 3 h'))" ] },
    "duration_increment": { "math": [ "spell_time(time(' 3 m'))" ] }
  },
  {
    "id": "dread_weight",
    "type": "SPELL",
    "name": "Weight of Dread",
    "description": "Everything around you faces an existential crisis and moves slower as a result.  Including things that you wouldn't expect to suffer from existential crises, like the undead.  The air around the targets' extremities chills dramatically.  Higher levels allow a bigger AoE, and longer effect.",
    "effect": "attack",
    "effect_str": "effect_dread_weight",
    "skill": "deduction",
    "shape": "blast",
    "affected_body_parts": [ "foot_l", "foot_r", "arm_l", "arm_r" ],
    "valid_targets": [ "hostile" ],
    "max_level": 20,
    "min_damage": 10,
    "max_damage": 30,
    "damage_increment": 1.0,
    "min_aoe": 2,
    "max_aoe": 20,
    "aoe_increment": 0.9,
    "min_range": 5,
    "max_range": 20,
    "range_increment": 2.0,
    "min_duration": 1000,
    "max_duration": 5000,
    "duration_increment": 200,
    "spell_class": "NONE",
    "flags": [ "SOMATIC", "NO_PROJECTILE" ],
    "base_casting_time": 200,
    "base_energy_cost": 400,
    "magic_type": "xedra_magic_generic",
    "difficulty": 3,
    "damage_type": "cold"
  },
  {
    "id": "blur",
    "type": "SPELL",
    "name": "Blur",
    "description": "The edges of your form seem to blur and distort, increasing the amount of attacks you might dodge in a given turn.",
    "valid_targets": [ "self" ],
    "effect": "spawn_item",
    "effect_str": "blurred_aura",
    "skill": "deduction",
    "shape": "blast",
    "magic_type": "xedra_magic_generic",
    "spell_class": "NONE",
    "flags": [ "NO_LEGS" ],
    "difficulty": 4,
    "max_level": 15,
    "base_casting_time": 200,
    "base_energy_cost": 400,
    "min_duration": 21000,
    "max_duration": 90000,
    "duration_increment": 4600
  },
  {
    "id": "damage_transfer",
    "type": "SPELL",
    "name": "Damage Transfer",
    "description": "Allows you to move some damage from your body to someone else.  Usually people don't like it, but who cares now?",
    "//": "deal damage, give heal. nothing special.",
    "valid_targets": [ "hostile" ],
    "flags": [ "SOMATIC", "SILENT", "NO_PROJECTILE" ],
    "skill": "deduction",
    "effect": "attack",
    "shape": "blast",
    "damage_type": "bash",
    "min_damage": 5,
    "max_damage": 25,
    "damage_increment": 1,
    "min_range": 1,
    "max_range": 1,
    "max_level": 20,
    "difficulty": 6,
    "base_casting_time": 200,
    "magic_type": "xedra_magic_generic",
    "base_energy_cost": 600,
    "extra_effects": [ { "id": "damage_transfer_heal", "hit_self": true } ]
  },
  {
    "id": "damage_transfer_heal",
    "type": "SPELL",
    "name": { "str": "Damage Transfer Heal", "//~": "NO_I18N" },
    "description": { "str": "A spell that will heal you for a bit.  You can see it only in debug mode.", "//~": "NO_I18N" },
    "valid_targets": [ "self" ],
    "flags": [ "SILENT" ],
    "effect": "attack",
    "shape": "blast",
    "min_damage": -2,
    "max_damage": -12,
    "damage_increment": -0.5,
    "max_level": 20
  },
  {
    "id": "fire_teleport",
    "type": "SPELL",
    "name": "Pyroportation",
    "description": "Transports you from one place to another, creating a huge fire explosion in the end.",
    "effect": "short_range_teleport",
    "shape": "blast",
    "valid_targets": [ "ground" ],
    "flags": [ "SOMATIC", "SILENT", "NO_LEGS", "TARGET_TELEPORT" ],
    "skill": "deduction",
    "min_range": 4,
    "max_range": 12,
    "range_increment": 0.3,
    "min_aoe": 6,
    "max_aoe": 3,
    "aoe_increment": -0.1,
    "max_level": 30,
    "difficulty": 5,
    "base_casting_time": 300,
    "magic_type": "xedra_magic_generic",
    "base_energy_cost": 900,
    "energy_increment": -10,
    "final_energy_cost": 600,
    "extra_effects": [ { "id": "fire_teleport_explosion", "hit_self": true } ]
  },
  {
    "id": "fire_teleport_explosion",
    "type": "SPELL",
    "name": { "str": "Pyroportation Explosion", "//~": "NO_I18N" },
    "description": { "str": "Makes a pretty big fire explosion around you.", "//~": "NO_I18N" },
    "effect": "attack",
    "shape": "blast",
    "valid_targets": [ "hostile", "ground" ],
    "flags": [ "IGNITE_FLAMMABLE", "LOUD" ],
    "max_level": 30,
    "min_damage": 30,
    "max_damage": 80,
    "damage_increment": 1.7,
    "min_aoe": 3,
    "max_aoe": 6,
    "aoe_increment": 0.1,
    "damage_type": "heat"
  },
  {
    "id": "call_daffodil",
    "type": "SPELL",
    "name": "Call Daffodil",
    "description": "A few daffodil warriors appear near you.  They will fight for you, but they will fade away after a day.",
    "valid_targets": [ "self" ],
    "spell_class": "NONE",
    "effect": "effect_on_condition",
    "effect_str": "EOC_CALL_DAFFODIL",
    "shape": "blast",
    "flags": [ "NO_LEGS", "SILENT", "NO_EXPLOSION_SFX", "NO_FAIL", "NO_HANDS", "NON_MAGICAL" ]
  },
  {
    "id": "call_daffodil_real",
    "type": "SPELL",
    "name": { "str": "Call Daffodil", "//~": "NO_I18N" },
    "description": { "str": "Hidden spell that spawns the daffodil", "//~": "NO_I18N" },
    "valid_targets": [ "ground" ],
    "min_damage": 5,
    "max_damage": 5,
    "max_level": 1,
    "difficulty": 0,
    "min_range": 3,
    "max_range": 3,
    "min_aoe": 3,
    "max_aoe": 3,
    "spell_class": "NONE",
    "effect": "summon",
    "effect_str": "mon_fetch_daffodil_warrior",
    "shape": "blast",
    "flags": [ "NO_LEGS", "SILENT", "NO_EXPLOSION_SFX", "NO_FAIL", "NO_HANDS", "NON_MAGICAL" ],
    "min_duration": { "math": [ "spell_time(time(' 24 h'))" ] },
    "max_duration": { "math": [ "spell_time(time(' 24 h'))" ] }
  },
  {
    "id": "boann_retaliation_mark",
    "type": "SPELL",
    "name": { "str": "Boann's retaliation targeting", "//~": "NO_I18N" },
    "valid_targets": [ "self", "hostile", "ground", "ally" ],
    "description": { "str": "Intended to be hidden.  This is how Boann teleport away monsters that hit her.", "//~": "NO_I18N" },
    "flags": [ "SILENT", "NO_EXPLOSION_SFX", "NO_FAIL" ],
    "message": "",
    "effect": "attack",
    "effect_str": "boann_retaliation_mark",
    "min_range": 60,
    "max_range": 60,
    "min_duration": 500,
    "max_duration": 500,
    "shape": "blast"
  },
  {
    "id": "boann_retaliation",
    "type": "SPELL",
    "name": { "str": "Boann's retaliation", "//~": "NO_I18N" },
    "valid_targets": [ "self" ],
    "description": {
      "str": "Intended to be hidden.  Makes Boann teleport the player away, spawns some huntsmen and hounds then cure all her ailments and injuries if she survives being hit by the player.",
      "//~": "NO_I18N"
    },
    "flags": [ "SILENT", "NO_EXPLOSION_SFX", "NO_FAIL" ],
    "message": "",
    "effect": "effect_on_condition",
    "effect_str": "EOC_BOANN_RETALIATION",
    "shape": "blast"
  },
  {
    "id": "EOC_BOANN_RETALIATION",
    "type": "effect_on_condition",
    "condition": { "u_has_effect": "hit_by_player" },
    "effect": [ { "run_eocs": [ "EOC_BOANN_RETALIATION_REAL" ], "alpha_talker": "u", "beta_talker": "avatar" } ],
    "false_effect": {
      "run_eocs": [
        {
          "id": "EOC_BOANN_RETALIATION_NON_PLAYER",
          "//": "Needed to properly assign alpha and beta talkers",
          "effect": [ { "run_eocs": [ "EOC_BOANN_RETALIATION_NON_PLAYER_REAL" ], "alpha_talker": "u", "beta_talker": "avatar" } ]
        }
      ]
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BOANN_RETALIATION_REAL",
    "condition": { "and": [ "u_is_alive", "npc_is_avatar" ] },
    "effect": [
      {
        "npc_location_variable": { "context_val": "Boann_teleport" },
        "target_params": {
          "om_terrain": "forest",
          "om_terrain_match_type": "CONTAINS",
          "search_range": 1200,
          "min_distance": 250,
          "z": 0,
          "random": true
        }
      },
      {
        "npc_message": "Boann waves her hands as you strike her, and you are enveloped by a swirl of multicolored lights.",
        "popup": true
      },
      { "u_cast_spell": { "id": "boann_heal" } },
      { "u_lose_effect": "hit_by_player" },
      { "u_add_effect": "effect_goblin_fruit_nobleed", "duration": 2 },
      { "u_add_effect": "panacea", "duration": 2 },
      { "u_add_effect": "cureall", "duration": 2 },
      {
        "u_spawn_monster": "mon_wild_huntsman",
        "real_count": { "math": [ "4 + rand(2)" ] },
        "min_radius": 2,
        "max_radius": 7
      },
      {
        "u_spawn_monster": "mon_wild_hunt_hound",
        "real_count": { "math": [ "8 + rand(4)" ] },
        "min_radius": 4,
        "max_radius": 10
      },
      { "npc_teleport": { "context_val": "Boann_teleport" }, "force": true }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BOANN_RETALIATION_NON_PLAYER_REAL",
    "//": "You won't ever see the teleported target again, so might as well kill it.",
    "//2": "The hunt won't spawn as you you did not strike Boann yourself.",
    "condition": "u_is_alive",
    "effect": [
      { "u_cast_spell": { "id": "boann_banish_monsters_check" } },
      { "u_cast_spell": { "id": "boann_heal" } },
      { "u_add_effect": "effect_goblin_fruit_nobleed", "duration": 2 },
      { "u_add_effect": "panacea", "duration": 2 },
      { "u_add_effect": "cureall", "duration": 2 },
      {
        "npc_message": "Boann waves her hands as her opponent strikes her, and they vanish in a swirl of multicolored lights."
      }
    ]
  },
  {
    "type": "SPELL",
    "id": "boann_heal",
    "name": { "str": "Boann Heal", "//~": "NO_I18N" },
    "description": { "str": "Will heal injuries all over Boann's body.", "//~": "NO_I18N" },
    "valid_targets": [ "self" ],
    "effect": "attack",
    "flags": [ "NO_PROJECTILE", "NO_EXPLOSION_SFX", "NO_FAIL", "SILENT" ],
    "teachable": false,
    "shape": "blast",
    "base_casting_time": 0,
    "min_damage": -300,
    "max_damage": -300,
    "message": "",
    "sound_description": ""
  },
  {
    "id": "boann_banish_monsters_check",
    "type": "SPELL",
    "name": { "str": "Boann's retaliation against monsters check", "//~": "NO_I18N" },
    "description": {
      "str": "Boann's about to retaliate against monsters, deleting them as they are \"teleported\" away.  You shouldn't see this",
      "//~": "NO_I18N"
    },
    "teachable": false,
    "valid_targets": [ "self", "ally", "hostile" ],
    "effect": "effect_on_condition",
    "effect_str": "EOC_BOANN_RETALIATION_NON_PLAYER_TARGETING",
    "shape": "blast",
    "spell_class": "NONE",
    "damage_type": "pure",
    "skill": "deduction",
    "min_range": 60,
    "max_range": 60,
    "min_aoe": 60,
    "max_aoe": 60,
    "base_casting_time": 0,
    "flags": [ "SILENT", "NO_FAIL", "NO_EXPLOSION_SFX" ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_BOANN_RETALIATION_NON_PLAYER_TARGETING",
    "condition": { "u_has_effect": "boann_retaliation_mark" },
    "effect": [ { "u_cast_spell": { "id": "boann_banish_monsters" } } ]
  },
  {
    "id": "boann_banish_monsters",
    "type": "SPELL",
    "name": { "str": "Boann's retaliation against monsters", "//~": "NO_I18N" },
    "description": {
      "str": "Boann's retaliation against monsters, deleting them as they are \"teleported\" away.  You shouldn't see this",
      "//~": "NO_I18N"
    },
    "teachable": false,
    "valid_targets": [ "self" ],
    "effect": "banishment",
    "shape": "blast",
    "spell_class": "NONE",
    "damage_type": "pure",
    "skill": "deduction",
    "min_damage": 9999,
    "max_damage": 9999,
    "base_casting_time": 0,
    "flags": [ "SILENT", "NO_FAIL" ]
  },
  {
    "id": "xedra_self_banish",
    "type": "SPELL",
    "name": { "str": "Banish Self", "//~": "NO_I18N" },
    "description": {
      "str": "Banish the caster, killing them and destroying their body.  Having this spell is a bug, and casting it would be suicidal.",
      "//~": "NO_I18N"
    },
    "teachable": false,
    "valid_targets": [ "self" ],
    "effect": "banishment",
    "shape": "blast",
    "spell_class": "NONE",
    "damage_type": "pure",
    "min_damage": 9999,
    "max_damage": 9999,
    "base_casting_time": 0,
    "flags": [ "SILENT", "NO_FAIL", "PERCENT_DAMAGE" ]
  }
]
