scn zzEnchantRestoreScriptfloat fQuestDelayTimefloat timerref weapfloat strengthshort dayshort hourshort hour2short waitfloat xfloat yfloat zbegin menumode 1012 ;sleep wait menu set wait to 1endbegin GameModeif fQuestDelayTime != .001 set fQuestDelayTime to .001endifif GetGameLoaded == 1RunBatchScript "Data\EnchantmentRestore.ini"endifif wait set hour2 to gamehour if hour2 > hour set strength to hour2 - hour elseif hour2 < hour set strength to 23 - hour + hour2 elseif day > gamedayspassed set strength to 23 else set strength to 0 endif set weap to player.getequippedobject 16 if timescale > 0 set strength to strength * 3600 / Timescale ;How many seconds passed else set strength to strength * 3600 endif if EnchantRestoreTimer > .1 set strength to strength / EnchantRestoreTimer else set strength to strength / .1 endif if EnchantRestoreMysticism set strength to player.getav mysticism / 10 * strength else set strength to EnchantRestorePower * strength endif if strength + player.getequippedcurrentcharge 16 > getobjectcharge weap set strength to getobjectcharge weap - player.getequippedcurrentcharge 16 endif; printtoconsole "Wait Restore Strength = %.0f" strength if player.getequippedcurrentcharge 16 < getobjectcharge weap player.ModEquippedCurrentCharge strength 16 endifendifset wait to 0set hour to gamehourset day to gamedayspassedif EnchantNPCRef.getparentcell != player.getparentcell EnchantNPCRef.moveto playerendifset timer to timer + getsecondspassedif timer < EnchantRestoreTimer returnendifset timer to 0set x to player.getpos xset y to player.getpos yset z to player.getpos z + 100EnchantNPCRef.setpos x xEnchantNPCRef.setpos y yEnchantNPCRef.setpos z zEnchantNPCRef.cast zzEnchantRestoreNPCSpell playerset weap to player.getequippedobject 16if player.getequippedcurrentcharge 16 >= getobjectcharge weap returnendifif EnchantRestoreMysticism set strength to player.getav mysticism / 10else set strength to EnchantRestorePowerendifif strength + player.getequippedcurrentcharge 16 > getobjectcharge weap set strength to getobjectcharge weap - player.getequippedcurrentcharge 16endif;printtoconsole "Restore Strength = %.0f" strengthif player.getequippedcurrentcharge 16 < getobjectcharge weap player.ModEquippedCurrentCharge strength 16endifend
And here is the .ini:
set zzEnchantRestoreQuest.EnchantRestoreTimer to 0.5set zzEnchantRestoreQuest.EnchantRestoreMysticism to 0set zzEnchantRestoreQuest.EnchantRestorePower to 50
It's not working right though. I know one problem. I need to declare a few variables. That's no problem. But I don't think that's why it's not working.