"SUPER_BONUS" {
  name = BUFFS_SUPER_BONUS_NAME
  adjective = BUFFS_SUPER_BONUS_ADJECTIVE
  description = BUFFS_SUPER_BONUS_DESCRIPTION
  addedMessage = ARE SUPER
  removedMessage = ARE NO_LONGER_SUPER
  startEffect = IncreaseAttr DAMAGE 30
  endEffect = IncreaseAttr DAMAGE -30
  tickEffect = Heal {FLESH 0.01}
  combatConsumable = true
  canWishFor = false
  color = ColorId RED
}

"LEADERSHIP" {
  name = BUFFS_LEADERSHIP_NAME
  adjective = BUFFS_LEADERSHIP_ADJECTIVE
  description = BUFFS_LEADERSHIP_DESCRIPTION
  addedMessage = BUFFS_LEADERSHIP_ADDEDMESSAGE BUFFS_LEADERSHIP_ADDEDMESSAGE1 ""
  removedMessage = BUFFS_LEADERSHIP_REMOVEDMESSAGE BUFFS_LEADERSHIP_REMOVEDMESSAGE1 ""
  canWishFor = true
  color = ColorId PURPLE
}

Def ATTR_BUFF(Attr, AttrName, Name, Amount, Adjective, Price) {
  name = Name
  adjective = Adjective
  description = ATTR_BUFF_DESCRIPTION(Amount, AttrName)
  startEffect = IncreaseAttr Attr Amount
  endEffect = IncreaseAttr Attr -Amount
  combatConsumable = true
  fx = BUFF_ORANGE
  color = ColorId ORANGE
  price = Price
}
End

"DAM_BONUS" ATTR_BUFF(DAMAGE, BUFFS_DAM_BONUS_NAME, BUFFS_DAM_BONUS_NAME, 3, BUFFS_DAM_BONUS_ADJECTIVE, 20)
"DEF_BONUS" ATTR_BUFF(DEFENSE, BUFFS_DEF_BONUS_NAME, BUFFS_DEF_BONUS_NAME, 3, BUFFS_DEF_BONUS_ADJECTIVE, 20)

"THICK_SKIN" ATTR_BUFF(DEFENSE, BUFFS_DEF_BONUS_NAME, BUFFS_THICK_SKIN_NAME, 10, BUFFS_THICK_SKIN_ADJECTIVE, 200)
"IRON_ARMS" ATTR_BUFF(DAMAGE, BUFFS_DAM_BONUS_NAME, BUFFS_IRON_ARMS_NAME, 10, BUFFS_IRON_ARMS_ADJECTIVE, 200)
"STABLE_HAND" ATTR_BUFF(RANGED_DAMAGE, BUFFS_STABLE_HAND_DESCRIPTION, BUFFS_STABLE_HAND_NAME, 10, BUFFS_STABLE_HAND_ADJECTIVE, 200)
"PIERCING_VOICE" ATTR_BUFF(SPELL_DAMAGE, BUFFS_PIERCING_VOICE_DESCRIPTION, BUFFS_PIERCING_VOICE_NAME, 10, BUFFS_PIERCING_VOICE_ADJECTIVE, 200)

"DIVINE_PROTECTION" ATTR_BUFF(DEFENSE, BUFFS_DEF_BONUS_NAME, BUFFS_DIVINE_PROTECTION_NAME, 5, BUFFS_DIVINE_PROTECTION_ADJECTIVE, 400)
"DIVINE_STRENGTH" ATTR_BUFF(DAMAGE, BUFFS_DAM_BONUS_NAME, BUFFS_DIVINE_STRENGTH_NAME, 5, BUFFS_DIVINE_STRENGTH_ADJECTIVE, 400)
"DIVINE_DIGGING" ATTR_BUFF(DIGGING, BUFFS_DIVINE_DIGGING_DESCRIPTION, BUFFS_DIVINE_DIGGING_NAME, 15, BUFFS_DIVINE_DIGGING_ADJECTIVE, 200)

Def ATTR_DEBUFF(Attr, Name, Amount, Price) {
  name = ATTR_DEBUFF_NAME(Name)
  adjective = ATTR_DEBUFF_NAME(Name)
  description = ATTR_DEBUFF_DESCRIPTION(Amount, Name)
  startEffect = IncreaseAttr Attr -Amount
  endEffect = IncreaseAttr Attr Amount
  combatConsumable = true
  consideredBad = true
  fx = DEBUFF_RED
  color = ColorId RED
  price = Price
}
End

