Jump to content

Need Scripting Help!


Shinokage

Recommended Posts

So I had this script to cast this spell on a boss character once they hit a certain HP level. It worked fine, but then after some more modding work on non-scripting things, it stopped working. Here's what i'm working with. The HPThreshold is so high so I can smack the enemy a few times in game to see if it works.

Scriptname ShinoGloryTF3 extends actor

actor property selfRef auto hidden
float property HPthreshold = 0.95 auto
spell property ShinoEnvyBlazeofGloryBoss auto
magicEffect property ShinoEnvyGloryBlazeofGloryCloak auto

EVENT OnEffectStart(Actor Target, Actor Caster)

selfRef = caster

endEVENT


EVENT onHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)

if (selfRef.getActorValuePercentage("Health") < HPthreshold) && !(selfRef.HasMagicEffect(ShinoEnvyGloryBlazeofGloryCloak)) && !(selfRef.isDead())
	
	debug.trace ("It's working!")
	ShinoEnvyBlazeofGloryBoss.cast(selfRef,selfRef)

endif

endEVENT

 

I'm willing to bet it's something small. that i'm over looking. Compiles fine though. I'm lost, any help is appreciated!

Link to comment
Share on other sites

I could be wrong, but doesn't OnEffectStart extend ActiveMagicEffect and not Actor? If you're using selfRef to mean the "boss" for casting the spell, I'm also assuming that you've got the corresponding Actor property set properly. Beyond that, it's what Arron Dominion said. :)
Link to comment
Share on other sites

  • 2 weeks later...
Scriptname ShinoGloryTF3 extends actor

float property HPthreshold = 0.95 auto
spell property ShinoEnvyBlazeofGloryBoss auto
magicEffect property ShinoEnvyGloryBlazeofGloryCloak auto

EVENT onHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
       if getAVPercentage("Health") < HPthreshold && !HasMagicEffect(ShinoEnvyGloryBlazeofGloryCloak) && !isDead()
	debug.trace ("It's working!")
	ShinoEnvyBlazeofGloryBoss.cast(self, self)
endif
endEVENT

Link to comment
Share on other sites

Scriptname ShinoGloryTF3 extends actor

float property HPthreshold = 0.95 auto
spell property ShinoEnvyBlazeofGloryBoss auto
magicEffect property ShinoEnvyGloryBlazeofGloryCloak auto

EVENT onHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
       if getAVPercentage("Health") < HPthreshold && !HasMagicEffect(ShinoEnvyGloryBlazeofGloryCloak) && !isDead()
	debug.trace ("It's working!")
	ShinoEnvyBlazeofGloryBoss.cast(self, self)
endif
endEVENT

 

Ironically, I got this working over a week ago as I thought this thread died.

 

The code that you have steve, is EXACTLY what I have now. Thank you though for always being helpful! Everyone else too.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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