Research:Magic: Difference between revisions

From OpenMW Wiki
Jump to navigation Jump to search
(Added magic effect data.)
No edit summary
Line 6: Line 6:
|On cast attempt
|On cast attempt
|
|
|
|{{StatusCol|red|not started yet}}
|{{StatusCol|orange|Accurate, but requires more work; spell skill depends on dominant school for multi effect spells, but is unspecified; Sound spell effect is not accounted for}}}}
|{{StatusCol|orange|Accurate, but requires more work; spell skill depends on dominant school for multi effect spells, but is unspecified; Sound spell effect is not accounted for}}}}
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 17: Line 17:
|On cast attempt
|On cast attempt
|
|
|
|{{StatusCol|red|not started yet}}
|{{StatusCol|red|Does not account for multiple effect spells, non-duration spells or fixed magnitude spells}}}}
|{{StatusCol|red|Does not account for multiple effect spells, non-duration spells or fixed magnitude spells}}}}
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 43: Line 43:
|On magic hit
|On magic hit
|
|
|
|{{StatusCol|red|not started yet}}
|{{StatusCol|red|Ignores willpower resists; which effects magic resistance apply to; reflection and absorption}}}}
|{{StatusCol|red|Ignores willpower resists; which effects magic resistance apply to; reflection and absorption}}}}
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 56: Line 56:
|On enchanted item use
|On enchanted item use
|Charge consumed on use depends on skill.
|Charge consumed on use depends on skill.
|
|{{StatusCol|red|not started yet}}
|{{StatusCol|green|Verified; but a poorly scaling mechanic}}}}
|{{StatusCol|green|Verified; but a poorly scaling mechanic}}}}
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 70: Line 70:
|On game tick
|On game tick
|Enchanted items may gain charge over time.
|Enchanted items may gain charge over time.
|
|{{StatusCol|red|not started yet}}
|{{StatusCol|green|Verified}}}}
|{{StatusCol|green|Verified}}}}
Every item in the player's inventory charges by tickTime * fMagicItemRechargePerSecond. Items anywhere else do not charge.
Every item in the player's inventory charges by tickTime * fMagicItemRechargePerSecond. Items anywhere else do not charge.

Revision as of 10:07, 4 September 2012

Spell Casting

Chance of successful Spell Cast

Actions affected On cast attempt
Description
Implementation status not started yet
Analysis status Accurate, but requires more work; spell skill depends on dominant school for multi effect spells, but is unspecified; Sound spell effect is not accounted for
chance = (Spells Skill * 2 + Willpower / 5 + Luck / 10 - SpellCost + CastPenalty) * (CurrentFatigue + MaximumFatigue * 1.5) / (MaximumFatigue * 2)


Cast cost

Actions affected On cast attempt
Description
Implementation status not started yet
Analysis status Does not account for multiple effect spells, non-duration spells or fixed magnitude spells
cost = 0.1 + ((min effect value / 20) + (max effect value / 20)) * ((duration - 1) / 2) + (range / 40).

x1.5 for ranged spell. Constant effect enchantments use fEnchantmentConstantDurationMult as their duration values (default 100).

  • Touch/Self
cost = base cost * ((max + min) * duration * 0.025 + area * 0.0125)
  • Target
cost = base cost * ((max + min) * duration * 0.3125 + area * 0.0125)
  • Constant effect
cost = base cost * ((max + min) * 2.5 + area * 0.025)

The base cost are here


Magic Damage and Mitigation

Actions affected On magic hit
Description
Implementation status not started yet
Analysis status Ignores willpower resists; which effects magic resistance apply to; reflection and absorption
Spell Damage = Damage - Damage * ( Resistance - Weakness ) / 100


Item Charge

Using enchanted items

Actions affected On enchanted item use
Description Charge consumed on use depends on skill.
Implementation status not started yet
Analysis status Verified; but a poorly scaling mechanic
x = 0.01 * (110 - pcEnchant)
charge used = int(x * enchant base charge cost)

This makes items last 10 times longer at 100 enchant compared to 10 enchant, making it scale a little too well. MCP uses x = 0.025 * (400 - pcEnchant).


Natural recharge

Actions affected On game tick
Description Enchanted items may gain charge over time.
Implementation status not started yet
Analysis status Verified

Every item in the player's inventory charges by tickTime * fMagicItemRechargePerSecond. Items anywhere else do not charge.


Soulgem charging

Refer to Player Craft Skills.


Magic effects

Spells are combinations of one or more effects, which have associated code specific to the effect, and properties which cover cast ranges, resistances and other generalized behaviours that may be shared by a small set of effects.

Effect flags

Bit Enum name Description
0x1 TARGET_SKILL Affects a specific skill, which is specified elsewhere in the effect structure.
0x2 TARGET_ATTR Affects a specific attribute, which is specified elsewhere in the effect structure.
0x4 NO_DURATION Has no duration. Only runs effect once on cast.
0x8 NO_MAGNITUDE Has no magnitude.
0x10 NEGATIVE Counts as a negative effect. Interpreted as useful for attack, and is treated as a bad effect in alchemy.
0x20 Unverified.
0x40 CAST_SELF Allows range - cast on self.
0x80 CAST_TOUCH Allows range - cast on touch.
0x100 CAST_TARGET Allows range - cast on target.
0x200 - 0x20000 Unverified.


Flags for all effects:

int effectFlags[] = {
    0x11c8, 0x11c0, 0x11c8, 0x11e0, 0x11e0, 0x11e0, 0x11e0, 0x11d0,
    0x11c0, 0x11c0, 0x11e0, 0x11c0, 0x11184, 0x11184, 0x1f0, 0x1f0,
    0x1f0, 0x11d2, 0x11f0, 0x11d0, 0x11d0, 0x11d1, 0x1d2, 0x1f0,
    0x1d0, 0x1d0, 0x1d1, 0x1f0, 0x11d0, 0x11d0, 0x11d0, 0x11d0,
    0x11d0, 0x11d0, 0x11d0, 0x11d0, 0x11d0, 0x1d0, 0x1d0, 0x11c8,
    0x31c0, 0x11c0, 0x11c0, 0x11c0, 0x1180, 0x11d8, 0x11d8, 0x11d0,
    0x11d0, 0x11180, 0x11180, 0x11180, 0x11180, 0x11180, 0x11180, 0x11180,
    0x11180, 0x11c4, 0x111b8, 0x1040, 0x104c, 0x104c, 0x104c, 0x104c,
    0x1040, 0x1040, 0x1040, 0x11c0, 0x11c0, 0x1cc, 0x1cc, 0x1cc,
    0x1cc, 0x1cc, 0x1c2, 0x1c0, 0x1c0, 0x1c0, 0x1c1, 0x11c2,
    0x11c0, 0x11c0, 0x11c0, 0x11c1, 0x11c0, 0x21192, 0x20190, 0x20190,
    0x20190, 0x21191, 0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x11c0,
    0x11c0, 0x11c0, 0x11c0, 0x11c0, 0x1c0, 0x11190, 0x9048, 0x9048,
    0x9048, 0x9048, 0x9048, 0x9048, 0x9048, 0x9048, 0x9048, 0x9048,
    0x9048, 0x9048, 0x9048, 0x9048, 0x9048, 0x11c0, 0x1180, 0x1180,
    0x5048, 0x5048, 0x5048, 0x5048, 0x5048, 0x5048, 0x1188, 0x5048,
    0x5048, 0x5048, 0x5048, 0x5048, 0x1048, 0x104c, 0x1048, 0x40,
    0x11c8, 0x1048, 0x1048, 0x1048, 0x1048, 0x1048, 0x1048
};