"DEF_DEBUFF" ATTR_DEBUFF(DEFENSE, BUFFS_DEF_DEBUFF_NAME, 3, 20)

"HIGH_MORALE" {
  name = BUFFS_HIGH_MORALE_NAME
  adjective = BUFFS_HIGH_MORALE_ADJECTIVE
  description = BUFFS_HIGH_MORALE_DESCRIPTION
  addedMessage = BUFFS_HIGH_MORALE_ADDEDMESSAGE BUFFS_HIGH_MORALE_ADDEDMESSAGE2 ""
  removedMessage = BUFFS_HIGH_MORALE_REMOVEDMESSAGE BUFFS_HIGH_MORALE_REMOVEDMESSAGE2 ""
  efficiencyMultiplier = 1.3
  fx = BUFF_BLUE
  color = ColorId BLUE
  price = 10
}

"REGENERATION" {
  name = BUFFS_REGENERATION_NAME
  description = BUFFS_REGENERATION_DESCRIPTION
  addedMessage = BUFFS_REGENERATION_ADDEDMESSAGE BUFFS_REGENERATION_ADDEDMESSAGE2 ""
  removedMessage = BUFFS_REGENERATION_REMOVEDMESSAGE BUFFS_REGENERATION_REMOVEDMESSAGE2 ""
  adjective = BUFFS_REGENERATION_ADJECTIVE
  tickEffect = Filter Not LastingEffect FROZEN Heal { FLESH 0.03 }
  combatConsumable = true
  price = 12
  fx = BUFF_RED
  color = ColorId RED
}

"BLEEDING" {
  name = BUFFS_BLEEDING_NAME
  description = BUFFS_BLEEDING_DESCRIPTION
  addedMessage = YOU_START_BLEEDING STARTS_BLEEDING ""
  removedMessage = YOU_STOP_BLEEDING STOPS_BLEEDING ""
  adjective = BUFFS_BLEEDING_ADJECTIVE
  tickEffect = Filter Not LastingEffect FROZEN {
    CreatureMessage { BUFFS_BLEEDING_SECONDPERSON BUFFS_BLEEDING_THIRDPERSON HIGH }
    Bleed 0.03 BUFFS_BLEEDING_NAME
  }
  consideredBad = true
  canAbsorb = false
  price = 2
  fx = DEBUFF_RED
  color = ColorId RED
}

"INFERNITE_EFFECT" {
  name = BUFFS_INFERNITE_EFFECT_NAME
  description = BUFFS_INFERNITE_EFFECT_DESCRIPTION
  addedMessage = BUFFS_INFERNITE_EFFECT_SECONDPERSON BUFFS_INFERNITE_EFFECT_THIRDPERSON ""
  removedMessage = BUFFS_INFERNITE_EFFECT_REMOVEDMESSAGE BUFFS_INFERNITE_EFFECT_REMOVEDMESSAGE1 ""
  adjective = BUFFS_INFERNITE_EFFECT_ADJECTIVE
  tickEffect = Filter And { Not LastingEffect FIRE_RESISTANT Not LastingEffect FIRE_IMMUNITY } {
    CreatureMessage {BUFFS_INFERNITE_EFFECT_SECONDPERSON BUFFS_INFERNITE_EFFECT_THIRDPERSON}
    Bleed 0.01 BUFFS_INFERNITE_EFFECT_THIRDPERSON1
  }
  hiddenPredicate = Or { LastingEffect FIRE_RESISTANT LastingEffect FIRE_IMMUNITY }
  consideredBad = true
  canAbsorb = false
  price = 2
  fx = DEBUFF_RED
  color = ColorId RED
}

