Jump to content

[LE] Script for cast spell on bash attack


Recommended Posts

Here what I got so far :

Scriptname BashAttackSpell extends activemagiceffect  

spell property magicSpell1 auto
spell property magicSpell2 auto
spell property magicSpell3 auto
spell property magicSpell4 auto
spell property magicSpell5 auto
spell property magicSpell6 auto
spell property magicSpell7 auto

ObjectReference Pcaster
Actor RuneShield

function OnUnload()

	self.UnregisterForAnimationEvent(self.GetTargetActor() as objectreference, "BashAttack")
endFunction

function OnEffectStart(Actor target, Actor caster)

	if caster == self.GetTargetActor()
		if self.RegisterForAnimationEvent(self.GetTargetActor() as objectreference, "BashAttack") == true
			debug.trace("BashAttack registered", 0)
		endIf
	endIf
endFunction

function OnAnimationEvent(objectreference akSource, String asEventName)
	
	bool BashAttack = Game.GetPlayer().GetAnimationVariableBool("bAllowRotation")
	RegisterForSingleUpdate(0.5)


	If BashAttack == True 
		debug.trace("the RUNE of me... get it?", 0)
		magicSpell1.Cast(self.GetTargetActor() as objectreference, none)
		utility.wait(0.100000)		
		magicSpell2.Cast(self.GetTargetActor() as objectreference, none)
		utility.wait(0.100000)
		magicSpell3.Cast(self.GetTargetActor() as objectreference, none)
		utility.wait(0.100000)
		magicSpell4.Cast(self.GetTargetActor() as objectreference, none)
		utility.wait(0.100000)
		magicSpell5.Cast(self.GetTargetActor() as objectreference, none)
		utility.wait(0.100000)
		magicSpell6.Cast(self.GetTargetActor() as objectreference, none)
		utility.wait(0.100000)
		magicSpell7.Cast(self.GetTargetActor() as objectreference, none)

		self.GetTargetActor().damageAv("magicka", 30 as Float)
	endIf




endFunction


It's still won't works, can someone correct me? Thanks in advance.

Edited by sp4rkfist
Link to comment
Share on other sites

I mean, it's totally works on power attack.

Scriptname PowerAttackSpellMultipleScript extends activemagiceffect  

spell property magicSpell1 auto
spell property magicSpell2 auto
spell property magicSpell3 auto
spell property magicSpell4 auto
spell property magicSpell5 auto
spell property magicSpell6 auto
spell property magicSpell7 auto

function OnUnload()

    self.UnregisterForAnimationEvent(self.GetTargetActor() as objectreference, "weaponSwing")
endFunction

function OnEffectStart(Actor target, Actor caster)

    if caster == self.GetTargetActor()
        if self.RegisterForAnimationEvent(self.GetTargetActor() as objectreference, "weaponSwing") == true
            debug.trace("weaponSwing registered", 0)
        endIf
    endIf
endFunction

function OnAnimationEvent(objectreference akSource, String asEventName)
    
    bool PowerAttack = Game.GetPlayer().GetAnimationVariableBool("bAllowRotation")
    RegisterForSingleUpdate(0.5)

    If PowerAttack == True 
        debug.trace("the RUNE of me... get it?", 0)
        magicSpell1.Cast(self.GetTargetActor() as objectreference, none)
        utility.wait(0.100000)        
        magicSpell2.Cast(self.GetTargetActor() as objectreference, none)
        utility.wait(0.100000)
        magicSpell3.Cast(self.GetTargetActor() as objectreference, none)
        utility.wait(0.100000)
        magicSpell4.Cast(self.GetTargetActor() as objectreference, none)
        utility.wait(0.100000)
        magicSpell5.Cast(self.GetTargetActor() as objectreference, none)
        utility.wait(0.100000)
        magicSpell6.Cast(self.GetTargetActor() as objectreference, none)
        utility.wait(0.100000)
        magicSpell7.Cast(self.GetTargetActor() as objectreference, none)

        self.GetTargetActor().damageAv("magicka", 30 as Float)
    endIf
endFunction

However, I still have no idea how to make it works on bash attack.

Link to comment
Share on other sites

Thanks for the responses PhilTheGamer1111 and DMan1629, alas "Apply Bashing Spell" cant generate projectiles since it's only apply spells delivered by contact. What I'm really looking for is the way to generate shockwave like unrelenting force on bash.

 

The script above is works for power attack, but I can't find correct animation event / variables for regular bash attack.

Link to comment
Share on other sites

Thanks PhilTheGamer1111, but alas it's didn't work. However, your suggestion to check The Targe of the Blooded gave me the idea to check other existing items, and finally lead me to this.

 

http://elderscrolls.wikia.com/wiki/Dawnguard_Rune_Hammer

 

That hammer have script I've been looking for. With little bit modification, here is the working script.

Scriptname BashAttackSpell extends activemagiceffect  

spell property magicSpell1 auto
spell property magicSpell2 auto
spell property magicSpell3 auto
spell property magicSpell4 auto
spell property magicSpell5 auto
spell property magicSpell6 auto
spell property magicSpell7 auto

EVENT OnEffectStart(Actor target, Actor caster)	
	
	if(caster == game.getPlayer())
		if(RegisterForAnimationEvent(game.getPlayer(), "bashExit") == true)
			debug.trace("bashExit registered")
		endif
	
	endif

ENDEVENT

EVENT OnAnimationEvent(ObjectReference akSource, string asEventName)
  
  	if(asEventName == "bashExit")
  		Debug.trace("Arcane wrath!!!")


		magicSpell1.cast(game.getPlayer())
		utility.wait(0.100000)
		magicSpell2.cast(game.getPlayer())
		utility.wait(0.100000)
		magicSpell3.cast(game.getPlayer())
		utility.wait(0.100000)
		magicSpell4.cast(game.getPlayer())
		utility.wait(0.100000)
		magicSpell5.cast(game.getPlayer())
		utility.wait(0.100000)
		magicSpell6.cast(game.getPlayer())
		utility.wait(0.100000)
		magicSpell7.cast(game.getPlayer())
		utility.wait(0.100000)
  		game.getPlayer().damageAv("magicka", 25)

	endIf

ENDEVENT




EVENT OnUnload()
	UnregisterForAnimationEvent(game.getPlayer(), "bashExit")
	
ENDEVENT


Edited by sp4rkfist
Link to comment
Share on other sites

  • Recently Browsing   0 members

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