Jump to content

Damaging the caster of a spell


Recommended Posts

I'm looking into creating a rather niche potion, one that operates similarly to a black-blood potion from the witcher 3. Essentially, when the player (or preferably any npc) drinks the potion, vampiric absorb spells used against them will damage them normally, but instead of healing the caster, the caster will also take damage. I know I could alter the vanilla absorb spells to check for the potion effect, but want to avoid potential incompatibilities with other vampire mods. Is there a way to apply an effect to the caster of a type of spell? (ideally with a check for: is the magic effect an absorb health spell, is the caster a vampire)

Link to comment
Share on other sites

Then your potion must give them a 'Disease' with an 'Magic Effect' does has no resistance value apply to it, any of the actor's resistance to disease will be ignored by your 'Disease Spell', this means you need to create your own 'Magic Effect' and the 'Disease' spell for your potion.


Another way you could do this is by creating an empty 'Magic Effect' that will execute a script to damage the actor.


I hope it helps.

Link to comment
Share on other sites

Hi, folks.

 

Maxarturo, do you think that using the event 'Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)' in the script for the potion might work? It is used somewhere, but I can't recall where, just at the minute. Hang on, I'm thinking of the spell 'DLC1AbDeerGlow'

 

I'm thinking that this could be used to check that the player has been hit and has been hit by the specific vampiric drain spell. If those conditions are true, then the OP applies vampiric drain to the aggressor. If it can work this way, the only downside is that vampiric drain will be applied to the aggressor until they die.

 

I suppose the OP could get around this by adding a line to 'RegisterForSingleUpdate(MySpellTime)' and set the 'MySpellTime' as a float property and give it a value. In a separate event 'Event OnUpdate()' the spell is removed from the aggressor.

 

They might also want to remove it in the event of the aggressor dying... don't know if the effect will hang on the dead aggressor forever if it's not removed.

 

If and it's a big 'If' my rambling will work, the OP could then make a specific spell to be applied to the aggressor, so they could then tailor the amount of damage done to the aggressor. As I've put it, the aggressor gets exactly the same damage as the vampire is dealing out, for the specified time. With new spells, the vampire could get the same damage, or they could get more or less damage, depending how the OP wants to play it.

 

Less damage implies that some of the original spell is reflected back on the aggressor. More damage means the aggressor is truly wasting their magicka by using the spell! In that case, as long as the player's health is higher than the vampire's, they can simply dodge the vampire until it dies! Sweet.

Link to comment
Share on other sites

@ cumbrianlad


Yes, this can be done using different approaches, it's all down to what and how the modder is trying to achive in the long run.


In the OP case, i think a disease is the simpler way to do this.


I always try to create / provide scripts or solutions that will use the minimum of system resources and they will accomplish the same result with a lighter and simpler way as possible.


Have a happy modding.

Link to comment
Share on other sites

Right.

 

Makes a change me suggesting a scripted method! Normally I'm doing my damndest to avoid scripts.

 

So how does the disease get applied to an enemy, some time after downing the potion? I can't see how to condition the disease being given to the attacker if the attacker is a vampire and has used one of the vampiric drain spells on the player, without using a script.

 

Anyway, I guess we'll wait for the OP to reply, rather than carrying out our own little conversation, however interesting it may be!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...