Jump to content

Recommended Posts

Okay I still have yet to playtest haha but I will try GetSelf, I am inclined to believe you're right.

 

As far as the second script, the xoReboundHarm spell gives the player 100% Reflect Damage and 100% Reflect Magic with a duration of 1200 seconds.
I created a unique MagicEffect called REBO Rebound Harm, which is pretty much identical to Reflect Magic.

 

When cast the player reflects all harm & their magicka begins to drain at a rate that will eventually be determined by the player's Mysticism skill. Having a base of 30 Mysticism and 90 Magicka should equal about 1.5 seconds, but I haven't figured out my formula quite yet.

The spell will only drain, at maximum, the amount of Magicka the player had at the initial cast, that way I can use potions and cast other spells without having to change spells to toggle the ability off.

If HasMagicEffect REBO == 0
return
elseif GetAV Magicka < CostpTick || MagSpent >= InitMag || RHtimer >= Duration
Player.Dispel xoReboundHarm
endif

So basically the spell will stop if the player is out of magicka, spent the initial quantity, or the spell has lasted the fixed max duration (per spell tier, novice, apr, journeym, exp, mast).

Additionally, by putting this in my start block:

If HasMagicEffect REBO == 1
Player.Dispel xoReboundHarm
endif

If the player already has the active effect, recasting should toggle the ability off, to save from spending more magicka.

Theoretically it should work as intended unless casting the spell immediately changes HasMagicEffect REBO from 0 to 1 & therefore always does absolutely nothing lmao. & if that's the case then I've solved nothing...

Edited by freemodspls
Link to comment
Share on other sites

As far as the second script, the xoReboundHarm spell gives the player 100% Reflect Damage and 100% Reflect Magic with a duration of 1200 seconds.

I created a unique MagicEffect called REBO Rebound Harm, which is pretty much identical to Reflect Magic.

It sounds like you need to make this an Ability and not Spell - then you can use AddSpell and RemoveSpell commands to toggle it.

Using Cast command for this is unreliable at best, and I suspect won't work at all.

 

 

 

unless casting the spell immediately changes HasMagicEffect REBO from 0 to 1

Yes, that's actually what it does.

As I suggested above you can use a custom ability, and check with IsSpellTarget command whether it's active or not.

Link to comment
Share on other sites

hum so I finally play tested some and got less than expected results....
The current code for the first spell Snap Flames

 

 

scn xoSnapFlameNoviceScript
short Magnitude
short Duration
short Cost
short SpellCost
short Damage
short InitHealth
short RemHealth
short Courage
short Hope
float SFtimesince
float SFtimer
short Tpercent
short index
Begin ScriptEffectStart
set index to GetScriptActiveEffectIndex
If IsActor == 0
DispelNthActiveEffect index
return
endif
if IsActor == 0 || HasMagicEffect SNPFL == 1 || GetDead == 1
Return
Endif
set Magnitude to 20 ;should be 1 dps
set Duration to 20 ;20s
set Cost to 16 ;21 magicka w/ 5 dest
Set SpellCost to (1.4 - 0.012 * Player.GetAV Destruction) * xoSpellBookQuest.SnapFlameCost
If Player.GetAV Magicka - SpellCost < 0
Message "Not Enough Magicka."
return
else
Set SpellCost to -SpellCost
Player.ModAV2 Magicka SpellCost
endif
Set InitHealth to GetAV Health
Set Courage to GetAV Confidence
Set RemHealth to (GetAV Health) - Magnitude * (100 - GetAV ResistFire)/200 * (Duration * 2 / Duration)
if GetAV Health == GetBaseAV Health && RemHealth <= InitHealth * .1
ModAV Confidence -100
Set Hope to 0
else
Set Hope to 1
Endif
if RemHealth <= 0
ModAV Confidence -100
Endif
End
Begin ScriptEffectUpdate
if IsActor == 0 || HasMagicEffect SNPFL == 0 || GetDead == 1
Return
Endif
Set SFtimesince to SFtimesince + GetSecondsPassed
if SFtimesince < .5
Return
Endif
Set SFtimer to SFtimer + SFtimesince
Set SFtimesince to 0
Set Tpercent to Timer * 2 / Duration
Set Damage to -Magnitude * (100 - GetAV ResistFire) / 200 * TPercent
ModAV2 Health Damage
End
Begin ScriptEffectFinish
If ((GetAV Health > GetBaseAV Health * .1) && Hope == 0) || GetAV Health != 0
ForceAV Confidence Courage
Endif
End

 