"SPELL_DAMAGE" {
  name = BUFFS_SPELL_DAMAGE_NAME
  adjective = BUFFS_SPELL_DAMAGE_ADJECTIVE
  description = BUFFS_SPELL_DAMAGE_DESCRIPTION
  addedMessage = BUFFS_SPELL_DAMAGE_ADDEDMESSAGE BUFFS_SPELL_DAMAGE_ADDEDMESSAGE1 ""
  removedMessage = BUFFS_SPELL_DAMAGE_REMOVEDMESSAGE BUFFS_SPELL_DAMAGE_REMOVEDMESSAGE1 ""
  fx = BUFF_PURPLE
  color = ColorId PURPLE
  price = 50
  modifyDamageAttr = DAMAGE SPELL_DAMAGE
}

"FIRE_DAMAGE" {
  name = BUFFS_FIRE_DAMAGE_NAME
  adjective = BUFFS_FIRE_DAMAGE_ADJECTIVE
  description = BUFFS_FIRE_DAMAGE_DESCRIPTION
  addedMessage = BUFFS_FIRE_DAMAGE_ADDEDMESSAGE BUFFS_FIRE_DAMAGE_ADDEDMESSAGE1 ""
  removedMessage = BUFFS_FIRE_DAMAGE_REMOVEDMESSAGE BUFFS_FIRE_DAMAGE_REMOVEDMESSAGE1 ""
  fx = BUFF_RED
  color = ColorId RED
  price = 50
  modifyDamageAttr = DAMAGE FIRE_DAMAGE
}

"KINGS_CHARGE" {
  name = BUFFS_KINGS_CHARGE_NAME
  adjective = BUFFS_KINGS_CHARGE_ADJECTIVE
  description = BUFFS_KINGS_CHARGE_DESCRIPTION
  addedMessage = BUFFS_KINGS_CHARGE_ADDEDMESSAGE BUFFS_KINGS_CHARGE_ADDEDMESSAGE1 ""
  removedMessage = BUFFS_KINGS_CHARGE_REMOVEDMESSAGE BUFFS_KINGS_CHARGE_REMOVEDMESSAGE1 ""
  startEffect = IncreaseAttr DAMAGE 15
  endEffect = IncreaseAttr DAMAGE -15
  combatConsumable = true
  fx = BUFF_PINK
  color = ColorId PINK
  price = 200
}


Def SKILL(Name, Adjective, Description) {
  name = Name
  adjective = Adjective
  addedMessage = YOU_ACQUIRE_THE_SKILL_OF ACQUIRES_THE_SKILL_OF Name
  removedMessage = YOU_LOSE_THE_SKILL_OF LOSES_THE_SKILL_OF Name
  description = Description
  color = ColorId YELLOW
  fx = BUFF_YELLOW
}
End

"AMBUSH_SKILL" SKILL(BUFFS_AMBUSH_SKILL_NAME, BUFFS_AMBUSH_SKILL_ADJECTIVE, BUFFS_AMBUSH_SKILL_DESCRIPTION)
"SWIMMING_SKILL" SKILL(BUFFS_SWIMMING_SKILL_NAME, BUFFS_SWIMMING_SKILL_ADJECTIVE, BUFFS_SWIMMING_SKILL_DESCRIPTION)
"DISARM_TRAPS_SKILL" SKILL(BUFFS_DISARM_TRAPS_SKILL_NAME, BUFFS_DISARM_TRAPS_SKILL_ADJECTIVE, BUFFS_DISARM_TRAPS_SKILL_DESCRIPTION)
"CONSUMPTION_SKILL" SKILL(BUFFS_CONSUMPTION_SKILL_NAME, BUFFS_CONSUMPTION_SKILL_ADJECTIVE, BUFFS_CONSUMPTION_SKILL_DESCRIPTION)
"COPULATION_SKILL" SKILL(BUFFS_COPULATION_SKILL_NAME, BUFFS_COPULATION_SKILL_ADJECTIVE, BUFFS_COPULATION_SKILL_DESCRIPTION)
"CROPS_SKILL" SKILL(BUFFS_CROPS_SKILL_NAME, BUFFS_CROPS_SKILL_ADJECTIVE, BUFFS_CROPS_SKILL_DESCRIPTION)
"SPIDER_SKILL" SKILL(BUFFS_SPIDER_SKILL_NAME, BUFFS_SPIDER_SKILL_ADJECTIVE, BUFFS_SPIDER_SKILL_DESCRIPTION)
"EXPLORE_SKILL" SKILL(BUFFS_EXPLORE_SKILL_NAME, BUFFS_EXPLORE_SKILL_ADJECTIVE, BUFFS_EXPLORE_SKILL_DESCRIPTION)
"EXPLORE_NOCTURNAL_SKILL" SKILL(BUFFS_EXPLORE_NOCTURNAL_SKILL_NAME, BUFFS_EXPLORE_NOCTURNAL_SKILL_ADJECTIVE, BUFFS_EXPLORE_NOCTURNAL_SKILL_DESCRIPTION)
"EXPLORE_CAVES_SKILL" SKILL(BUFFS_EXPLORE_CAVES_SKILL_NAME, BUFFS_EXPLORE_CAVES_SKILL_ADJECTIVE, BUFFS_EXPLORE_CAVES_SKILL_DESCRIPTION)
"BRIDGE_BUILDING_SKILL" SKILL(BUFFS_BRIDGE_BUILDING_SKILL_NAME, BUFFS_BRIDGE_BUILDING_SKILL_ADJECTIVE, BUFFS_BRIDGE_BUILDING_SKILL_DESCRIPTION)
"DISTILLATION_SKILL" SKILL(BUFFS_DISTILLATION_SKILL_NAME, BUFFS_DISTILLATION_SKILL_ADJECTIVE, BUFFS_DISTILLATION_SKILL_DESCRIPTION)
"PREACHING_SKILL" SKILL(BUFFS_PREACHING_SKILL_NAME, BUFFS_PREACHING_SKILL_ADJECTIVE, BUFFS_PREACHING_SKILL_DESCRIPTION)
"CONFESSING_SKILL" SKILL(BUFFS_CONFESSING_SKILL_NAME, BUFFS_CONFESSING_SKILL_ADJECTIVE, BUFFS_CONFESSING_SKILL_DESCRIPTION)

