Jump to content

[LE] Sun damage spells from Dawnguard.


Olgark

Recommended Posts

I am currently make a follower mod and I tried to give the follower sun damage spells from the restoration skill tree.

 

In combat against the undead it all works fine but when he attacks a living npc he will still use the sun damage spells, and of course this doesn't do anything to the living npcs.

 

I was wondering if there is a way to get the follower AI to recognise when the target is a undead and then switch to the sun damage spells via a script command?

 

I can see in the window target conditions for the spell but this is blank and thought that I might be able to make a spell up that is unique to the follower that will only effect the undead using this conditions window.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

I have looked through some sample scripts and come up with this so far.

Scriptname LeftPawAlightsunspell 

 Event OnCombatStateChanged(Actor akTarget, int aeCombatState) 
	EndEvent
	
if (akTarget == Game.GetActor().HasKeyword(ActorTypeUndead)

	AddSpell(DLCSunSpell)

	ElseIf (aeCombatState == 0)
		
	RemoveSpell(DLCSunSpell)
EndIf
	EndIf
EndFunction

But I get a compile error saying line 6,0 EOF at if is wrong.

 

This is my first foray into scripting and the script is supposed to add the spell to a custom follower I am making and then remove it when combat is finished. This is to stop them from using the spell on living targets. Any help would be appreciated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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