Jump to content

Randomized Innate Spell Turning?


Recommended Posts

Hi there! I'm very new to modding and am trying to create a creature in NearInfinity that uses the true stats of a Death Knight from P&P AD&D 2e. The P&P version has 75% Magic Resistance, with one caveat: there is an 11% chance that any spell will be reflected back at the caster. I'm trying to implement this on the creature itself, but so far the only way I've learned I could realistically do it is by adding a check on a per-spell basis, meaning I'd have to change every daggone spell in the game just for one creature's effect lol. I really don't want to do this, so I've been trying to find a workaround.

So far, my super jank workaround has been to create a spell that is cast on the Death Knight once per round if it has any enemies nearby. The intended effect is that the spell would apply 1 level of Spell Turning that would last for 5 seconds, and reapply itself next round if the probability check is good. I tried changing the probability value of the spell effect to be 11%, and also tried changing the probability of the "Cast spell on condition" to be 11%. Neither of these worked—it seems to always trigger the casting of the spell.

Since that approach didn't work, I looked at how probability is handled by other spells, e.g. Prismatic Spray and Conjure Earth Elemental. I noticed with the former, there were several effects that could apply if the probability check is good, and with the latter, it uses three EFF files with different probabilities to determine which HD Elemental is summoned. I went with this approach for the spell. I created two EFF files: one that casts a spell to apply 1 level of Spell Turning on the Death Knight; and one that casts a spell to create a visual effect, say a string "Spell Protections Removed", and remove any Spell Turning effects on the Death Knight. Just as in the Conjure Earth Elemental spell, I set the probabilities of the EFF files to have an 11% chance to use the Spell Turning EFF, and an 89% chance to use the Removal EFF. However, once again, upon triggering the casting of the spell, it always applied the Spell Turning, and never removed it. I can't seem to figure out why!

Any experienced modders want to help? Thank you ❤️

Link to comment

Sorry, forgot to put pictures in the post. Wanted to clarify I literally just copied how Spell Turning is applied via the Mage spell and used the Belt of Minor Invulnerability's method of 5% chance of applying Minor Globe of Invulnerability when hit. I have tried it both by having the "cast spell on condition" applied to the creature itself, and to an item that it wears. When I put it on an item, it now just doesn't apply the effect at all.image.thumb.png.c5b5c73ef80e7ae2336de723d365f754.png

image.png.5b06ecd4248a1e8b2ce81c86173447d7.pngimage.thumb.png.49c6f65d9c61a371b0f18d3df045c853.png

Edited by jumbogoblin
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...