"SWIMMING_SKILL" modify {
  inheritsFromSteed = true
}

"CONSUMPTION_SKILL" modify {
  canAbsorb = false
}

"COPULATION_SKILL" modify {
  canAbsorb = false
}

"CROPS_SKILL" modify {
  canAbsorb = false
}

Def HATE(Name) {
  name = HATE_OF(Name)
  adjective = HATES_ALL(Name)
  description = HATE_DEBUFF_DESCRIPTION(Name)
  addedMessage = ARE FULL_OF_HATRED
  removedMessage = YOUR_HATRED_IS_GONE HIS_HATRED_IS_GONE ""
  hatedGroupName = Name
  color = ColorId PINK
  fx = BUFF_PINK
}
End

"HATE_DWARVES" HATE(BUFFS_HATE_DWARVES_NAME)
"HATE_HUMANS" HATE(BUFFS_HATE_HUMANS_NAME)
"HATE_GREENSKINS" HATE(BUFFS_HATE_GREENSKINS_NAME)
"HATE_ELVES" HATE(BUFFS_HATE_ELVES_NAME)
"HATE_UNDEAD" HATE(BUFFS_HATE_UNDEAD_NAME)
"HATE_DRAGONS" HATE(BUFFS_HATE_DRAGONS_NAME)
"HATE_DEMONS" HATE(BUFFS_HATE_DEMONS_NAME)
"HATE_LIZARDMEN" HATE(BUFFS_HATE_LIZARDMEN_NAME)

"INVULNERABLE" {
  name = BUFFS_INVULNERABLE_NAME
  adjective = BUFFS_INVULNERABLE_ADJECTIVE
  description = BUFFS_INVULNERABLE_DESCRIPTION
  addedMessage = ARE BUFFS_INVULNERABLE_ADDEDMESSAGE
  removedMessage = ARE BUFFS_INVULNERABLE_REMOVEDMESSAGE
  color = ColorId WHITE
  fx = BUFF_WHITE
  defenseMultiplier = 1000
  combatConsumable = true
  canAbsorb = false
  canWishFor = false
}

Def RESISTANCE(Name, Attr)
{
  name = RESISTANCE_BUFF_NAME(Name)
  adjective = RESISTANT_TO(Name)
  description = RESISTANCE_BUFF_DESCRIPTION(Name)
  addedMessage = ARE RESISTANT_TO(Name)
  removedMessage = ARE_NO_LONGER RESISTANT_TO(Name)
  color = ColorId SKY_BLUE
  fx = BUFF_SKY_BLUE
  defenseMultiplier = 1.3
  defenseMultiplierAttr = Attr
  combatConsumable = true
}
End

"FIRE_RESISTANT" RESISTANCE(BUFFS_FIRE_RESISTANT_NAME, FIRE_DAMAGE)
"COLD_RESISTANT" RESISTANCE(BUFFS_COLD_RESISTANT_NAME, COLD_DAMAGE)
"ACID_RESISTANT" RESISTANCE(BUFFS_ACID_RESISTANT_NAME, ACID_DAMAGE)
"MELEE_RESISTANCE" RESISTANCE(BUFFS_MELEE_RESISTANCE_NAME, DAMAGE)
"MAGIC_RESISTANCE" RESISTANCE(BUFFS_MAGIC_RESISTANCE_NAME, SPELL_DAMAGE)
"RANGED_RESISTANCE" RESISTANCE(BUFFS_RANGED_RESISTANCE_NAME, RANGED_DAMAGE)

Def VULNERABILITY(Name, Attr)
{
  name = VULNERABILITY_BUFF_NAME(Name)
  adjective = VULNERABLE_TO(Name)
  description = VULNERABILITY_BUFF_DESCRIPTION(Name)
  addedMessage = ARE VULNERABLE_TO(Name)
  removedMessage = ARE_NO_LONGER VULNERABLE_TO(Name)
  color = ColorId BROWN
  fx = DEBUFF_BROWN
  defenseMultiplier = 0.77
  defenseMultiplierAttr = Attr
  consideredBad = true
}
End

"FIRE_VULNERABILITY" VULNERABILITY(BUFFS_FIRE_RESISTANT_NAME, FIRE_DAMAGE)
"COLD_VULNERABILITY" VULNERABILITY(BUFFS_COLD_RESISTANT_NAME, COLD_DAMAGE)
"ACID_VULNERABILITY" VULNERABILITY(BUFFS_ACID_RESISTANT_NAME, ACID_DAMAGE)
"MELEE_VULNERABILITY" VULNERABILITY(BUFFS_MELEE_RESISTANCE_NAME, DAMAGE)
"MAGIC_VULNERABILITY" VULNERABILITY(BUFFS_MAGIC_RESISTANCE_NAME, SPELL_DAMAGE)
"RANGED_VULNERABILITY" VULNERABILITY(BUFFS_RANGED_RESISTANCE_NAME, RANGED_DAMAGE)

Def IMMUNITY(Name, Attr)
{
  name = IMMUNITY_BUFF_NAME(Name)
  adjective = IMMUNE_TO(Name)
  description = IMMUNITY_BUFF_DESCRIPTION(Name)
  addedMessage = ARE IMMUNE_TO(Name)
  removedMessage = ARE_NO_LONGER IMMUNE_TO(Name)
  color = ColorId WHITE
  fx = BUFF_WHITE
  defenseMultiplier = 1000
  price = 200
  defenseMultiplierAttr = Attr
  combatConsumable = true
  canAbsorb = false
  canWishFor = false
}
End

"FIRE_IMMUNITY" IMMUNITY(BUFFS_FIRE_RESISTANT_NAME, FIRE_DAMAGE)
"COLD_IMMUNITY" IMMUNITY(BUFFS_COLD_RESISTANT_NAME, COLD_DAMAGE)
"ACID_IMMUNITY" IMMUNITY(BUFFS_ACID_RESISTANT_NAME, ACID_DAMAGE)
"MELEE_IMMUNITY" IMMUNITY(BUFFS_MELEE_RESISTANCE_NAME, DAMAGE)
"MAGIC_IMMUNITY" IMMUNITY(BUFFS_MAGIC_RESISTANCE_NAME, SPELL_DAMAGE)
"RANGED_IMMUNITY" IMMUNITY(BUFFS_RANGED_RESISTANCE_NAME, RANGED_DAMAGE)

Def SPECIAL_RESISTANCE(Name, Predicate, Value)
{
  name = PROTECTION_FROM(Name)
  adjective = PROTECTED_FROM(Name)
  description = DEFENSE_BONUS_AGAINST(Value, Name)
  addedMessage = ARE PROTECTED_FROM(Name)
  removedMessage = ARE_NO_LONGER PROTECTED_FROM(Name)
  color = ColorId PURPLE
  fx = BUFF_PURPLE
  price = 200
  specialAttr = "DEFENSE" Value Predicate
}
End