so to break it down...

Calling Player.ModAV2 Magicka does nothing it seems if the SpellEffect has zero cost??

Set SpellCost to (1.4 - 0.012 * Player.GetAV Destruction) * (16)

 

This should spend about 21 Magicka at level 1 with 5 Destruction Skill, but it's costing zero and on top the spell is doing zero damage. I figure this is due to the actual spell is set to have zero cost and zero damage because I expected all of that to apply from the script. but wtf it's just zero. Also it ignores the GetDead checks and sets corpses on fire....

Once again the desired effect should be a dynamic spell cost and the damage should ramp up over the duration of the spell. It should still cost magicka unless the target is a nonactor or dead.

I also would like the cast animation to be a self cast if I'm forced to have one, but that only sets the player on fire. EVEN if I do GetCrosshairRef.

Do I need my spell to activate an ability and then put my script in that?

Link to comment
Share on other sites

Did more play testing and I noticed that my level 1 Flare spell ( the default given to every player ) is one shotting rats at max difficulty. I didn't touch the spell and I even turned off all of my plugins and noticed its doing the same. I recognized this as wrong, and verified, it does not one shot at full difficulty for other people. SO maybe reinstalling my game will somehow magically fix things?

Link to comment
Share on other sites

Alright, so first this part:

if IsActor == 0 || HasMagicEffect SNPFL == 1 || GetDead == 1
	Return
Endif

will stop your script from executing any further, because "HasMagicEffect SNPFL == 1" is already true (I'm assuming that this script is attached to your new magic effect).

 

You can combine GetDead check with the previous segment like this:

If IsActor == 0 || GetDead == 1
	DispelNthActiveEffect index
	return
endif

This will stop the effect on dead actors.

Link to comment
Share on other sites

I just want to reiterate how thankful I am for your assistance, & follow by saying you were right & that did stop the affect on dead actors.

I realized something with OBME is causing the level 1 flare spell to one shot mobs on max difficulty. I guess I cant really do anything about that...

But also even with those last given changes the script still costs nothing and deals no damage. I suppose its just bad math on my part.

Link to comment
Share on other sites

Yep it was bad math, THIS achieves something like I was looking for:

Set Tpercent to Magnitude* (SFtimer * 2 / Duration)
Set Damage to ((100 - GetAV ResistFire)/200) * (sqrt Tpercent * Magnitude)

Now at this point I believe I am at my limit.

1) I can't override the SNPFL magic effect duration that is given in casted spell's Duration Variable. Okay fine.

2) Even tho the spell effect can be canceled in the code, the player still attempts to cast because the spell is set to 0. Okay fine I'll put a hard spell cost.

3) Ideally the player would cast the spell without extending his arm, the idea of this spell is *snaps fingers* & the target enemy spontaneously catches on fire. I wish I could set the spell to self so I could at least settle with the raised fist and pretend he's doing a finger snap or something.

 

Thanks a ton! Here's the final script if anyone wishes to play with fire:

 

 

scn xoSnapFlameNoviceScript
short Magnitude
short Duration
short Cost
short SpellCost
float Damage
short DamageDealt
short InitHealth
short RemHealth
short Courage
short Hope
float SFtimesince
float SFtimer
short Tpercent
short index
Begin ScriptEffectStart
set index to GetScriptActiveEffectIndex
If IsActor == 0 ||  GetDead == 1
DispelNthActiveEffect index
return
endif
set Magnitude to 3 ; 20 should be 1 dps
set Duration to 200 ;20 = 20s
set Cost to 16 ; 16 is 21 magicka w/ 5 dest
Set SpellCost to (1.4 - 0.012 * Player.GetAV Destruction) * Cost
If Player.GetAV Magicka - SpellCost < 0
Message "Not Enough Magicka."
return
else
Set SpellCost to -SpellCost
Player.ModAV2 Magicka SpellCost
endif
Set InitHealth to GetAV Health
Set Courage to GetAV Confidence
Set RemHealth to (GetAV Health) - Magnitude * (100 - GetAV ResistFire)/200 * (Duration * 2 / Duration)
if GetAV Health == GetBaseAV Health && RemHealth <= InitHealth * .1 
ModAV Confidence -100
Set Hope to 0
else 
Set Hope to 1
Endif
if RemHealth <= 0
ModAV Confidence -100
Endif
End
Begin ScriptEffectUpdate
if IsActor == 0 || HasMagicEffect SNPFL == 0 || GetDead == 1
Return
Endif
Set SFtimesince to SFtimesince + GetSecondsPassed
if SFtimesince < .5
Return
Endif
Set SFtimer to SFtimer + SFtimesince
Set SFtimesince to 0
Set Tpercent to Magnitude* (SFtimer * 2 / Duration)
Set Damage to ((100 - GetAV ResistFire)/200) * (sqrt Tpercent * Magnitude)
Set Damage to -Damage
ModAV2 Health Damage
Set DamageDealt to DamageDealt - Damage
End
Begin ScriptEffectFinish
If ((GetAV Health > GetBaseAV Health * .1) && Hope == 0) || GetAV Health != 0
ForceAV Confidence Courage
Endif
End

 

 

 

