Begin Were_ChangeAtWillScript short state short pcwere short oldpcwere float timer short KeyRef short DoOnce short DoOnce2 Long Code Long Current short randomizer ;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 80-85;;;;;;;;;;;;;;;;;;;;; If ( DoOnce2 == 1 ) If ( randomizer == 1 ) If ( player-> getwillpower >= 80 ) If ( player-> getwillpower < 85 ) if ( timer <= 60 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 2 ) If ( player-> getwillpower >= 80 ) If ( player-> getwillpower <= 85 ) if ( timer <= 180 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 3 ) If ( player-> getwillpower >= 80 ) If ( player-> getwillpower <= 85 ) if ( timer <= 140 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 4 ) If ( player-> getwillpower >= 80 ) If ( player-> getwillpower <= 85 ) if ( timer <= 300 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 5 ) If ( player-> getwillpower >= 80 ) If ( player-> getwillpower <= 85 ) if ( timer <= 360 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif ;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 86-90;;;;;;;;;;;;;;;;;;;;; If ( DoOnce2 == 1 ) If ( randomizer == 1 ) If ( player-> getwillpower > 85 ) If ( player-> getwillpower <= 90 ) if ( timer <= 400 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 2 ) If ( player-> getwillpower > 85 ) If ( player-> getwillpower <= 90 ) if ( timer <= 460 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 3 ) If ( player-> getwillpower > 85 ) If ( player-> getwillpower <= 90 ) if ( timer <= 310 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 4 ) If ( player-> getwillpower > 85 ) If ( player-> getwillpower <= 90 ) if ( timer <= 530 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 5 ) If ( player-> getwillpower > 85 ) If ( player-> getwillpower <= 90 ) if ( timer <= 620 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif ;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 91-95;;;;;;;;;;;;;;;;;;;;; If ( DoOnce2 == 1 ) If ( randomizer == 1 ) If ( player-> getwillpower > 90 ) If ( player-> getwillpower <= 95 ) if ( timer <= 640 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 2 ) If ( player-> getwillpower > 90 ) If ( player-> getwillpower <= 95 ) if ( timer <= 700 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 3 ) If ( player-> getwillpower > 90 ) If ( player-> getwillpower <= 95 ) if ( timer <= 500 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 4 ) If ( player-> getwillpower > 90 ) If ( player-> getwillpower <= 95 ) if ( timer <= 880 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 5 ) If ( player-> getwillpower > 90 ) If ( player-> getwillpower <= 95 ) if ( timer <= 940 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif ;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 96-99;;;;;;;;;;;;;;;;;;;;; If ( DoOnce2 == 1 ) If ( randomizer == 1 ) If ( player-> getwillpower > 95 ) If ( player-> getwillpower <= 99 ) if ( timer <= 900 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 2 ) If ( player-> getwillpower > 95 ) If ( player-> getwillpower <= 99 ) if ( timer <= 1100 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 3 ) If ( player-> getwillpower > 95 ) If ( player-> getwillpower <= 99 ) if ( timer <= 700 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 4 ) If ( player-> getwillpower > 95 ) If ( player-> getwillpower <= 99 ) if ( timer <= 1600 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif If ( DoOnce2 == 1 ) If ( randomizer == 5 ) If ( player-> getwillpower > 95 ) If ( player-> getwillpower <= 99 ) if ( timer <= 1800 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 set randomizer to random 5 endif endif endif endif endif ;;;;;;;;;;;;;;;;;;;;;;For a player with willpower of 100+;;;;;;;;;;;;;;;;;;;;; If ( DoOnce2 == 1 ) If ( player-> getwillpower >= 100 ) if ( timer <= 2500 ) set timer to ( timer + GetSecondsPassed ) else set PCWerewolf to 1 startscript, "Were_BecomeHuman" set timer to 0 set DoOnce2 to 0 endif endif endif ;;;;;;;;;;;;;;;;;;;;;;End of Uncontrollable Transformations;;;;;;;;;;;;;;;;;;;;; if ( RanConfig == 0 ) return endif Set Code to Were_ChangeatWillActivateKey Setx Current to xKeyPressed, Code if ( player-> getwillpower < 80 ) return endif if ( GetMasserPhase == 4 ) return endif ;ADDED BY YACOBY ++++++++++++++++++++++++++++++++++++++++++++++ ;if you want to make this compatible with other mods. Farily easy. ;all lines "player->becomeWerewolf" in this script are replaced by startscript, "Were_BecomeWerewolf" ;all lines "player->undoWerewolf" in this script are replaced by startscript, "Were_UndoWerewolf" if ( scriptrunning, "Were_BecomeLycanthrope" ) return elseif ( scriptrunning, "Were_BecomeHuman" ) return endif ;END ADDED BY YACOBY ++++++++++++++++++++++++++++++++++++++++++++++ if ( menumode == 1 ) return endif if ( Current == 0 ) if ( DoOnce == 1 ) set DoOnce to 0 endif return endif if ( DoOnce == 1 ) return endif set DoOnce to 1 ;________________BEGIN CHANGE INTO WEREWOLF____________________ If ( DoOnce2 == 0 ) if ( MenuMode == 0 ) if ( PCWerewolf == 1 ) set PCWerewolf to -2 endif startscript, "Were_BecomeLycanthrope" Removespell, "Were_Humanbuff" player->AddSpell "werewolf regeneration" Set DoOnce2 to 1 set randomizer to random 5 Return Endif Endif ;________________END CHANGE INTO WEREWOLF__________________ ;______________BEGIN CHANGE OUT OF WEREWOLF________________ If ( DoOnce2 == 1 ) if ( MenuMode == 0 ) startscript, "Were_BecomeHuman" Player->RemoveSpell "werewolf regeneration" if ( PCWerewolf == -2 ) set PCWerewolf to 1 endif Set DoOnce2 to 0 set timer to 0 Return Endif endif ;_______________END CHANGE OUT OF WEREWOLF__________________end
I'm going to look at your changes and additions to the code in a bit and see what I can get working. Thanks for the help cyran. If you think of a more reliable way for this to work I'm all ears.