"DRAGON_RESISTANCE" SPECIAL_RESISTANCE(BUFFS_DRAGON_RESISTANCE_NAME, HatedBy HATE_DRAGONS, 15)
"DEMON_RESISTANCE" SPECIAL_RESISTANCE(BUFFS_DEMON_RESISTANCE_NAME, HatedBy HATE_DRAGONS, 15)
"UNDEAD_RESISTANCE" SPECIAL_RESISTANCE(BUFFS_UNDEAD_RESISTANCE_NAME, HatedBy HATE_UNDEAD, 15)
"LIZARDMEN_RESISTANCE" SPECIAL_RESISTANCE(BUFFS_LIZARDMEN_RESISTANCE_NAME, HatedBy HATE_LIZARDMEN, 15)
"ELF_RESISTANCE" SPECIAL_RESISTANCE(BUFFS_ELF_RESISTANCE_NAME, HatedBy HATE_ELVES, 15)
"GREENSKIN_RESISTANCE" SPECIAL_RESISTANCE(BUFFS_GREENSKIN_RESISTANCE_NAME, HatedBy HATE_GREENSKINS, 15)

Def MassMessage(Text)
  UI "unlock_message" { "message" Label Text "view_id" ViewIdList {{"rostrum_gold"}}}
End

Def DIVINE_SPELL(EFFECT_NAME1, EFFECT_NAME2, EFFECT_NAME3, MESSAGE) {
  Area 15 {
    Filter Or { FurnitureType PEW_WOOD FurnitureType ROSTRUM_WOOD} EFFECT_NAME1
    Filter Or { FurnitureType PEW_IRON FurnitureType ROSTRUM_IRON} EFFECT_NAME2
    Filter Or { FurnitureType PEW_GOLD FurnitureType ROSTRUM_GOLD} EFFECT_NAME3
  }
  MassMessage(MESSAGE)
}
End

Def DIVINE_SPELL(EFFECT_NAME, MESSAGE)
  DIVINE_SPELL(EFFECT_NAME, EFFECT_NAME, EFFECT_NAME, MESSAGE)
End

Def DIVINE_EFFECT(LENGTH1, LENGTH2, LENGTH3, EFFECT_NAME, MESSAGE)
  DIVINE_SPELL(Lasting LENGTH1 EFFECT_NAME, Lasting LENGTH2 EFFECT_NAME, Lasting LENGTH2 EFFECT_NAME, MESSAGE)
End

