Trying to make a spellperk that deals damage to people that

Post » Thu Jun 21, 2012 6:14 pm

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 autoSpell Property akSpell autoEvent 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.	ENDIFENDIFEndEvent

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.
User avatar
Krista Belle Davis
 
Posts: 3405
Joined: Tue Aug 22, 2006 3:00 am

Post » Thu Jun 21, 2012 7:50 am

I'm not a pro at papyrus and perhaps the worse person to come to about anything related to it. But this kind of thing you want to achieve ended up being the first of few scripts I got working all on my own.

I had to cast akaggressor as an actor. and I had to use this line (actor actorRef = akaggressor as actor)

and then I did if statements

for example..

Event OnHit(ObjectReference akAggressor, Form akWeapon, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)		  actor actorRef = akAggressor as Actor   	    if IceStrike            (akAggressor as Actor).DamageAV("health", 10)        endif                if IceStorm            (akAggressor as Actor).DamageAV("health", 10)        endif                if IceSpear            (akAggressor as Actor).DamageAV("health", 10)				          endifEndEvent
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Thu Jun 21, 2012 7:09 pm

I'll give it a try tonight. I appreciate it very much!
User avatar
Frank Firefly
 
Posts: 3429
Joined: Sun Aug 19, 2007 9:34 am


Return to V - Skyrim