Jump to content

Problem with Levitation spell


RagnaHighArc

Recommended Posts

Ok i got it to work. I just had to turn off the AI with setActorsAI

 

///

 

I made a spell in which the enemy is immobilized and floating for a few seconds, but instead of floating, the npc constantly floats up and down during the spell's duration.

 

I tried looking at the Ring of Wings mod, but it looks like it does the same thing that i do in my script.

 

scn levitate

ref p

float z
float z3
float y
float x

long nh
long nh1

short s

begin scriptEffectStart

set p to getSelf
set nh to p.getAv health
set z to p.getPos z
set y to p.getPos y
set x to p.getPos x

set z3 to (z + 100)

p.setRestrained 1

end

begin scriptEffectUpdate

set nh1 to p.getAv health
if (nh1 < nh)
set s to 1
endif

if (s == 0)
p.setPos z, z3
p.setPos x, x
p.setPos y, y
else
p.setRestrained 0
endif

resetFalldamageTimer

end

begin scriptEffectFinish
p.setRestrained 0
end

Link to comment
Share on other sites

  • Recently Browsing   0 members

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