"PREACHING" {
  name = BUFFS_PREACHING_NAME
  adjective = BUFFS_PREACHING_ADJECTIVE
  description = ""
  color = ColorId PURPLE
  endEffect = Filter Or { FurnitureType "ROSTRUM_WOOD" FurnitureType "ROSTRUM_IRON" FurnitureType "ROSTRUM_GOLD" } {
    SetMinionActivity IDLE
    FirstSuccessful {
      Filter EquipedIngredient "protection_prayer" DIVINE_EFFECT(400, 600, 800, "DIVINE_PROTECTION",
          BUFFS_PREACHING_ENDEFFECT)
      Filter EquipedIngredient "strength_prayer" DIVINE_EFFECT(400, 600, 800, "DIVINE_STRENGTH",
          BUFFS_PREACHING_ID5)
      Filter EquipedIngredient "digging_prayer" DIVINE_EFFECT(1200, 1600, 2000, "DIVINE_DIGGING",
          BUFFS_PREACHING_ID6)
      Filter EquipedIngredient "training_prayer" DIVINE_EFFECT(1200, 1600, 2000, FAST_TRAINING,
          BUFFS_PREACHING_ID7)
      Filter EquipedIngredient "crafting_prayer" DIVINE_EFFECT(1200, 1600, 2000, FAST_CRAFTING,
          BUFFS_PREACHING_ID8)
      Filter EquipedIngredient "ranged_resistance_prayer" DIVINE_EFFECT(400, 600, 800, "RANGED_RESISTANCE",
          BUFFS_PREACHING_ID9)
      Filter EquipedIngredient "regeneration_prayer" DIVINE_EFFECT(400, 600, 800, "REGENERATION",
          BUFFS_PREACHING_ID10)
      Filter EquipedIngredient "fire_resistance_prayer" DIVINE_EFFECT(400, 600, 800, "FIRE_RESISTANT",
          BUFFS_PREACHING_ID11)
      Filter EquipedIngredient "poison_resistance_prayer" DIVINE_EFFECT(400, 600, 800, POISON_RESISTANT,
          BUFFS_PREACHING_ID12)
      Filter EquipedIngredient "dragon_resistance_prayer" DIVINE_EFFECT(400, 600, 800, "DRAGON_RESISTANCE",
          BUFFS_PREACHING_ID13)
      Filter EquipedIngredient "demon_resistance_prayer" DIVINE_EFFECT(400, 600, 800, "DEMON_RESISTANCE",
          BUFFS_PREACHING_ID14)
      Filter EquipedIngredient "undead_resistance_prayer" DIVINE_EFFECT(400, 600, 800, "UNDEAD_RESISTANCE",
          BUFFS_PREACHING_ID15)
      Filter EquipedIngredient "lizardmen_resistance_prayer" DIVINE_EFFECT(400, 600, 800, "LIZARDMEN_RESISTANCE",
          BUFFS_PREACHING_ID16)
      Filter EquipedIngredient "elf_resistance_prayer" DIVINE_EFFECT(400, 600, 800, "ELF_RESISTANCE",
          BUFFS_PREACHING_ID17)
      Filter EquipedIngredient "greenskin_resistance_prayer" DIVINE_EFFECT(400, 600, 800, "GREENSKIN_RESISTANCE",
          BUFFS_PREACHING_ID18)
      Filter EquipedIngredient "melee_prayer" DIVINE_SPELL(IncreaseMaxLevel "DAMAGE" 1,
          BUFFS_PREACHING_ID19)
      Filter EquipedIngredient "divinity_prayer" DIVINE_SPELL(IncreaseMaxLevel "DIVINITY" 1,
          BUFFS_PREACHING_ID20)
      Filter EquipedIngredient "guardian_prayer" DIVINE_SPELL(
          Filter CreatureStatus FIGHTER Summon "ANGEL" 1 400,
          Filter CreatureStatus FIGHTER Summon "ANGEL" 1 600,
          Filter CreatureStatus FIGHTER Summon "ANGEL" 1 800,
          BUFFS_PREACHING_ID21)
      Filter EquipedIngredient "teuton_prayer" {
        SummonAway "TEMPLAR" 1 1600  {FIGHTER NO_LIMIT}
        DIVINE_SPELL(
            Chance 0.3 SummonAway "TEMPLAR" 1 1000 {FIGHTER NO_LIMIT},
            Chance 0.4 SummonAway "TEMPLAR" 1 1300 {FIGHTER NO_LIMIT},
            Chance 0.5 SummonAway "TEMPLAR" 1 1600 {FIGHTER NO_LIMIT},
            BUFFS_PREACHING_ID22)
      }
      Filter EquipedIngredient "squire_prayer" {
        Filter CreatureId "KEEPER_BISHOP" {
          SummonAway "WARRIOR_NUN" 1 1600 {FIGHTER NO_LIMIT}
          DIVINE_SPELL(
              Chance 0.3 SummonAway "WARRIOR_NUN" 1 1000 {FIGHTER NO_LIMIT},
              Chance 0.4 SummonAway "WARRIOR_NUN" 1 1300 {FIGHTER NO_LIMIT},
              Chance 0.5 SummonAway "WARRIOR_NUN" 1 1600 {FIGHTER NO_LIMIT},
              BUFFS_PREACHING_ID23)
        }
        Filter CreatureId "MOTHER_SUPERIOR" {
          SummonAway "ARMED_BROTHER" 1 1600 {FIGHTER NO_LIMIT}
          DIVINE_SPELL(
              Chance 0.3 SummonAway "ARMED_BROTHER" 1 1000 {FIGHTER NO_LIMIT},
              Chance 0.4 SummonAway "ARMED_BROTHER" 1 1300 {FIGHTER NO_LIMIT},
              Chance 0.5 SummonAway "ARMED_BROTHER" 1 1600 {FIGHTER NO_LIMIT},
              BUFFS_PREACHING_ID23)
        }
      }
      Filter EquipedIngredient "workers_prayer" {
        SummonAway "PESEANT_PLAYER" 2  1500 {WORKER NO_LIMIT NO_EQUIPMENT}
        DIVINE_SPELL(
            Chance 0.3 SummonAway "PESEANT_PLAYER" 1 1000 {WORKER NO_LIMIT NO_EQUIPMENT},
            Chance 0.4 SummonAway "PESEANT_PLAYER" 1 1300 {WORKER NO_LIMIT NO_EQUIPMENT},
            Chance 0.5 SummonAway "PESEANT_PLAYER" 1 1600 {WORKER NO_LIMIT NO_EQUIPMENT},
            BUFFS_PREACHING_ID24)
      }
      Filter And { Flag "adoxie_dead" EquipedIngredient "adoxie_prayer" } {
        MassMessage(BUFFS_PREACHING_ID)
      }
      Filter And { Not Flag "adoxie_dead" EquipedIngredient "adoxie_prayer" } {
        Achievement "black_mass"
        Filter CreatureId "KEEPER_BISHOP" SetViewId {"bishop5"}
        Filter CreatureId "MOTHER_SUPERIOR" SetViewId {"mother_superior5"}
        FirstSuccessful {
          ChainUntilFail {
            Area 20 Filter And { Enemy Not CreatureStatus CIVILIAN } {
              Polymorph "CHICKEN" 500
              PlayerMessage CRITICAL BUFFS_PREACHING_ID4
              Filter IsPlayer Achievement "polymorphed_into_chicken"
            }
            MassMessage(BUFFS_PREACHING_ID1)
          }
          ChainUntilFail {
            ChooseRandomUntilSuccessful {
Def TRY_DEMON(NAME)
  Filter Not Flag NAME + "_summon" {
    CircularBlast
    Summon NAME 1 none
    SetFlag NAME + "_summon" true
  }
End
              TRY_DEMON("TENGU")
              TRY_DEMON("SHAITAN")
              TRY_DEMON("BANSHEE")
              TRY_DEMON("VETALA")
              TRY_DEMON("LEYAK")
              TRY_DEMON("BAKU")
              TRY_DEMON("RAKSHASA")
              TRY_DEMON("GHOUL")
              TRY_DEMON("SUANGGI")
            }
            MassMessage(BUFFS_PREACHING_ID2)
          }
          {
            Summon "ADOXIE_FOOT_LEFT" 1 200
            Summon "ADOXIE_FOOT_RIGHT" 1 200
            Summon "ADOXIE_LEFT_HAND" 1 200
            Summon "ADOXIE_HAND_RIGHT" 1 200
            MassMessage(BUFFS_PREACHING_ID3)
          }
        }
      }
    }
  }
}

