Jump to content

[LE] How to transform an npc when hit by an arrow


9garr

Recommended Posts

Hey so I'm pretty new to scripting in the Creation Kit (as in, I started 6 hours ago) and I've just been trying to work everything out.

 

My goal is to have a script that makes it so that when any npc is hit by a specific arrow/projectile that I've made, it will transform into a specific animal.

 

I copied some of the script for the Wabbajack to see how far I could get but so far it does nothing. (don't worry about the moose, thats just what I named it)

Scriptname MakeMoose extends activemagiceffect  

OBJECTREFERENCE newRefStore
ACTORBASE PROPERTY Moose AUTO
dunTransmogrifyAnimal mainScript

ACTOR victim

EVENT onEffectStart(Actor akTarget, Actor akCaster)

	victim = akTarget

	IF(akCaster == game.getPlayer())
		randomCreatureMoose(akTarget)
	
	ENDIF

ENDEVENT

FUNCTION randomCreatureMoose(ACTOR targ)

	targ.disable()
			
	newRefStore = targ.placeAtMe(Moose)
	
	mainScript = newRefstore AS dunTransmogrifyAnimal
	mainScript.storedActor = targ
	
ENDFUNCTION

My thought is that I can make it a spell of some kind and apply it to an explosion effect that triggers with arrow impact.

 

Any help would be greatly appreciated, thanks.

Link to comment
Share on other sites

I did try using OnHit instead of OnEffectStart but I think I did it wrong. When I hit someone with the arrow they would not disappear, and the Moose would spawn behind me (I think, it really wasnt clear).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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