 # Damage Spells

```SL = Highest Spell Level from all joined guilds that can cast the spell, range 1-255
Base = X in SpellName(X/Y) ie Firebolt(10/1)
Power = Y in SpellName(X/Y)
Resistance = Monster Resistance to Spell Damage-Type
```
```Minimum = (Base + (Base * LN(SL) / 1.61) + Int(SL * (Power-1) / 10)) / 2
Base Damage = Minimum + Random(1 to Minimum)
Final Damage = Base Damage * (1 - Resistance/100)
(Simplified Formula, slightly inaccurate for very low SL)
```

For Kill Spells, if damage is less than monster HP, then damage becomes 0

# Healing Spells

```SL = Spell Level of current Guild, not from highest Guild that can cast the spell.
```
```Minimum = (Base + (Base * LN(SL) / 2,3) + Int(SL * (Power-1) / 10)) / 2
Healing = Minimum + Random(1 to Minimum)
(Simplified Formula, slightly inaccurate for very low SL)
```

# Protection Spells

For Protection gained through items:

```SL = Spell Level from current Guild
Added Defense = 3 * LN(SL)^2
```

For Protection gained through Guild Spells:

```SL = Highest Spell Level from all joined guilds that can cast the spell
Added Defense = 3 * LN(Int(SL / 2) + 1)^2
```

Buggy, Nudibranch explains in this post.

Now comparing damage spell formula to values found in this thread

```          FB      BF       CB       AS
SL  15   25/26   53/ 54   39/40    92/ 95
SL  65   35/35  117/118   59/59   170/172
SL 115   38/38  172/173   66/69   230/232
SL 255   43/43  313/320   89/90   386/387  <--- Max SL
```

FB = Firebolt(10/1)
BF = Blue Flame(15/11)
CB = Cold Blast(15/2)
AS = Acidic Spray(30/11)
X/Y: X is observed Max Damage, Y is calculated Max Damage

Real Spell Damage Formula:

```Modifier1 = Base + (Base * LN(SL + 1) / LN(5)) + Int((SL / 10) * (Power-1))
Modifier2 = Int(Rnd * (Modifier1 - ((SL - 1) / SL^2)) / 2) + 1
Damage = Int(Modifier1 - Modifier2)
Damage = Damage * (1 - Resistance/100)
```

Real Healing Formula:

```Modifier1 = Base + (Base * LN(SL) / LN(10)) + Int((SL / 10) * (Power-1))
Modifier2 = Int(Rnd * (Modifier1 - ((SL - 1) / SL^2)) / 2) + 1
Healing = Int(Modifier1 - Modifier2)
```