"SINNED" {
  name = BUFFS_SINNED_NAME
  adjective = BUFFS_SINNED_ADJECTIVE
  description = BUFFS_SINNED_DESCRIPTION
  color = ColorId BROWN
  fx = DEBUFF_BROWN
  consideredBad = true
}

"MORTAL_SINNED" {
  name = BUFFS_MORTAL_SINNED_NAME
  adjective = BUFFS_MORTAL_SINNED_ADJECTIVE
  description = BUFFS_MORTAL_SINNED_DESCRIPTION
  color = ColorId BLACK
  fx = DEBUFF_BLACK
  consideredBad = true
}

"WILL_BANISH" {
  name = BUFFS_WILL_BANISH_NAME
  adjective = BUFFS_WILL_BANISH_ADJECTIVE
  description = BUFFS_WILL_BANISH_DESCRIPTION
  color = ColorId WHITE
  fx = BUFF_WHITE
  endEffect = Banish
}

"WELL_FED" {
  name = BUFFS_WELL_FED_NAME
  adjective = BUFFS_WELL_FED_ADJECTIVE
  description = BUFFS_WELL_FED_DESCRIPTION
  color = ColorId BROWN
  fx = BUFF_BROWN
  startEffect = {
    IncreaseAttr SPELL_DAMAGE 1
    IncreaseAttr DEFENSE 1
  }
  endEffect = {
    IncreaseAttr SPELL_DAMAGE -1
    IncreaseAttr DEFENSE -1
  }
  stacks = true
}
