Jump to content

Are creatures of the INNOCENT class immune to random lightning strikes?


polytope

Recommended Posts

Or possibly those with only 1HD/level?

In my most recent playthrough Xzar in BG2 got struck by lightning shortly after he appeared in the docks, until now I've only seen party members and enemies struck by lightning in outdoor maps (perhaps summons would be too, but they're usually not around for long). Xzar is the first neutral I've seen hit by it, but it got me thinking that most neutrals in maps are either small animals with 1 hd or are classed as innocents (who usually are also lvl 1 equivalent).

Link to comment

Drizzt in BG1 is classed as an innocent, but he's also high-level, which supports the idea of there being a HD cutoff or possibly even an animation restriction (as some are immune to knockback).

Also, he shouldn't be killed by lightning unless he was already badly injured, usually from the party attacking him. Was he hostile when he was struck by lightning?

Link to comment
6 hours ago, polytope said:

Also, he shouldn't be killed by lightning unless he was already badly injured, usually from the party attacking him. Was he hostile when he was struck by lightning?

No, but this was 2.5. I was in the process of killing him the slow way by activating a gnoll without activating him, and then it suddenly came to an end.

Link to comment
  • Areas have a 2% chance each tick (default 30tps) to attempt a lightning strike, (approximately 1 strike attempt every ~2.2 seconds).
  • It randomly selects a creature from m_lVertSort, which includes all the non-flying living creatures.
  • If the selected creature is currently on-screen, the chance to strike it is determined by their armor's animation:
    • (Anything) => 30%
    • Chain mail => 65%
    • Plate mail => 100%

So lightning can pretty much hit any creature as long as it's on-screen.

Link to comment
3 hours ago, Bubb said:
  • If the selected creature is currently on-screen, the chance to strike it is determined by their armor's animation:
    • (Anything) => 30%
    • Chain mail => 65%
    • Plate mail => 100%

Ah, an interesting level of detail that the armor type actually matters: Looking at the unused MAGNET.bcs it checks for metal armor by filename rather than animation.

It does make sense considering that I've noticed neither animals nor peasants seem to get struck, or they could, but the armored are more likely.

3 hours ago, Bubb said:
  • Areas have a 2% chance each tick (default 30tps) to attempt a lightning strike, (approximately 1 strike attempt every ~2.2 seconds).

This is multiplicative with the probability of a storm in the first place right? Some areas like the forest of Tethir have guaranteed bad weather, low lightning probability coded into the area file. Most outdoor city areas are the opposite, low chance of a storm, high chance of a lightning strike if there is one.

Edited by polytope
Link to comment
1 hour ago, polytope said:

This is multiplicative with the probability of a storm in the first place right?

You're right, it's modified by [+0x50] of the area header, "Lightning probability." This field only observes four different tiers:

  • 0 => Disabled.
  • [1, 32] => 2% chance to attempt a lightning strike every 150 + [0, 999] ticks.
  • [33, 65] => 2% chance to attempt a lightning strike every 100 + [0, 699] ticks.
  • [65, +] => 2% chance to attempt a lightning strike every 45 + [0, 199] ticks.

There's also some randomness in how intense the storm is and how loud the thunder sound is. The engine only attempts a lightning strike when it decides the thunder's volume should be above 85%. So, realistically, it's a lot rarer than I initially thought.  

Edited by Bubb
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...