Jump to content

Need a bit of help with OnCombat Script.


oyvveg

Recommended Posts

hello. i have figured out how to make npcs use spells and powers that affect themselves like werewolf form and self buffing thanks to this post https://forums.nexusmods.com/index.php?/topic/644208-need-help-with-oncombat-script/

 

now i am wondering how i can make npcs do the casting animation and how i can make npcs use a spell against an hostile npc at the start of combat, like using a frenzy spell on a hostile npc.

Event OnCombatStateChanged(Actor actorRef, int combatState)

	if (combatState == 1)	;started combat
		WerewolfChange.Cast(Self)
	elseif (combatState == 0)	;left combat
		DispelSpell(WerewolfChange)
	endif

EndEvent

i used this code and just switched out WerewolfChange with a self buffing spell, and it worked.

 

what do i have to do to make npcs cast spells on other npcs and using the casting animation too?

Edited by oyvveg
Link to comment
Share on other sites

ok so i found out how to make an npc use a fire and forget spell on combat start, but i dont know how to make the npc target another npc with it.

Scriptname IramancerSimulacrum extends Actor  

SPELL Property ODN_Ill_Simulacrum2_Spell_Simulacrum  Auto  

Event OnCombatStateChanged(Actor akTarget, int combatState)

	if (combatState == 1)	;started combat
		ODN_Ill_Simulacrum2_Spell_Simulacrum.Cast(Self)
	elseif (combatState == 0)	;left combat
		DispelSpell(ODN_Ill_Simulacrum2_Spell_Simulacrum)
	endif

EndEvent

how exactly do i make an npc target an npc that is hostile towards it?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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