Jump to content

Trying to make a spell/perk that deals damage to people that hit the P


AstralFire

Recommended Posts

The specific effect I'm trying to make is along the lines of:

 

For <3> seconds, blocking reflects a large amount of damage at attackers. The damage you reflect and take is higher when not using a shield. <18> second CD.

 

I'm willing to extend the duration to around ~6 seconds if it's necessary for me to use weaker effects, but the simple 'ReflectDamage' actor value appears to hardcap at 100 even through forceav, and multiple applications don't result in damage stacking either, unlike normal damage. It would take reflecting around four hits to match the damage from a good strike from the player, which means it's not worth the time to cast unless it's an always on effect - and my mod's not in the business of making perk fixes, there are enough comprehensive perk overhauls out there. It could also be a medium duration buff of about 60 seconds, but I frankly believe those to be boring gameplay design unless the buff completely changes things. (ie, Adrenaline Rush, which I think is more susceptible to criticisms of balance than interest); they result in the player spending more time before a fight hiding in a corner or during the fight in the pause screen and throwing up their buffs before switching to what they -really- want to use.

 

So how I'm trying to achieve it.

 

OnHit:

 

Scriptname astral_innerserenity extends Perk  

Actor Property PlayerRef auto
Spell Property akSpell auto

Event OnHit(Actor akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)

PlayerRef = Game.GetPlayer()
IF akAggressor != PlayerRef && PlayerRef.IsInCombat() && akAggressor.IsHostileToActor(PlayerRef)
; The above is really to rule out run of the mill physical traps.

   IF ((akAggressor .GetEquippedItemType(0) == 8) || (akAggressor .GetEquippedItemType(1) == 8) \
       || (akAggressor .GetEquippedItemType(0) == 9) || (akAggressor .GetEquippedItemType(1) == 9))  && akProjectile != None
       ;most likely, the attack was spell damage
            akSpell = akSource as Spell
            akSpell.cast(PlayerRef, akAggressor)
   ELSEIF (akAggressor .GetEquippedItemType(0) != 7) && akProjectile == None
       ;most likely, the attack was melee damage. Come up with a revenge spell.
   ELSEIF (akAggressor .GetEquippedItemType(0) == 7)
       ;most likely, the attack was ranged damage. Come up with a revenge spell.
   ENDIF
ENDIF
EndEvent

 

Problem: When I insert debug notifications to test if this script is firing, it's clearly not. I don't understand how I'm supposed to use an OnHit Script if it's invalid in ActiveMagicEffect and doesn't receive effects via a perk the actor has.

 

METHOD #2:

 

Apply Weapon Swing Spell as a Perk Entry Point. Documentation says that it's supposed to grant the target of your weapon attacks a perk with Apply Combat Hit Spell using the spell you chose. I thought I could be clever and make a detrimental spell that damages the wielder if they attack someone who is currently blocking and has a specific spell effect. I made a simple script spell to test this out - it kills the weapon's bearer when they make an attack, minus the conditions I just mentioned. Not the final effect I want to use, but it made for easy testing to see if something was wrong. Well, something was wrong.

 

 

Scriptname Astral_KillWielder extends activemagiceffect  
Event OnEffectStart(Actor akTarget, Actor akCaster)
akCaster.kill()
EndEvent

 

Well, akCaster turned out to be me, not the NPCs wielding the weapons. Switching it out for akTarget didn't work so well, either. That was still me.

Edited by AstralFire
Link to comment
Share on other sites

  • Recently Browsing   0 members

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