Shinokage Posted December 16, 2012 Share Posted December 16, 2012 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 More sharing options...
ArronDominion Posted December 17, 2012 Share Posted December 17, 2012 (edited) I would place a debug where it is assigning the caster, to make sure selfRef is being assigned properly, printing out the selfRef. Edited December 17, 2012 by Arron Dominion Link to comment Share on other sites More sharing options...
Mujuro Posted December 17, 2012 Share Posted December 17, 2012 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 More sharing options...
steve40 Posted December 28, 2012 Share Posted December 28, 2012 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 More sharing options...
Shinokage Posted December 30, 2012 Author Share Posted December 30, 2012 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 More sharing options...
Recommended Posts