Link to comment
Share on other sites

I couldn't stop myself from trying. I made a new ability to control my SnapFlame parameters and casting the spell (self range) purely should initiate the spell script and apply an ability like so:

scn xoSnapFlameNoviceScript
short index
ref SFTarget
short Targetlocked
Begin ScriptEffectStart
set index to GetScriptActiveEffectIndex
If IsActor == 0 || GetDead == 1
DispelNthActiveEffect index
return
endif
End
Begin ScriptEffectUpdate
If playerRef.GetCrossHairRef.IsActor == 0 && Targetlocked == 1
Return
elseif playerRef.GetCrossHairRef IsActor == 1 && HasMagicEffect SNPFL == 0
set xoSpellBookQuest.SnapFlameMag to 3
set xoSpellBookQuest.SnapFlameDur to 20
set xoSpellBookQuest.SnapFlameTarget to playerRef.GetCrossHairRef
Set SFTarget to playerRef.GetCrossHairRef
SFTarget.AddSpell xoSnapFlame
SetNumericGameSetting IActivatePickLength 150
Set Targetlocked to 1
Return
elseif playerRef.GetCrossHairRef.IsActor == 0 && Targetlocked != 1
SetNumericGameSetting IActivatePickLength 1000
Return
endif
End
Begin ScriptEffectFinish
SetNumericGameSetting IActivatePickLength 150
Set Targetlocked to 0
End 

1) I get a syntax error, "Invalid Reference Syntax" for the very first line using GetCrossHairRef. Same error if I use Player.GetCrossHairRef instead of playerRef.GetCrossHairRef. If I completely remove the reference, because GetCrossHairRef should only reference the player, I get a different Error. "Unknown referenced object GetCrossHairRef."

 

There is nothing on the internet that really explains how to use that function but it seems like the key to my problems.

Link to comment
Share on other sites

Hey thanks that fixed it. I set a ref and some handy if checks, to toggle my IActivatePickLength value. It just doesn't seem to work. lol way. too. complicated.

 

here's the script, i probably made a dumb mistake or something.

 

 

scn xoSnapFlameNoviceScript
short index
ref tarCheck
ref SFTarget
short Targetlocked
Begin ScriptEffectStart
set index to GetScriptActiveEffectIndex
If IsActor == 0 ||  GetDead == 1
DispelNthActiveEffect index
return
endif
End 
Begin ScriptEffectUpdate
set tarCheck to GetCrossHairRef
If tarCheck.IsActor == 0 && Targetlocked == 1
Return
elseif tarCheck IsActor == 1 && HasMagicEffect SNPFL == 0
set xoSpellBookQuest.SnapFlameMag to 3  
set xoSpellBookQuest.SnapFlameDur to 20 
set xoSpellBookQuest.SnapFlameTarget to tarCheck
Set SFTarget to tarCheck
SFTarget.AddSpell xoSnapFlame
SetNumericGameSetting IActivatePickLength 150
Set Targetlocked to 1
Message "Target locked"
Return
elseif tarCheck.IsActor == 0 && Targetlocked != 1
SetNumericGameSetting IActivatePickLength 1000
Return
endif
End
Begin ScriptEffectFinish
SetNumericGameSetting IActivatePickLength 150
Set Targetlocked to 0
End

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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