[
  {
    "id": "stonefist",
    "type": "SPELL",
    "name": "Stonefist",
    "description": "Encases your arms and hands in a sheath of magical stone, you can punch and defend yourself with it in melee combat.",
    "valid_targets": [ "self" ],
    "flags": [ "CONJURATION_SPELL", "SOMATIC", "LOUD" ],
    "min_damage": 1,
    "max_damage": 1,
    "effect": "spawn_item",
    "effect_str": "stonefist",
    "shape": "blast",
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 2,
    "max_level": 15,
    "base_casting_time": 200,
    "base_energy_cost": 100,
    "min_duration": 24000,
    "max_duration": 360000,
    "duration_increment": 24000,
    "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ],
    "learn_spells": { "stonefist_plus": 15 }
  },
  {
    "id": "stonefist_plus",
    "type": "SPELL",
    "name": "Improved Stonefist",
    "description": "Encases your arms and hands in a sheath of magical stone, you can punch and defend yourself with it in melee combat.  Now you know this spell like the back of your hand, and have started to design your own version.",
    "valid_targets": [ "self" ],
    "flags": [ "CONJURATION_SPELL", "SOMATIC", "NO_FAIL" ],
    "min_damage": 1,
    "max_damage": 1,
    "effect": "spawn_item",
    "effect_str": "stonefist",
    "shape": "blast",
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 2,
    "max_level": 25,
    "base_casting_time": 200,
    "final_casting_time": 50,
    "casting_time_increment": -6,
    "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ],
    "base_energy_cost": 100,
    "final_energy_cost": 50,
    "energy_increment": -2,
    "min_duration": 360000,
    "max_duration": 2160000,
    "duration_increment": 72000
  },
  {
    "id": "seismic_stomp",
    "type": "SPELL",
    "name": "Seismic Stomp",
    "description": "Focusing mana into your leg, you stomp your foot and send out a shockwave, knocking enemies around you onto the ground.",
    "effect": "attack",
    "effect_str": "downed",
    "shape": "blast",
    "valid_targets": [ "hostile", "ground", "none" ],
    "flags": [ "EVOCATION_SPELL", "RANDOM_DAMAGE", "SOMATIC", "LOUD", "NO_PROJECTILE", "SPLIT_DAMAGE" ],
    "extra_effects": [ { "id": "eoc_evocation_setup", "hit_self": true } ],
    "max_level": 10,
    "min_damage": 1,
    "max_damage": 6,
    "min_aoe": 3,
    "max_aoe": 12,
    "aoe_increment": 1,
    "min_duration": 1000,
    "max_duration": 6000,
    "duration_increment": 500,
    "spell_class": "EARTHSHAPER",
    "base_casting_time": 100,
    "base_energy_cost": 250,
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 2,
    "damage_type": "bash"
  },
  {
    "id": "recover_stamina",
    "type": "SPELL",
    "name": "Stone's Endurance",
    "description": "You focus on the stones beneath you and draw from their agelessness.  Your mana is converted to stamina.",
    "effect": "recover_energy",
    "effect_str": "STAMINA",
    "shape": "blast",
    "valid_targets": [ "self" ],
    "flags": [ "RESTORATION_SPELL", "RANDOM_DAMAGE", "NO_HANDS", "CONCENTRATE", "SILENT" ],
    "max_level": 12,
    "spell_class": "EARTHSHAPER",
    "min_damage": { "math": [ "(u_spell_level('recover_stamina') * 350) + 500" ] },
    "max_damage": { "math": [ "(u_spell_level('recover_stamina') * 650) + 850" ] },
    "base_casting_time": 500,
    "final_casting_time": 300,
    "casting_time_increment": -17,
    "magic_type": "magiclysm_generic_magic",
    "base_energy_cost": 150,
    "energy_increment": 75,
    "final_energy_cost": 1000,
    "difficulty": 5,
    "extra_effects": [ { "id": "eoc_restoration_setup", "hit_self": true } ]
  },
  {
    "id": "eshaper_shardspray",
    "type": "SPELL",
    "name": "Shardspray",
    "description": "This spell projects a wide spray of sharp metal shards, cutting into your foes and friends alike.",
    "valid_targets": [ "hostile", "ground", "ally" ],
    "flags": [ "EVOCATION_SPELL", "RANDOM_DAMAGE", "SOMATIC", "LOUD", "NO_HANDS" ],
    "multiple_projectiles": { "math": [ "rng(3, 8)" ] },
    "components": "spell_components_shardspray",
    "effect": "attack",
    "shape": "cone",
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 3,
    "base_casting_time": 100,
    "base_energy_cost": 100,
    "max_level": 20,
    "min_damage": { "math": [ "(u_spell_level('eshaper_shardspray') * 0.8) + 10" ] },
    "max_damage": { "math": [ "(u_spell_level('eshaper_shardspray') * 2) + 25" ] },
    "extra_effects": [ { "id": "eoc_evocation_setup", "hit_self": true } ],
    "damage_type": "cut",
    "min_aoe": 25,
    "max_aoe": 60,
    "aoe_increment": 5,
    "min_range": 3,
    "max_range": 10,
    "range_increment": 0.5,
    "min_pierce": 0,
    "max_pierce": 5,
    "pierce_increment": 0.4
  },
  {
    "id": "eshaper_piercing_bolt",
    "type": "SPELL",
    "name": "Piercing Bolt",
    "description": "This spell projects a piercing rod of conjured iron at those that dare oppose you.",
    "valid_targets": [ "hostile" ],
    "flags": [ "EVOCATION_SPELL", "RANDOM_DAMAGE", "SOMATIC", "LOUD" ],
    "effect": "attack",
    "shape": "blast",
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "base_casting_time": 100,
    "base_energy_cost": 115,
    "difficulty": 2,
    "max_level": 20,
    "min_damage": { "math": [ "(u_spell_level('eshaper_piercing_bolt') * 1) + 4" ] },
    "max_damage": { "math": [ "(u_spell_level('eshaper_piercing_bolt') * 2.2) + 8" ] },
    "extra_effects": [ { "id": "eoc_evocation_setup", "hit_self": true } ],
    "damage_type": "stab",
    "min_range": 8,
    "max_range": 26,
    "range_increment": 1.5
  },
  {
    "id": "eshaper_shardstorm",
    "type": "SPELL",
    "name": "Shardstorm",
    "description": "Creates an omnidirectional spray of razor sharp metal shards all around you.",
    "valid_targets": [ "hostile", "ally", "ground" ],
    "flags": [ "EVOCATION_SPELL", "RANDOM_DAMAGE", "SOMATIC", "LOUD", "SPLIT_DAMAGE" ],
    "min_damage": { "math": [ "(u_spell_level('eshaper_shardstorm') * 0.5) + 6" ] },
    "max_damage": { "math": [ "(u_spell_level('eshaper_shardstorm') * 1.5) + 12" ] },
    "extra_effects": [ { "id": "eoc_evocation_setup", "hit_self": true } ],
    "damage_type": "cut",
    "min_aoe": 1,
    "max_aoe": 6,
    "aoe_increment": 0.25,
    "base_energy_cost": 200,
    "spell_class": "EARTHSHAPER",
    "difficulty": 4,
    "max_level": 20,
    "base_casting_time": 100,
    "magic_type": "magiclysm_generic_magic",
    "shape": "blast",
    "effect": "attack"
  },
  {
    "id": "eshaper_rockbolt",
    "type": "SPELL",
    "name": "Rockbolt",
    "description": "Fires a conjured stone projectile at high velocity.",
    "valid_targets": [ "hostile", "ally" ],
    "flags": [ "EVOCATION_SPELL", "RANDOM_DAMAGE", "SOMATIC", "LOUD" ],
    "min_damage": { "math": [ "(u_spell_level('eshaper_rockbolt') * 0.4) + 2" ] },
    "max_damage": { "math": [ "(u_spell_level('eshaper_rockbolt') * 1.2) + 4" ] },
    "damage_type": "bash",
    "min_range": 5,
    "range_increment": 0.5,
    "max_range": 15,
    "base_energy_cost": 50,
    "spell_class": "EARTHSHAPER",
    "extra_effects": [ { "id": "eoc_evocation_setup", "hit_self": true } ],
    "difficulty": 1,
    "max_level": 20,
    "base_casting_time": 100,
    "magic_type": "magiclysm_generic_magic",
    "shape": "blast",
    "effect": "attack"
  },
  {
    "id": "move_earth",
    "type": "SPELL",
    "name": "Move Earth",
    "description": "Your essence flows around you, and the earth follows.",
    "valid_targets": [ "hostile", "ally", "ground", "self" ],
    "flags": [ "CHANNELING_SPELL", "SOMATIC", "LOUD", "NO_PROJECTILE" ],
    "extra_effects": [ { "id": "eoc_channeling_setup", "hit_self": true } ],
    "min_aoe": 1,
    "max_aoe": 2,
    "min_damage": 100,
    "max_damage": 1,
    "damage_increment": -5,
    "aoe_increment": 0.25,
    "base_energy_cost": 200,
    "spell_class": "EARTHSHAPER",
    "difficulty": 4,
    "max_level": 20,
    "min_range": 5,
    "max_range": 5,
    "base_casting_time": 1200,
    "final_casting_time": 200,
    "casting_time_increment": -50,
    "magic_type": "magiclysm_generic_magic",
    "shape": "blast",
    "effect": "ter_transform",
    "effect_str": "move_earth"
  },
  {
    "id": "create_rune_earthshaper",
    "type": "SPELL",
    "name": "Earthshaper Rune",
    "description": "This ritual creates a small pebble attuned to Earthshapers.  You can use the rune as a catalyst for recipes.",
    "valid_targets": [ "self" ],
    "min_damage": 1,
    "max_damage": 1,
    "effect": "spawn_item",
    "effect_str": "rune_earthshaper",
    "shape": "blast",
    "base_casting_time": 5000,
    "extra_effects": [ { "id": "eoc_channeling_setup", "hit_self": true } ],
    "base_energy_cost": 5,
    "min_duration": 1,
    "max_duration": 2,
    "duration_increment": 1,
    "difficulty": 0,
    "max_level": 0,
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "flags": [ "CHANNELING_SPELL", "PERMANENT", "NO_LEGS", "CONCENTRATE" ]
  },
  {
    "id": "clairvoyance",
    "type": "SPELL",
    "name": "Clairvoyance",
    "description": "You close your eyes and the earth surrenders its secrets to you.",
    "effect": "attack",
    "shape": "blast",
    "valid_targets": [ "ally", "hostile", "ground" ],
    "flags": [ "CHANNELING_SPELL", "SOMATIC", "VERBAL", "IGNORE_WALLS", "NO_PROJECTILE" ],
    "extra_effects": [ { "id": "eoc_channeling_setup", "hit_self": true } ],
    "max_level": 20,
    "min_aoe": 4,
    "max_aoe": 13,
    "aoe_increment": 0.5,
    "spell_class": "EARTHSHAPER",
    "base_casting_time": 350,
    "base_energy_cost": 750,
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 4,
    "field_id": "fd_clairvoyant",
    "min_field_intensity": 1,
    "max_field_intensity": 1
  },
  {
    "id": "earthshaper_stoneskin",
    "type": "SPELL",
    "name": "Stoneskin",
    "description": "Envelops your entire body in armor formed from living rock, encumbering yet protective.",
    "valid_targets": [ "self" ],
    "effect": "spawn_item",
    "effect_str": "aura_stoneskin",
    "shape": "blast",
    "flags": [ "CONJURATION_SPELL", "SOMATIC", "LOUD" ],
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 4,
    "base_casting_time": 300,
    "base_energy_cost": 300,
    "max_level": 15,
    "min_damage": 1,
    "max_damage": 1,
    "min_duration": 24000,
    "max_duration": 360000,
    "duration_increment": 24000,
    "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ],
    "learn_spells": { "earthshaper_stoneskin_plus": 15 }
  },
  {
    "id": "earthshaper_stoneskin_plus",
    "type": "SPELL",
    "name": "Improved Stoneskin",
    "description": "Envelops your entire body in armor formed from living rock, encumbering yet protective.  Now you know this spell like the back of your hand, and have started to design your own version.",
    "valid_targets": [ "self" ],
    "effect": "spawn_item",
    "effect_str": "aura_stoneskin",
    "shape": "blast",
    "flags": [ "CONJURATION_SPELL", "SOMATIC", "LOUD", "NO_FAIL" ],
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 6,
    "base_casting_time": 300,
    "final_casting_time": 100,
    "casting_time_increment": -8,
    "base_energy_cost": 300,
    "final_energy_cost": 100,
    "energy_increment": -8,
    "max_level": 25,
    "min_damage": 1,
    "max_damage": 1,
    "min_duration": 360000,
    "max_duration": 2160000,
    "duration_increment": 72000,
    "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ]
  },
  {
    "id": "earthshaper_pillar",
    "type": "SPELL",
    "name": "Pillar of Stone",
    "description": "Drawing upon the surrounding earth, you form a pillar of solid rock.  Experience will make the task easier, and less disruptive to the surrounding area.",
    "valid_targets": [ "ground" ],
    "effect": "ter_transform",
    "effect_str": "earthshaper_pillar",
    "shape": "blast",
    "extra_effects": [ { "id": "earthshaper_pillar_side_effect" }, { "id": "eoc_channeling_setup", "hit_self": true } ],
    "flags": [ "CHANNELING_SPELL", "SOMATIC", "LOUD", "NO_PROJECTILE" ],
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 3,
    "base_casting_time": 30000,
    "final_casting_time": 6000,
    "casting_time_increment": -2400,
    "base_energy_cost": 500,
    "max_level": 10,
    "min_range": 3,
    "max_range": 6,
    "range_increment": 0.3
  },
  {
    "id": "earthshaper_pillar_side_effect",
    "type": "SPELL",
    "name": { "str": "Pillar Side Effect", "//~": "NO_I18N" },
    "description": { "str": "Bash effect that follows, levels reduce damage and AoE.", "//~": "NO_I18N" },
    "valid_targets": [ "ground" ],
    "effect": "bash",
    "shape": "blast",
    "flags": [ "IGNORE_WALLS", "SILENT", "NO_PROJECTILE" ],
    "max_level": 10,
    "min_damage": 80,
    "max_damage": 20,
    "damage_increment": -6,
    "min_aoe": 5,
    "max_aoe": 0,
    "aoe_increment": -0.5
  },
  {
    "id": "pertifying_touch",
    "type": "SPELL",
    "name": "Petrifying Touch",
    "description": "With a simple touch, you transform the body of your enemy into pure stone.  The effect is temporary, but the target will be totally immobile while the spell lasts.",
    "valid_targets": [ "hostile" ],
    "flags": [ "EVOCATION_SPELL", "SILENT", "NO_HANDS" ],
    "effect": "attack",
    "effect_str": "effect_earthshaper_petrifying_touch",
    "shape": "blast",
    "damage_type": "necrotic",
    "min_range": 1,
    "max_range": 1,
    "min_duration": 2000,
    "max_duration": 12000,
    "duration_increment": 500,
    "base_energy_cost": 175,
    "final_energy_cost": 75,
    "energy_increment": -5,
    "spell_class": "EARTHSHAPER",
    "difficulty": 7,
    "max_level": 20,
    "base_casting_time": 160,
    "final_casting_time": 40,
    "casting_time_increment": -6,
    "extra_effects": [ { "id": "eoc_evocation_setup", "hit_self": true } ],
    "magic_type": "magiclysm_generic_magic",
    "ignored_monster_species": [ "ROBOT", "ROBOT_FLYING", "NETHER_EMANATION" ]
  },
  {
    "id": "reactive_armor",
    "type": "SPELL",
    "name": "Reactive Armor",
    "description": "Explode your stone skin, to deal massive damage to all enemies around.",
    "effect": "attack",
    "effect_str": "downed",
    "shape": "blast",
    "components": "spell_components_reactive_armor",
    "valid_targets": [ "hostile", "ground" ],
    "flags": [ "EVOCATION_SPELL", "SOMATIC", "LOUD", "NO_HANDS", "RANDOM_DURATION", "SPLIT_DAMAGE" ],
    "max_level": 20,
    "min_damage": { "math": [ "(u_spell_level('reactive_armor') * 3) + 8" ] },
    "max_damage": { "math": [ "(u_spell_level('reactive_armor') * 7) + 15" ] },
    "extra_effects": [ { "id": "eoc_evocation_setup", "hit_self": true } ],
    "min_aoe": 2,
    "max_aoe": 12,
    "aoe_increment": 0.5,
    "min_duration": 100,
    "max_duration": 600,
    "spell_class": "EARTHSHAPER",
    "base_casting_time": 160,
    "final_casting_time": 40,
    "casting_time_increment": -6,
    "base_energy_cost": 350,
    "final_energy_cost": 250,
    "energy_increment": -5,
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 5,
    "damage_type": "stab"
  },
  {
    "id": "eshaper_impalement",
    "type": "SPELL",
    "name": "Impalement",
    "description": "Summon a stone spikes underground, that penetrate your enemies, and nail them for a while.",
    "//": "Would be great to replace the extra effect with some custom field, that do not allow enemies to pass it by, and stops the one who is inside, dealing some damage",
    "effect": "attack",
    "shape": "blast",
    "valid_targets": [ "hostile", "ground" ],
    "flags": [ "EVOCATION_SPELL", "SOMATIC", "VERBAL", "NO_PROJECTILE", "NO_LEGS", "SPLIT_DAMAGE" ],
    "max_level": 20,
    "min_damage": { "math": [ "(u_spell_level('eshaper_impalement') * 1.5) + 4" ] },
    "max_damage": { "math": [ "(u_spell_level('eshaper_impalement') * 3.2) + 8" ] },
    "min_aoe": 1,
    "max_aoe": 7,
    "aoe_increment": 0.3,
    "min_range": 6,
    "max_range": 20,
    "range_increment": 1.0,
    "spell_class": "EARTHSHAPER",
    "base_casting_time": 200,
    "base_energy_cost": 300,
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 5,
    "damage_type": "stab",
    "extra_effects": [ { "id": "eshaper_impalement_moves" }, { "id": "eoc_evocation_setup", "hit_self": true } ]
  },
  {
    "id": "eshaper_impalement_moves",
    "type": "SPELL",
    "name": { "str": "Impalement Moves Removing", "//~": "NO_I18N" },
    "description": { "str": "Delete some random amount of moves from monster.  You can see it only in debug mode.", "//~": "NO_I18N" },
    "valid_targets": [ "hostile" ],
    "flags": [ "EVOCATION_SPELL", "SILENT", "RANDOM_DAMAGE", "NO_PROJECTILE", "NO_EXPLOSION_SFX" ],
    "effect": "mod_moves",
    "shape": "blast",
    "max_level": 20,
    "min_aoe": 1,
    "max_aoe": 7,
    "aoe_increment": 0.3,
    "min_damage": -1000,
    "max_damage": -1
  },
  {
    "id": "eshaper_spawn_tools",
    "type": "SPELL",
    "name": "Utility Molding",
    "description": "Shape the basic working tools, using your own magic abilities and earth nearby.  Activate to change the shape of a tool.",
    "valid_targets": [ "self" ],
    "flags": [ "CONJURATION_SPELL", "SOMATIC", "LOUD" ],
    "min_damage": 1,
    "max_damage": 1,
    "effect": "effect_on_condition",
    "effect_str": "EOC_EARTHSHAPER_UTILITY_MOLDING",
    "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ],
    "shape": "blast",
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 2,
    "max_level": 14,
    "base_casting_time": 360000,
    "final_casting_time": 90000,
    "casting_time_increment": -18000,
    "base_energy_cost": 600,
    "final_energy_cost": 200,
    "energy_increment": -30,
    "min_duration": 576000,
    "max_duration": 8640000,
    "duration_increment": 576000
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_UTILITY_MOLDING",
    "effect": [
      {
        "run_eoc_selector": [
          "EOC_EARTHSHAPER_UTILITY_MOLDING_HAMMER",
          "EOC_EARTHSHAPER_UTILITY_MOLDING_PICKAXE",
          "EOC_EARTHSHAPER_UTILITY_MOLDING_AXE",
          "EOC_EARTHSHAPER_UTILITY_MOLDING_KNIFE",
          "EOC_EARTHSHAPER_UTILITY_MOLDING_SHOVEL"
        ],
        "names": [ "Summon Hammer", "Summon Pickaxe", "Summon Axe", "Summon Knife", "Summon Shovel" ],
        "keys": [ "1", "2", "3", "4", "5" ],
        "descriptions": [
          "Transform the living earth into a hammer.",
          "Transform the living earth into a pickaxe.",
          "Transform the living earth into an axe.",
          "Transform the living earth into a knife.",
          "Transform the living earth into a shovel."
        ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_UTILITY_MOLDING_HAMMER",
    "effect": [ { "u_cast_spell": { "id": "eshaper_spawn_hammer" } } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_UTILITY_MOLDING_PICKAXE",
    "effect": [ { "u_cast_spell": { "id": "eshaper_spawn_pickaxe" } } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_UTILITY_MOLDING_AXE",
    "effect": [ { "u_cast_spell": { "id": "eshaper_spawn_axe" } } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_UTILITY_MOLDING_KNIFE",
    "effect": [ { "u_cast_spell": { "id": "eshaper_spawn_knife" } } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_UTILITY_MOLDING_SHOVEL",
    "effect": [ { "u_cast_spell": { "id": "eshaper_spawn_shovel" } } ]
  },
  {
    "id": "eshaper_spawn_hammer",
    "type": "SPELL",
    "name": { "str": "Utility Molding (Hammer)", "//~": "NO_I18N" },
    "description": { "str": "Spawn the Utility molding hammer.  It's a bug if you have this spell directly.", "//~": "NO_I18N" },
    "valid_targets": [ "self" ],
    "flags": [ "CONJURATION_SPELL", "SILENT", "NO_EXPLOSION_SFX" ],
    "min_damage": 1,
    "max_damage": 1,
    "effect": "spawn_item",
    "effect_str": "eshaper_hammer",
    "shape": "blast",
    "min_duration": { "math": [ "(u_spell_level('eshaper_spawn_tools') * 576000)" ] },
    "max_duration": { "math": [ "(u_spell_level('eshaper_spawn_tools') * 576000)" ] }
  },
  {
    "id": "eshaper_spawn_pickaxe",
    "type": "SPELL",
    "name": { "str": "Utility Molding (Pickaxe)", "//~": "NO_I18N" },
    "description": { "str": "Spawn the Utility molding pickaxe.  It's a bug if you have this spell directly.", "//~": "NO_I18N" },
    "valid_targets": [ "self" ],
    "flags": [ "CONJURATION_SPELL", "SILENT", "NO_EXPLOSION_SFX" ],
    "min_damage": 1,
    "max_damage": 1,
    "effect": "spawn_item",
    "effect_str": "eshaper_pickaxe",
    "shape": "blast",
    "min_duration": { "math": [ "(u_spell_level('eshaper_spawn_tools') * 576000)" ] },
    "max_duration": { "math": [ "(u_spell_level('eshaper_spawn_tools') * 576000) " ] }
  },
  {
    "id": "eshaper_spawn_axe",
    "type": "SPELL",
    "name": { "str": "Utility Molding (Axe)", "//~": "NO_I18N" },
    "description": { "str": "Spawn the Utility molding axe.  It's a bug if you have this spell directly.", "//~": "NO_I18N" },
    "valid_targets": [ "self" ],
    "flags": [ "CONJURATION_SPELL", "SILENT", "NO_EXPLOSION_SFX" ],
    "min_damage": 1,
    "max_damage": 1,
    "effect": "spawn_item",
    "effect_str": "eshaper_ax",
    "shape": "blast",
    "min_duration": { "math": [ "(u_spell_level('eshaper_spawn_tools') * 576000)" ] },
    "max_duration": { "math": [ "(u_spell_level('eshaper_spawn_tools') * 576000) " ] }
  },
  {
    "id": "eshaper_spawn_knife",
    "type": "SPELL",
    "name": { "str": "Utility Molding (Knife)", "//~": "NO_I18N" },
    "description": { "str": "Spawn the Utility molding knife.  It's a bug if you have this spell directly.", "//~": "NO_I18N" },
    "valid_targets": [ "self" ],
    "flags": [ "CONJURATION_SPELL", "SILENT", "NO_EXPLOSION_SFX" ],
    "min_damage": 1,
    "max_damage": 1,
    "effect": "spawn_item",
    "effect_str": "eshaper_knife",
    "shape": "blast",
    "min_duration": { "math": [ "(u_spell_level('eshaper_spawn_tools') * 576000) " ] },
    "max_duration": { "math": [ "(u_spell_level('eshaper_spawn_tools') * 576000) " ] }
  },
  {
    "id": "eshaper_spawn_shovel",
    "type": "SPELL",
    "name": { "str": "Utility Molding (Shovel)", "//~": "NO_I18N" },
    "description": { "str": "Spawn the Utility molding shovel.  It's a bug if you have this spell directly.", "//~": "NO_I18N" },
    "valid_targets": [ "self" ],
    "flags": [ "CONJURATION_SPELL", "SILENT", "NO_EXPLOSION_SFX" ],
    "min_damage": 1,
    "max_damage": 1,
    "effect": "spawn_item",
    "effect_str": "eshaper_shovel",
    "shape": "blast",
    "min_duration": { "math": [ "( u_spell_level('eshaper_spawn_tools') * 576000)" ] },
    "max_duration": { "math": [ "( u_spell_level('eshaper_spawn_tools') * 576000)" ] }
  },
  {
    "id": "eshaper_melee_damage",
    "type": "SPELL",
    "name": "Weighting",
    "description": "Fill yourself with the power of Earth, and make each your attacks as devastating as an earthquake.",
    "valid_targets": [ "self" ],
    "effect": "attack",
    "effect_str": "eshaper_melee_damage",
    "shape": "blast",
    "flags": [ "ENHANCEMENT_SPELL", "NO_LEGS", "SILENT", "NO_EXPLOSION_SFX" ],
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "extra_effects": [ { "id": "eoc_enhancement_setup", "hit_self": true } ],
    "difficulty": 6,
    "base_casting_time": 1500,
    "final_casting_time": 500,
    "casting_time_increment": -40,
    "base_energy_cost": 500,
    "final_energy_cost": 200,
    "energy_increment": -12,
    "max_level": 25,
    "min_duration": 14400,
    "max_duration": 360000,
    "duration_increment": 14400
  },
  {
    "id": "eshaper_crystal_wrap",
    "type": "SPELL",
    "name": "Crystal Wrapping",
    "description": "You cover your body with a layer of small, razor-sharp crystals.  It makes monsters that attack you take some damage in return, and gives you some additional cut damage in melee.",
    "valid_targets": [ "self" ],
    "effect": "attack",
    "effect_str": "eshaper_crystal_wrap",
    "shape": "blast",
    "flags": [ "CONJURATION_SPELL", "NO_LEGS", "SILENT", "NO_EXPLOSION_SFX" ],
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ],
    "difficulty": 6,
    "base_casting_time": 1500,
    "final_casting_time": 500,
    "casting_time_increment": -40,
    "base_energy_cost": 500,
    "final_energy_cost": 200,
    "energy_increment": -12,
    "max_level": 25,
    "min_duration": 14400,
    "max_duration": 360000,
    "duration_increment": 14400
  },
  {
    "type": "SPELL",
    "id": "eshaper_crystal_wrap_damage",
    "name": { "str": "Crystal Wrapping Damage", "//~": "NO_I18N" },
    "description": { "str": "Return some damage to attacker.  You can see it only in debug mode.", "//~": "NO_I18N" },
    "effect": "attack",
    "shape": "blast",
    "flags": [ "CONJURATION_SPELL", "SILENT", "RANDOM_DAMAGE", "NO_EXPLOSION_SFX" ],
    "min_damage": 6,
    "max_damage": 13,
    "valid_targets": [ "hostile" ],
    "damage_type": "cut",
    "min_range": 1,
    "max_range": 1
  },
  {
    "id": "shape_of_dust",
    "type": "SPELL",
    "name": "Shape of Dust",
    "description": "Hide yourself within sand-filled winds.  It's harder to hit you, and monsters can't spot you.  Attacking a target will break the spell.",
    "valid_targets": [ "self" ],
    "flags": [ "ENHANCEMENT_SPELL", "SOMATIC", "LOUD" ],
    "effect": "attack",
    "effect_str": "effect_shape_of_dust",
    "components": "spell_components_shape_of_dust",
    "shape": "blast",
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 7,
    "max_level": 25,
    "base_casting_time": 500,
    "base_energy_cost": 350,
    "extra_effects": [ { "id": "eoc_enhancement_setup", "hit_self": true } ],
    "min_duration": 2400,
    "max_duration": 60000,
    "duration_increment": 2400
  },
  {
    "id": "summon_eshaper_golem",
    "type": "SPELL",
    "name": "Summon Earthshaper's Golem",
    "description": "Shape a strong golem out of stone.  It may help for a while, but you haven't enough energy to support it forever.",
    "valid_targets": [ "ground" ],
    "min_damage": 1,
    "max_damage": 1,
    "max_level": 30,
    "difficulty": 6,
    "spell_class": "EARTHSHAPER",
    "effect": "summon",
    "effect_str": "mon_eshaper_golem",
    "shape": "blast",
    "magic_type": "magiclysm_generic_magic",
    "base_energy_cost": 750,
    "final_energy_cost": 400,
    "energy_increment": -12,
    "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ],
    "base_casting_time": 360000,
    "final_casting_time": 180000,
    "casting_time_increment": -6000,
    "min_aoe": 1,
    "max_aoe": 1,
    "flags": [ "CONJURATION_SPELL", "SOMATIC", "VERBAL", "CONCENTRATE" ],
    "min_duration": 12000,
    "max_duration": 360000,
    "duration_increment": 12000
  },
  {
    "id": "earthshaper_boulder",
    "type": "SPELL",
    "name": "Summon Boulder",
    "description": "Pull forth a table of smooth rock from the underground bedrock, using your forces of earthshaping.  You can use it as a table or as a primitive anvil.",
    "valid_targets": [ "ground" ],
    "effect": "ter_transform",
    "effect_str": "earthshaper_boulder",
    "shape": "blast",
    "flags": [ "CONJURATION_SPELL", "SOMATIC", "NO_PROJECTILE" ],
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 3,
    "base_casting_time": 360000,
    "final_casting_time": 120000,
    "casting_time_increment": -24000,
    "base_energy_cost": 500,
    "max_level": 10,
    "min_range": 1,
    "max_range": 1,
    "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ]
  },
  {
    "id": "earthshaper_reveal_world_map",
    "type": "SPELL",
    "name": "Reading the Earthbones",
    "description": "You extend your senses into the ground, becoming aware of every hill and valley within a large area.  It will only work when in contact with the earth.",
    "valid_targets": [ "self" ],
    "flags": [ "CHANNELING_SPELL", "NO_HANDS", "CONCENTRATE", "VERBAL" ],
    "effect": "effect_on_condition",
    "effect_str": "EOC_EARTHSHAPER_MAP",
    "extra_effects": [ { "id": "eoc_channeling_setup", "hit_self": true } ],
    "shape": "blast",
    "max_level": 15,
    "spell_class": "EARTHSHAPER",
    "base_casting_time": 6000,
    "magic_type": "magiclysm_generic_magic",
    "base_energy_cost": 1000,
    "difficulty": 8
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_MAP",
    "condition": { "math": [ "u_val('pos_z') <= 0" ] },
    "effect": {
      "switch": { "math": [ "u_spell_level('earthshaper_reveal_world_map')" ] },
      "cases": [
        {
          "case": 0,
          "effect": [
            { "u_spawn_item": "item_earthshaper_map_01", "suppress_message": true },
            { "run_eocs": "EOC_EARTHSHAPER_MAP_ITEM_01" },
            { "u_remove_item_with": "item_earthshaper_map_01" }
          ]
        },
        {
          "case": 3,
          "effect": [
            { "u_spawn_item": "item_earthshaper_map_02", "suppress_message": true },
            { "run_eocs": "EOC_EARTHSHAPER_MAP_ITEM_02" },
            { "u_remove_item_with": "item_earthshaper_map_02" }
          ]
        },
        {
          "case": 6,
          "effect": [
            { "u_spawn_item": "item_earthshaper_map_03", "suppress_message": true },
            { "run_eocs": "EOC_EARTHSHAPER_MAP_ITEM_03" },
            { "u_remove_item_with": "item_earthshaper_map_03" }
          ]
        },
        {
          "case": 9,
          "effect": [
            { "u_spawn_item": "item_earthshaper_map_04", "suppress_message": true },
            { "run_eocs": "EOC_EARTHSHAPER_MAP_ITEM_04" },
            { "u_remove_item_with": "item_earthshaper_map_04" }
          ]
        },
        {
          "case": 12,
          "effect": [
            { "u_spawn_item": "item_earthshaper_map_05", "suppress_message": true },
            { "run_eocs": "EOC_EARTHSHAPER_MAP_ITEM_05" },
            { "u_remove_item_with": "item_earthshaper_map_05" }
          ]
        },
        {
          "case": 15,
          "effect": [
            { "u_spawn_item": "item_earthshaper_map_06", "suppress_message": true },
            { "run_eocs": "EOC_EARTHSHAPER_MAP_ITEM_06" },
            { "u_remove_item_with": "item_earthshaper_map_06" }
          ]
        }
      ]
    },
    "false_effect": [ { "u_message": "Without a direct connection to the living earth, the spell fails." } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_MAP_ITEM_01",
    "effect": [
      {
        "u_run_inv_eocs": "random",
        "search_data": [ { "id": "item_earthshaper_map_01" } ],
        "true_eocs": [ { "id": "EOC_EARTHSHAPER_MAP_ITEM_01_ACTIVATE", "effect": { "u_activate": "reveal_map" } } ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_MAP_ITEM_02",
    "effect": [
      {
        "u_run_inv_eocs": "random",
        "search_data": [ { "id": "item_earthshaper_map_02" } ],
        "true_eocs": [ { "id": "EOC_EARTHSHAPER_MAP_ITEM_02_ACTIVATE", "effect": { "u_activate": "reveal_map" } } ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_MAP_ITEM_03",
    "effect": [
      {
        "u_run_inv_eocs": "random",
        "search_data": [ { "id": "item_earthshaper_map_03" } ],
        "true_eocs": [ { "id": "EOC_EARTHSHAPER_MAP_ITEM_03_ACTIVATE", "effect": { "u_activate": "reveal_map" } } ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_MAP_ITEM_04",
    "effect": [
      {
        "u_run_inv_eocs": "random",
        "search_data": [ { "id": "item_earthshaper_map_04" } ],
        "true_eocs": [ { "id": "EOC_EARTHSHAPER_MAP_ITEM_04_ACTIVATE", "effect": { "u_activate": "reveal_map" } } ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_MAP_ITEM_05",
    "effect": [
      {
        "u_run_inv_eocs": "random",
        "search_data": [ { "id": "item_earthshaper_map_05" } ],
        "true_eocs": [ { "id": "EOC_EARTHSHAPER_MAP_ITEM_05_ACTIVATE", "effect": { "u_activate": "reveal_map" } } ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_MAP_ITEM_06",
    "effect": [
      {
        "u_run_inv_eocs": "random",
        "search_data": [ { "id": "item_earthshaper_map_06" } ],
        "true_eocs": [ { "id": "EOC_EARTHSHAPER_MAP_ITEM_06_ACTIVATE", "effect": { "u_activate": "reveal_map" } } ]
      }
    ]
  },
  {
    "id": "earthshaper_danger_sense",
    "type": "SPELL",
    "name": "Tremorsense",
    "description": "By sensing their movements upon the earth, you can detect nearby sources of danger.  You must maintain a connection to the earth for the spell to function.",
    "valid_targets": [ "self" ],
    "spell_class": "EARTHSHAPER",
    "flags": [ "CHANNELING_SPELL", "CONCENTRATE", "SOMATIC", "VERBAL", "NO_EXPLOSION_SFX" ],
    "effect": "effect_on_condition",
    "effect_str": "EOC_EARTHSHAPER_DANGERSENSE",
    "extra_effects": [ { "id": "eoc_channeling_setup", "hit_self": true } ],
    "shape": "blast",
    "magic_type": "magiclysm_generic_magic",
    "difficulty": 3,
    "max_level": 10,
    "base_casting_time": 400,
    "base_energy_cost": 350,
    "min_duration": 0,
    "max_duration": 300000,
    "duration_increment": 30000
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_DANGERSENSE",
    "condition": { "math": [ "u_val('pos_z') <= 0" ] },
    "effect": [
      {
        "u_add_effect": "effect_tremorsense",
        "duration": { "math": [ "(u_spell_level('earthshaper_danger_sense') * 300) * channeling_proficiency_modifier()" ] }
      }
    ],
    "false_effect": [ { "u_message": "Without a direct connection to the living earth, the spell fails.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_DANGERSENSE_CHECKER",
    "eoc_type": "EVENT",
    "required_event": "avatar_moves",
    "condition": { "and": [ { "math": [ "u_val('pos_z') >= 1" ] }, { "u_has_effect": "effect_tremorsense" } ] },
    "effect": [
      { "u_lose_effect": "effect_tremorsense" },
      {
        "u_message": "As you break your connection to the living earth, your magical senses fade away.",
        "type": "bad"
      }
    ]
  },
  {
    "id": "earthshaper_fortitude_of_stone",
    "type": "SPELL",
    "name": "Stones' Fortitude",
    "description": "Draw on the eternal endurance of the stones, slowing your metabolism and staving off hunger and thirst.  However, while the enchantment is in effect, you will not heal.",
    "flags": [ "ENHANCEMENT_SPELL", "CONCENTRATE", "SOMATIC", "VERBAL" ],
    "valid_targets": [ "self" ],
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "effect": "attack",
    "effect_str": "earthshaper_fortitude_of_stone",
    "extra_effects": [ { "id": "eoc_enhancement_setup", "hit_self": true } ],
    "shape": "blast",
    "difficulty": 4,
    "base_casting_time": 500,
    "base_energy_cost": 650,
    "max_level": 20,
    "min_duration": 360000,
    "max_duration": 2160000,
    "duration_increment": 100000
  },
  {
    "id": "earthshaper_turning_of_earth",
    "type": "SPELL",
    "name": "The Turning of the Earth",
    "description": "Ask the earth spirits to prepare the earth for growth and planting.",
    "flags": [ "CHANNELING_SPELL", "CONCENTRATE", "SOMATIC", "VERBAL", "LOUD" ],
    "extra_effects": [ { "id": "eoc_channeling_setup", "hit_self": true } ],
    "valid_targets": [ "ground" ],
    "max_level": 12,
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "shape": "line",
    "difficulty": 2,
    "effect": "ter_transform",
    "effect_str": "earthshaper_turning_earth",
    "base_casting_time": 1500,
    "base_energy_cost": 800,
    "final_energy_cost": 350,
    "energy_increment": -37.5,
    "min_range": 3,
    "max_range": 20,
    "range_increment": 1.2
  },
  {
    "id": "earthshaper_granite_aegis",
    "type": "SPELL",
    "name": "Granite Aegis",
    "description": "In an extremity of danger, summon a hollow shell of rock around yourself.  It lasts only a few moments, but sometimes that's all you need.  You must be standing on the living earth to invoke it.",
    "flags": [ "CONJURATION_SPELL", "SOMATIC", "VERBAL" ],
    "valid_targets": [ "self" ],
    "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ],
    "max_level": 10,
    "spell_class": "EARTHSHAPER",
    "magic_type": "magiclysm_generic_magic",
    "shape": "blast",
    "difficulty": 9,
    "effect": "effect_on_condition",
    "effect_str": "EOC_EARTHSHAPER_GRANITE_AEGIS",
    "base_casting_time": 150,
    "final_casting_time": 100,
    "casting_time_increment": -5,
    "base_energy_cost": 750
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_GRANITE_AEGIS",
    "condition": {
      "and": [
        {
          "or": [
            { "u_is_on_terrain": "t_rock_floor_no_roof" },
            { "u_is_on_terrain": "t_rock_floor" },
            { "u_is_on_terrain": "t_dirtfloor_no_roof" },
            { "u_is_on_terrain": "t_clay" },
            { "u_is_on_terrain": "t_claymound" },
            { "u_is_on_terrain": "t_claymound_underground" },
            { "u_is_on_terrain": "t_sandmound" },
            { "u_is_on_terrain": "t_dirtmoundfloor" },
            { "u_is_on_terrain": "t_dirt" },
            { "u_is_on_terrain": "t_dirt_underground" },
            { "u_is_on_terrain": "t_forestfloor" },
            { "u_is_on_terrain": "t_grass" },
            { "u_is_on_terrain": "t_grass_tall" },
            { "u_is_on_terrain": "t_grass_dead" },
            { "u_is_on_terrain": "t_grass_white" },
            { "u_is_on_terrain": "t_forestfloor" },
            { "u_is_on_terrain": "t_moss" },
            { "u_is_on_terrain": "t_soil" },
            { "u_is_on_terrain": "t_dirtmound" },
            { "u_is_on_terrain": "t_region_soil" },
            { "u_is_on_terrain": "t_pit_shallow" },
            { "u_is_on_terrain": "t_pit" },
            { "u_is_on_terrain": "t_puddle_underground" },
            { "u_is_on_terrain": "t_mud" },
            { "u_is_on_terrain": "t_mud_underground" },
            { "u_is_on_terrain": "t_concrete_y" },
            { "u_is_on_terrain": "t_concrete" },
            { "u_is_on_terrain": "t_thconc_y_olight" },
            { "u_is_on_terrain": "t_thconc_warning" },
            { "u_is_on_terrain": "t_thconc_y" },
            { "u_is_on_terrain": "t_thconc_r" },
            { "u_is_on_terrain": "t_thconc_floor" },
            { "u_is_on_terrain": "t_strconc_floor" },
            { "u_is_on_terrain": "t_strconc_floor_olight" },
            { "u_is_on_terrain": "t_strconc_floor_no_roof" },
            { "u_is_on_terrain": "t_railroad_rubble" }
          ]
        },
        { "math": [ "u_val('pos_z') <= 0" ] }
      ]
    },
    "effect": [
      {
        "u_location_variable": { "global_val": "earthshaper_granite_aegis_location" },
        "min_radius": 0,
        "max_radius": 0,
        "outdoor_only": false
      },
      {
        "u_transform_radius": 1,
        "ter_furn_transform": "earthshaper_granite_aegis_to_stone",
        "target_var": { "global_val": "earthshaper_granite_aegis_location" }
      },
      {
        "u_transform_radius": 0,
        "ter_furn_transform": "earthshaper_granite_aegis_to_stone_safe",
        "target_var": { "global_val": "earthshaper_granite_aegis_location" },
        "time_in_future": [ "0 seconds", "0 seconds" ]
      },
      {
        "u_transform_radius": 1,
        "ter_furn_transform": "earthshaper_granite_aegis_from_stone",
        "target_var": { "global_val": "earthshaper_granite_aegis_location" },
        "time_in_future": [ "5 seconds", "20 seconds" ]
      }
    ],
    "false_effect": { "u_message": "Without a connection to the living earth or a flat surface of solid rock, the spell fails." }
  },
  {
    "id": "earthshaper_harden_earth",
    "type": "SPELL",
    "name": "Harden Earth",
    "description": "Compress dirt together so it becomes as hard as rock.  A great way to turn makeshift barricades into a fortress.",
    "valid_targets": [ "hostile", "ally", "ground", "self" ],
    "flags": [ "TRANSFORMATION_SPELL", "SOMATIC", "VERBAL" ],
    "spell_class": "EARTHSHAPER",
    "difficulty": 4,
    "max_level": 20,
    "effect": "ter_transform",
    "effect_str": "ter_earthshaper_harden_earth",
    "extra_effects": [ { "id": "eoc_transformation_setup", "hit_self": true } ],
    "shape": "line",
    "min_range": 2,
    "max_range": 20,
    "range_increment": 1,
    "magic_type": "magiclysm_generic_magic",
    "base_energy_cost": 200,
    "base_casting_time": 1500
  },
  {
    "id": "earthshaper_sleep_in_earth",
    "type": "SPELL",
    "name": "Stone Slumber",
    "description": "When standing on earth or stone, sink into the ground.  While submerged, you will heal faster, sleep will be more restorative, and you will not need to eat or drink.  Cast this spell again to return to the surface.",
    "valid_targets": [ "self" ],
    "flags": [ "ENHANCEMENT_SPELL", "CONCENTRATE", "SOMATIC", "VERBAL" ],
    "spell_class": "EARTHSHAPER",
    "difficulty": 8,
    "max_level": 20,
    "effect": "effect_on_condition",
    "effect_str": "EOC_EARTHSHAPER_SLEEP_IN_EARTH",
    "shape": "blast",
    "magic_type": "magiclysm_generic_magic",
    "extra_effects": [ { "id": "eoc_enhancement_setup", "hit_self": true } ],
    "base_casting_time": { "math": [ "u_has_trait('EARTHSHAPER_STONE_SLEEP') ? 0 : (6000 * (1 / enhancement_proficiency_modifier() ) )" ] },
    "base_energy_cost": { "math": [ "u_has_trait('EARTHSHAPER_STONE_SLEEP') ? 0 : (800 * (1 / enhancement_proficiency_modifier() ) )" ] }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_SLEEP_IN_EARTH",
    "condition": { "not": { "math": [ "u_val('pos_z') == -9" ] } },
    "effect": [
      {
        "run_eocs": {
          "id": "EOC_EARTHSHAPER_SLEEP_IN_EARTH_2",
          "condition": {
            "or": [
              { "u_is_on_terrain": "t_rock_floor_no_roof" },
              { "u_is_on_terrain": "t_rock_floor" },
              { "u_is_on_terrain": "t_rock_smooth" },
              {
                "and": [
                  { "u_is_on_terrain_with_flag": "DIGGABLE" },
                  { "not": { "u_is_on_terrain": "t_grass_alien" } },
                  { "not": { "u_is_on_terrain": "t_vitrified_sand" } },
                  { "not": { "u_is_on_terrain": "t_pit_corpsed" } },
                  { "not": { "u_is_on_terrain": "t_fungus" } },
                  { "not": { "u_is_on_terrain": "t_glassed_sand" } },
                  { "not": { "u_is_on_terrain": "t_rubber_mulch" } },
                  { "not": { "u_is_on_terrain": "t_swater_surf" } },
                  { "not": { "u_is_on_terrain": "t_woodchips" } }
                ]
              }
            ]
          },
          "effect": [
            {
              "u_location_variable": { "u_val": "earthshaper_sleep_in_earth" },
              "min_radius": 0,
              "max_radius": 0,
              "z_adjust": -9,
              "z_override": true
            },
            {
              "u_location_variable": { "u_val": "earthshaper_sleep_in_earth_return" },
              "min_radius": 0,
              "max_radius": 0
            },
            {
              "if": { "map_terrain_id": "t_rock", "loc": { "u_val": "earthshaper_sleep_in_earth" } },
              "then": [
                {
                  "u_message": "As you complete the spell, the earth parts beneath you and you sink down into the stone.",
                  "type": "good"
                },
                { "u_teleport": { "u_val": "earthshaper_sleep_in_earth" }, "force": true },
                { "u_add_trait": "EARTHSHAPER_STONE_SLEEP" }
              ],
              "else": [
                {
                  "u_message": "As you nearly complete the spell, you stop in your tracks.  There's something odd about the ground below you, and sinking into it would be too dangerous.",
                  "type": "mixed"
                },
                { "math": [ "u_val('mana')", "+=", "(800 * (1 / enhancement_proficiency_modifier() ) )" ] }
              ]
            }
          ],
          "false_effect": [ { "u_message": "You must be standing on the living earth to sink into the stone!", "type": "bad" } ]
        }
      }
    ],
    "false_effect": [
      { "u_teleport": { "u_val": "earthshaper_sleep_in_earth_return" } },
      {
        "u_message": "As you recite the words of release, you feel yourself rising until you stand in the clear air once again.",
        "type": "good"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_SLEEP_IN_EARTH_REMOVER",
    "eoc_type": "EVENT",
    "//": "No cheating and translocating out to keep your buffs",
    "required_event": "avatar_moves",
    "condition": { "and": [ { "not": { "math": [ "u_val('pos_z') == -9" ] } }, { "u_has_trait": "EARTHSHAPER_STONE_SLEEP" } ] },
    "effect": [ { "u_lose_trait": "EARTHSHAPER_STONE_SLEEP" } ]
  },
  {
    "id": "earthshaper_repair_metal_stone",
    "type": "SPELL",
    "name": "Fault-Mending Chant",
    "description": "While holding an item made of natural metal or stone, mold it with your hands, work to repairing any flaws and restoring its condition.  Note that some items may still not be repaired.",
    "valid_targets": [ "self" ],
    "spell_class": "EARTHSHAPER",
    "flags": [ "CHANNELING_SPELL", "CONCENTRATE", "VERBAL", "NO_HANDS" ],
    "effect": "effect_on_condition",
    "effect_str": "EOC_EARTHSHAPER_REPAIR_METAL_STONE",
    "components": "spell_components_repair_metal_stone",
    "extra_effects": [ { "id": "eoc_channeling_setup", "hit_self": true } ],
    "shape": "blast",
    "difficulty": 4,
    "max_level": 20,
    "magic_type": "magiclysm_generic_magic",
    "base_energy_cost": 600,
    "base_casting_time": 360000,
    "final_casting_time": 90000,
    "casting_time_increment": -13500
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_REPAIR_METAL_STONE",
    "effect": [
      {
        "u_run_inv_eocs": "manual",
        "search_data": [
          { "wielded_only": true },
          { "material": "stone" },
          { "material": "iron" },
          { "material": "copper" },
          { "material": "silver" },
          { "material": "lead" },
          { "material": "gold" },
          { "material": "tin" },
          { "material": "platinum" }
        ],
        "true_eocs": [
          {
            "id": "EOC_EARTHSHAPER_REPAIR_METAL_STONE_ITEM",
            "condition": { "not": { "npc_has_flag": "NO_REPAIR" } },
            "effect": [
              {
                "math": [
                  "n_hp('ALL')",
                  "+=",
                  "n_hp_max('bp_null') * ( (u_spell_level('earthshaper_repair_metal_stone') * 0.03) + 0.1) * channeling_proficiency_modifier()"
                ]
              }
            ],
            "false_effect": [
              { "u_message": "The magic simply does not take hold.  The item cannot be repaired, even with sorcery.", "type": "bad" }
            ]
          }
        ]
      }
    ]
  },
  {
    "id": "earthshaper_diggable_teleport",
    "type": "SPELL",
    "name": "Earth Gate",
    "description": "While standing on natural earth, sink into it and emerge from any other patch of natural earth within the spell's range.",
    "message": "",
    "valid_targets": [ "self" ],
    "flags": [ "CONVEYANCE_SPELL", "VERBAL", "SOMATIC", "SILENT" ],
    "effect": "effect_on_condition",
    "effect_str": "EOC_EARTHSHAPER_EARTH_GATE_TELEPORT_CHECK",
    "extra_effects": [ { "id": "eoc_conveyance_setup", "hit_self": true } ],
    "shape": "blast",
    "difficulty": 8,
    "spell_class": "EARTHSHAPER",
    "teachable": false,
    "max_level": 20,
    "magic_type": "magiclysm_generic_magic",
    "base_energy_cost": 650,
    "base_casting_time": 250
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_EARTHSHAPER_EARTH_GATE_TELEPORT_CHECK",
    "effect": [
      {
        "if": { "u_is_on_terrain_with_flag": "DIGGABLE" },
        "then": [
          {
            "u_query_tile": "line_of_sight",
            "target_var": { "context_val": "earthshaper_earth_gate_location" },
            "range": { "math": [ "( (u_spell_level('earthshaper_diggable_teleport') * 2) + 3) * conveyance_proficiency_modifier()" ] },
            "z_level": false,
            "message": "Select nearby earth to gate to."
          },
          {
            "if": { "math": [ "has_var(_earthshaper_earth_gate_location)" ] },
            "then": {
              "if": { "map_terrain_with_flag": "DIGGABLE", "loc": { "context_val": "earthshaper_earth_gate_location" } },
              "then": [
                { "u_teleport": { "context_val": "earthshaper_earth_gate_location" }, "force": true },
                { "u_message": "You sink into the earth and re-emerge nearby.", "type": "neutral" }
              ],
              "else": { "u_message": "You must select a patch of earth to transport to." }
            },
            "else": { "u_message": "Canceled" }
          }
        ],
        "else": { "u_message": "You must be on the living earth to use Earth Gate.", "type": "bad" }
      }
    ]
  }
]
