ghosu Posted February 10, 2012 Share Posted February 10, 2012 (edited) Hi I'm working on Thor's Hammer atm and since i'm always short on time i could need some help...i already created an own enchantment for the hammer and added several magical effects. But i would like to set up a % value to activate those effects. Like 10% on knockback, 15% on lightening dmg and so on...i already looked up Mehrune's Dagger since this weapons has got a % to instantly kill an enemy but i found no fitting option. Btw, "magnitude" is responsible for? So any hints would help :)thx Edited February 10, 2012 by ghosu Link to comment Share on other sites More sharing options...
GisleAune Posted February 10, 2012 Share Posted February 10, 2012 (edited) I don't know for certain but Mehrune's Razor's enchantment's magical effect's script implements a random chance modification on its effect, you could use Utility.RandomInt(0, 100) and check if it's smaller than a property integer you call "chance", then apply the effect declared as a property. Try to put as much stuff in properties, it will allow you to perhaps get away with one script for all the effects. As for "magnitude", It seems to modify the power of effects like Lightning Damage. I'm going to try this for myself now (implementing a effect/chance script and testing it), if it works I will share. Edited February 10, 2012 by GisleAune Link to comment Share on other sites More sharing options...
ghosu Posted February 10, 2012 Author Share Posted February 10, 2012 Hi Well i have no clue ''bout scripts yet since i only made weapons/armors but i'll check this out, with provider problems and a download rate of 1kb/sec it's hard to browse for tutorials or watch videos :DSo if you find a solution i would really appreciate an explanation for rednecks like me :) greetings Link to comment Share on other sites More sharing options...
imperistan Posted February 10, 2012 Share Posted February 10, 2012 Funny you should make this ghosu, I'm confounded at this problem as well. I know I need to cannibalize the mehrunes razor script, but everywhere I've asked no ones been able to tell me exactly what I need to rip out of that script in order to have a basic randomization in the chance to for knockback to activate. Link to comment Share on other sites More sharing options...
GisleAune Posted February 10, 2012 Share Posted February 10, 2012 (edited) I think I might be onto something here. I'll need to test it first, but my script is now: Scriptname MagicalEffectChanceScript extends ActiveMagicEffect {Dispels this effect (chance)% of times} int property chance = 15 auto Event OnEffectStart(Actor akTarget, Actor akCaster) if(Utility.RandomInt(1, 100) > chance) Dispel() endIf endEvent If it works, it would be simply to add it and set the property to a copyed fire damage magical effect. Edit: My magical effect won't show up in the list in the enchantment's effect's dialogbox. Edit2: Somehow my copyed Shock Damage enchant turned into an armor enchant giving me the list accordingly. Now I'm back on track, just have tocreate a simple dagger to test it on.Edit3: Something seems odd... It appears to still happen all of the times, just need to test if the script is working.Edit4: I'm going to bed now as it's 3:23 AM and I hope to get up 10 AM tomorrow. I might not be able to resume this little project until 21-23-ish tomorrow (GMT+1), so someone else could perhaps test adding this script to a magical effect and get it working. Edited February 10, 2012 by GisleAune Link to comment Share on other sites More sharing options...
GisleAune Posted February 10, 2012 Share Posted February 10, 2012 Bumping this. Why wouldn't the script above dispel the effect, or does the effect's impact visual effects still show when it is dispelled? Link to comment Share on other sites More sharing options...
ghosu Posted February 10, 2012 Author Share Posted February 10, 2012 Nice...well another bump then :D Link to comment Share on other sites More sharing options...
imperistan Posted February 10, 2012 Share Posted February 10, 2012 Okay so I was thinking of trying out that script Gisle at some point today, but I need some clarification. That word property in the script would be replaced with the script for whatever effect we're doing correct? If so then it should be simple for me to add the script, but if not then obviously I need to know where I need to put the effect script. Also, as this should help you out, it might be a good idea in testing to replace the shock damage effect (or whatever damage effect you were using) with the same effect the werewolf knockback effect uses (which is a variation on the normal pushback that takes into account whether your weapon actually hits your target) as that will tell you easily whether or not your script is working. For if it works then they won't go flying back every time. Link to comment Share on other sites More sharing options...
ghosu Posted February 10, 2012 Author Share Posted February 10, 2012 I need it now! :tongue: *last bump* Link to comment Share on other sites More sharing options...
skizophrenic Posted February 10, 2012 Share Posted February 10, 2012 Have you all seen the script named DA07MehrunesRazorMagicEffectScript? Event OnEffectStart(Actor akTarget, Actor akCaster) ;Apply this effect if the target is not in the excluded faction If akTarget.IsInFaction(pDA07MehrunesRazorImmuneFaction) == 1 Return Else ;1 percent chance to kill target; debug.trace(self + " hitting " + akTarget + " with Mehrunes' Razor") If (Utility.RandomInt() <= 1); debug.trace(self + "Instant Kill effect applied on" + akTarget) If Game.GetPlayer().GetItemCount(DA07MehrunesRazor) >= 1 akTarget.Kill(Game.GetPlayer()) Else akTarget.Kill() EndIf EndIf EndIf EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts