scripts have a freaking character limit?!

Post » Wed Jun 20, 2012 6:45 pm

Oh my god, I literally just spent the last four hours writing a script that would handle spell memorization in DnD style. It's approximately 100,000 characters long, and the CK is just like "Nope, screw you kid."
GAH!
The script for those interested:
Spoiler

Scriptname DnDSpellChoices extends ReferenceAlias Message Property DnDWantToChangeSpells autoMessage Property DnDSpellLevelChoice autoMessage Property DnDConfirmSpellChoice autoMessage Property DnDAddRemove auto;some testing propertiesGlobalVariable Property DnDSpell1DailyCastsMessage Property DnDSpellLvl1Pg1 autoMessage Property DnDSpellLvl1Pg2 autoMessage Property DnDSpellLvl1Pg3 autoMessage Property DnDSpellLvl2Pg1 autoMessage Property DnDSpellLvl2Pg2 autoMessage Property DnDSpellLvl2Pg3 autoMessage Property DnDSpellLvl3Pg1 autoMessage Property DnDSpellLvl3Pg2 autoMessage Property DnDSpellLvl3Pg3 autoMessage Property DnDSpellLvl4Pg1 autoMessage Property DnDSpellLvl5Pg1 autoMessage Property DnDSpellLvl5Pg1 autoMessage Property DnDSpellLvl7Pg1 autoMessage Property DnDSpellLvl8Pg1 autoMessage Property DnDSpellLvl9Pg1 auto;actual spells;1Spell Property DnDreignofangerSpell autoSpell Property DnDarmorSpell autoSpell Property DnDblindnessSpell autoSpell Property DnDchromaticorbSpell autoSpell Property DnDfistofironSpell autoSpell Property DnDfriendsSpell autoSpell Property DnDidentifySpell autoSpell Property DnDmagicmissileSpell autoSpell Property DnDminorembalmingSpell autoSpell Property DnDpacifySpell autoSpell Property DnDscriptureofsteelSpell autoSpell Property DnDseethingflamesSpell autoSpell Property DnDshieldSpell autoSpell Property DnDsubmergethewillSpell autoSpell Property DnDvilquarseyeSpell auto;2Spell Property DnDadderskissSpell autoSpell Property DnDblackbarbedcurseSpell autoSpell Property DnDbloodbridgeSpell autoSpell Property DnDblurSpell autoSpell Property DnDgreaterembalmingSpell autoSpell Property DnDhorrorSpell autoSpell Property DnDiceknifeSpell autoSpell Property DnDIgnusterrorSpell autoSpell Property DnDinfernalorbSpell autoSpell Property DnDknockSpell autoSpell Property DnDluckSpell autoSpell Property DnDpowerofoneSpell autoSpell Property DnDstrengthSpell autoSpell Property DnDswarmcurseSpell auto;3Spell Property DnDfieryrainSpell autoSpell Property DnDaxeoftormentSpell autoSpell Property DnDbalanceinallthingsSpell autoSpell Property DnDballlightningSpell autoSpell Property DnDcloakofwardingSpell autoSpell Property DnDElisiumstearsSpell autoSpell Property DnDholdundeadSpell autoSpell Property DnDinfernalshieldSpell autoSpell Property DnDvampirictouchSpell autoSpell Property DnDZerthimonsfocusSpell auto;4Spell Property DnDelementalstrikeSpell autoSpell Property DnDblacksphereSpell autoSpell Property DnDconfusionSpell autoSpell Property DnDforcemissilesSpell autoSpell Property DnDimprovedstrengthSpell autoSpell Property DnDremovecurseSpell autoSpell Property DnDshroudofshadowsSpell auto;5Spell Property DnDcloudkillSpell autoSpell Property DnDconeofcoldSpell autoSpell Property DnDdeserthellSpell autoSpell Property DnDEnollEvaduplicationSpell autoSpell Property DnDfireandiceSpell auto;6Spell Property DnDchainlightningstormSpell autoSpell Property DnDglobeofinvulnerabilitySpell auto;7Spell Property DnDacidstormSpell autoSpell Property DnDbladestormSpell autoSpell Property DnDStygianicestormSpell auto;8Spell Property DnDdeathboltSpell autoSpell Property DnDMechanuscannonSpell autoSpell Property DnDmeteorstormbombardmentSpell autoSpell Property DnDpowerwordblindSpell auto;9Spell Property DnDabyssalfurySpell autoSpell Property DnDcelestialhostSpell autoSpell Property DnDpowerwordkillSpell auto;the add/remove messages for each [censored] spellMessage Property DnDreignofangerAddRemove autoMessage Property DnDarmorAddRemove autoMessage Property DnDblindnessAddRemove autoMessage Property DnDchromaticorbAddRemove autoMessage Property DnDfistofironAddRemove autoMessage Property DnDfriendsAddRemove autoMessage Property DnDidentifyAddRemove autoMessage Property DnDmagicmissileAddRemove autoMessage Property DnDminorembalmingAddRemove autoMessage Property DnDpacifyAddRemove autoMessage Property DnDscriptureofsteelAddRemove autoMessage Property DnDseethingflamesAddRemove autoMessage Property DnDshieldAddRemove autoMessage Property DnDsubmergethewillAddRemove autoMessage Property DnDvilquarseyeAddRemove auto;2Message Property DnDadderskissAddRemove autoMessage Property DnDblackbarbedcurseAddRemove autoMessage Property DnDbloodbridgeAddRemove autoMessage Property DnDblurAddRemove autoMessage Property DnDgreaterembalmingAddRemove autoMessage Property DnDhorrorAddRemove autoMessage Property DnDiceknifeAddRemove autoMessage Property DnDIgnusterrorAddRemove autoMessage Property DnDinfernalorbAddRemove autoMessage Property DnDknockAddRemove autoMessage Property DnDluckAddRemove autoMessage Property DnDpowerofoneAddRemove autoMessage Property DnDstrengthAddRemove autoMessage Property DnDswarmcurseAddRemove auto;3Message Property DnDfieryrainAddRemove autoMessage Property DnDaxeoftormentAddRemove autoMessage Property DnDbalanceinallthingsAddRemove autoMessage Property DnDballlightningAddRemove autoMessage Property DnDcloakofwardingAddRemove autoMessage Property DnDElisiumstearsAddRemove autoMessage Property DnDholdundeadAddRemove autoMessage Property DnDinfernalshieldAddRemove autoMessage Property DnDvampirictouchAddRemove autoMessage Property DnDZerthimonsfocusAddRemove auto;4Message Property DnDelementalstrikeAddRemove autoMessage Property DnDblacksphereAddRemove autoMessage Property DnDconfusionAddRemove autoMessage Property DnDforcemissilesAddRemove autoMessage Property DnDimprovedstrengthAddRemove autoMessage Property DnDremovecurseAddRemove autoMessage Property DnDshroudofshadowsAddRemove auto;5Message Property DnDcloudkillAddRemove autoMessage Property DnDconeofcoldAddRemove autoMessage Property DnDdeserthellAddRemove autoMessage Property DnDEnollEvaduplicationAddRemove autoMessage Property DnDfireandiceAddRemove auto;6Message Property DnDchainlightningstormAddRemove autoMessage Property DnDglobeofinvulnerabilityAddRemove auto;7Message Property DnDacidstormAddRemove autoMessage Property DnDbladestormAddRemove autoMessage Property DnDStygianicestormAddRemove auto;8Message Property DnDdeathboltAddRemove autoMessage Property DnDMechanuscannonAddRemove autoMessage Property DnDmeteorstormbombardmentAddRemove autoMessage Property DnDpowerwordblindAddRemove auto;9Message Property DnDabyssalfuryAddRemove autoMessage Property DnDcelestialhostAddRemove autoMessage Property DnDpowerwordkillAddRemove auto;1GlobalVariable Property DnDreignofangerDailyCasts autoGlobalVariable Property DnDarmorDailyCasts autoGlobalVariable Property DnDblindnessDailyCasts autoGlobalVariable Property DnDchromaticorbDailyCasts autoGlobalVariable Property DnDfistofironDailyCasts autoGlobalVariable Property DnDfriendsDailyCasts autoGlobalVariable Property DnDidentifyDailyCasts autoGlobalVariable Property DnDmagicmissileDailyCasts autoGlobalVariable Property DnDminorembalmingDailyCasts autoGlobalVariable Property DnDpacifyDailyCasts autoGlobalVariable Property DnDscriptureofsteelDailyCasts autoGlobalVariable Property DnDseethingflamesDailyCasts autoGlobalVariable Property DnDshieldDailyCasts autoGlobalVariable Property DnDsubmergethewillDailyCasts autoGlobalVariable Property DnDvilquarseyeDailyCasts auto;2GlobalVariable Property DnDadderskissDailyCasts autoGlobalVariable Property DnDblackbarbedcurseDailyCasts autoGlobalVariable Property DnDbloodbridgeDailyCasts autoGlobalVariable Property DnDblurDailyCasts autoGlobalVariable Property DnDgreaterembalmingDailyCasts autoGlobalVariable Property DnDhorrorDailyCasts autoGlobalVariable Property DnDiceknifeDailyCasts autoGlobalVariable Property DnDIgnusterrorDailyCasts autoGlobalVariable Property DnDinfernalorbDailyCasts autoGlobalVariable Property DnDknockDailyCasts autoGlobalVariable Property DnDluckDailyCasts autoGlobalVariable Property DnDpowerofoneDailyCasts autoGlobalVariable Property DnDstrengthDailyCasts autoGlobalVariable Property DnDswarmcurseDailyCasts auto;3GlobalVariable Property DnDfieryrainDailyCasts autoGlobalVariable Property DnDaxeoftormentDailyCasts autoGlobalVariable Property DnDbalanceinallthingsDailyCasts autoGlobalVariable Property DnDballlightningDailyCasts autoGlobalVariable Property DnDcloakofwardingDailyCasts autoGlobalVariable Property DnDElisiumstearsDailyCasts autoGlobalVariable Property DnDholdundeadDailyCasts autoGlobalVariable Property DnDinfernalshieldDailyCasts autoGlobalVariable Property DnDvampirictouchDailyCasts autoGlobalVariable Property DnDZerthimonsfocusDailyCasts auto;4GlobalVariable Property DnDelementalstrikeDailyCasts autoGlobalVariable Property DnDblacksphereDailyCasts autoGlobalVariable Property DnDconfusionDailyCasts autoGlobalVariable Property DnDforcemissilesDailyCasts autoGlobalVariable Property DnDimprovedstrengthDailyCasts autoGlobalVariable Property DnDremovecurseDailyCasts autoGlobalVariable Property DnDshroudofshadowsDailyCasts auto;5GlobalVariable Property DnDcloudkillDailyCasts autoGlobalVariable Property DnDconeofcoldDailyCasts autoGlobalVariable Property DnDdeserthellDailyCasts autoGlobalVariable Property DnDEnollEvaduplicationDailyCasts autoGlobalVariable Property DnDfireandiceDailyCasts auto;6GlobalVariable Property DnDchainlightningstormDailyCasts autoGlobalVariable Property DnDglobeofinvulnerabilityDailyCasts auto;7GlobalVariable Property DnDacidstormDailyCasts autoGlobalVariable Property DnDbladestormDailyCasts autoGlobalVariable Property DnDStygianicestormDailyCasts auto;8GlobalVariable Property DnDdeathboltDailyCasts autoGlobalVariable Property DnDMechanuscannonDailyCasts autoGlobalVariable Property DnDmeteorstormbombardmentDailyCasts autoGlobalVariable Property DnDpowerwordblindDailyCasts auto;9GlobalVariable Property DnDabyssalfuryDailyCasts autoGlobalVariable Property DnDcelestialhostDailyCasts autoGlobalVariable Property DnDpowerwordkillDailyCasts auto;casts remaining;1GlobalVariable Property DnDreignofangerDailyCastsR autoGlobalVariable Property DnDarmorDailyCastsR autoGlobalVariable Property DnDblindnessDailyCastsR autoGlobalVariable Property DnDchromaticorbDailyCastsR autoGlobalVariable Property DnDfistofironDailyCastsR autoGlobalVariable Property DnDfriendsDailyCastsR autoGlobalVariable Property DnDidentifyDailyCastsR autoGlobalVariable Property DnDmagicmissileDailyCastsR autoGlobalVariable Property DnDminorembalmingDailyCastsR autoGlobalVariable Property DnDpacifyDailyCastsR autoGlobalVariable Property DnDscriptureofsteelDailyCastsR autoGlobalVariable Property DnDseethingflamesDailyCastsR autoGlobalVariable Property DnDshieldDailyCastsR autoGlobalVariable Property DnDsubmergethewillDailyCastsR autoGlobalVariable Property DnDvilquarseyeDailyCastsR auto;2GlobalVariable Property DnDadderskissDailyCastsR autoGlobalVariable Property DnDblackbarbedcurseDailyCastsR autoGlobalVariable Property DnDbloodbridgeDailyCastsR autoGlobalVariable Property DnDblurDailyCastsR autoGlobalVariable Property DnDgreaterembalmingDailyCastsR autoGlobalVariable Property DnDhorrorDailyCastsR autoGlobalVariable Property DnDiceknifeDailyCastsR autoGlobalVariable Property DnDIgnusterrorDailyCastsR autoGlobalVariable Property DnDinfernalorbDailyCastsR autoGlobalVariable Property DnDknockDailyCastsR autoGlobalVariable Property DnDluckDailyCastsR autoGlobalVariable Property DnDpowerofoneDailyCastsR autoGlobalVariable Property DnDstrengthDailyCastsR autoGlobalVariable Property DnDswarmcurseDailyCastsR auto;3GlobalVariable Property DnDfieryrainDailyCastsR autoGlobalVariable Property DnDaxeoftormentDailyCastsR autoGlobalVariable Property DnDbalanceinallthingsDailyCastsR autoGlobalVariable Property DnDballlightningDailyCastsR autoGlobalVariable Property DnDcloakofwardingDailyCastsR autoGlobalVariable Property DnDElisiumstearsDailyCastsR autoGlobalVariable Property DnDholdundeadDailyCastsR autoGlobalVariable Property DnDinfernalshieldDailyCastsR autoGlobalVariable Property DnDvampirictouchDailyCastsR autoGlobalVariable Property DnDZerthimonsfocusDailyCastsR auto;4GlobalVariable Property DnDelementalstrikeDailyCastsR autoGlobalVariable Property DnDblacksphereDailyCastsR autoGlobalVariable Property DnDconfusionDailyCastsR autoGlobalVariable Property DnDforcemissilesDailyCastsR autoGlobalVariable Property DnDimprovedstrengthDailyCastsR autoGlobalVariable Property DnDremovecurseDailyCastsR autoGlobalVariable Property DnDshroudofshadowsDailyCastsR auto;5GlobalVariable Property DnDcloudkillDailyCastsR autoGlobalVariable Property DnDconeofcoldDailyCastsR autoGlobalVariable Property DnDdeserthellDailyCastsR autoGlobalVariable Property DnDEnollEvaduplicationDailyCastsR autoGlobalVariable Property DnDfireandiceDailyCastsR auto;6GlobalVariable Property DnDchainlightningstormDailyCastsR autoGlobalVariable Property DnDglobeofinvulnerabilityDailyCastsR auto;7GlobalVariable Property DnDacidstormDailyCastsR autoGlobalVariable Property DnDbladestormDailyCastsR autoGlobalVariable Property DnDStygianicestormDailyCastsR auto;8GlobalVariable Property DnDdeathboltDailyCastsR autoGlobalVariable Property DnDMechanuscannonDailyCastsR autoGlobalVariable Property DnDmeteorstormbombardmentDailyCastsR autoGlobalVariable Property DnDpowerwordblindDailyCastsR auto;9GlobalVariable Property DnDabyssalfuryDailyCastsR autoGlobalVariable Property DnDcelestialhostDailyCastsR autoGlobalVariable Property DnDpowerwordkillDailyCastsR autoFaction Property DnDLvl1SpellSlotsRemaining  autoFaction Property DnDLvl2SpellSlotsRemaining  autoFaction Property DnDLvl3SpellSlotsRemaining  autoFaction Property DnDLvl4SpellSlotsRemaining  autoFaction Property DnDLvl5SpellSlotsRemaining  autoFaction Property DnDLvl5SpellSlotsRemaining  autoFaction Property DnDLvl7SpellSlotsRemaining  autoFaction Property DnDLvl8SpellSlotsRemaining  autoFaction Property DnDLvl9SpellSlotsRemaining  autoevent OnUpdate()   Actor SpellLearner = ((self as referencealias).GetReference() as actor)   int WantToButton = DnDWantToChangeSpells.Show()   if WantToButton!=-1	  if WantToButton==0		 SpellLevelChoice()	  endIf	  if WantToButton==1		 ConfirmChoice()	  endIf   endIfendEventfunction SpellLevelChoice()    int LevelChoice=DnDSpellLevelChoice.Show()  if  LevelChoice!=-1    if  LevelChoice==0	    ConfirmChoice()    endIf    if  LevelChoice==1	 SpellLvl1Pg1()endIfif  LevelChoice==2	 SpellLvl2Pg1()endIfif  LevelChoice==3	 SpellLvl3Pg1()endIfif  LevelChoice==4	 SpellLvl4Pg1()endIfif  LevelChoice==5	 SpellLvl5Pg1()endIfif  LevelChoice==6	 SpellLvl5Pg1()endIf if  LevelChoice==7	 SpellLvl7Pg1()endIfif  LevelChoice==8	 SpellLvl8Pg1()endIfif  LevelChoice==9	 SpellLvl9Pg1()endIf  endIfendFunctionfunction SpellLvl1Pg1()int SpellChoiceButton=DnDSpellLvl1Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  ;   endIf    if SpellChoiceButton==2	  SpellLvl1Pg2()   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg1()   endIf	  if SpellChoiceButton==4		    int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg1()   endIf	  if SpellChoiceButton==5		    int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg1()   endIf	  if SpellChoiceButton==6		    int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg1()   endIf	  if SpellChoiceButton==7		   int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg1()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg1()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg1()   endIfendIfendFunctionfunction SpellLvl1Pg2()int SpellChoiceButton=DnDSpellLvl1Pg2.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  SpellLvl1Pg1()   endIf    if SpellChoiceButton==2	  SpellLvl1Pg3()   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg2()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg2()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg2()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg2()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg2()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg2()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg2()   endIfendIfendFunctionfunction SpellLvl1Pg3()int SpellChoiceButton=DnDSpellLvl1Pg3.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  SpellLvl1Pg2()   endIf    if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg3()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg3()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg3()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg3()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg3()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg3()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl1SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl1SpellSlotsRemaining) as int)+1))  endIf   SpellLvl1Pg3()   endIfendIfendFunctionfunction SpellLvl2Pg1()int SpellChoiceButton=DnDSpellLvl2Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  ;   endIf    if SpellChoiceButton==2	  SpellLvl2Pg2()   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg1()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg1()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg1()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg1()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg1()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg1()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg1()   endIfendIfendFunctionfunction SpellLvl2Pg2()int SpellChoiceButton=DnDSpellLvl2Pg2.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  SpellLvl2Pg1()   endIf    if SpellChoiceButton==2	  SpellLvl2Pg3()   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg2()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg2()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg2()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg2()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl2Pg2()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf  SpellLvl2Pg2()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf  SpellLvl2Pg2()   endIfendIfendFunctionfunction SpellLvl2Pg3()int SpellChoiceButton=DnDSpellLvl2Pg3.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  SpellLvl2Pg2()   endIf    if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf  SpellLvl2Pg3()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf  SpellLvl2Pg3()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf  SpellLvl2Pg3()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf  SpellLvl2Pg3()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIf  endIf  SpellLvl2Pg3()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIfendIf  SpellLvl2Pg3()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl2SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl2SpellSlotsRemaining) as int)+1))  endIf  SpellLvl2Pg3()   endIfendIfendFunctionfunction SpellLvl3Pg2()int SpellChoiceButton=DnDSpellLvl3Pg2.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  SpellLvl3Pg1()   endIf    if SpellChoiceButton==2	  SpellLvl3Pg3()   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl3Pg2()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl3Pg2()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl3Pg2()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl3Pg2()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl3Pg2()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl3Pg2()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl3Pg2()   endIfendIfendFunctionfunction SpellLvl3Pg3()int SpellChoiceButton=DnDSpellLvl3Pg3.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  SpellLvl3Pg2()   endIf    if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl3Pg3()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl3Pg3()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl3Pg3()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl3Pg3()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl3Pg3()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl3Pg3()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl3SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl3SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl3Pg3()   endIfendIfendFunctionfunction SpellLvl4Pg1()int SpellChoiceButton=DnDSpellLvl4Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  ;   endIf    if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl4Pg1()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl4Pg1()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl4Pg1()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl4Pg1()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl4Pg1()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl4Pg1()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl4SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl4SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl4Pg1()   endIfendIfendFunctionfunction SpellLvl5Pg1()int SpellChoiceButton=DnDSpellLvl5Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  ;   endIf    if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl5Pg1()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl5Pg1()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl5Pg1()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl5Pg1()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl5Pg1()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl5Pg1()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl5SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl5SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl5Pg1()   endIfendIfendFunctionfunction SpellLvl6Pg1()int SpellChoiceButton=DnDSpellLvl6Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  ;   endIf    if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl6Pg1()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl6Pg1()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl6Pg1()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl6Pg1()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl6Pg1()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl6Pg1()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl6SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl6SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl6Pg1()   endIfendIfendFunctionffunction SpellLvl7Pg1()int SpellChoiceButton=DnDSpellLvl7Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  ;   endIf    if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl7Pg1()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl7Pg1()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl7Pg1()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl7Pg1()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl7Pg1()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl7Pg1()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl7SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl7SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl7Pg1()   endIfendIfendFunctionfunction SpellLvl8Pg1()int SpellChoiceButton=DnDSpellLvl8Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  ;   endIf    if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl8Pg1()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl8Pg1()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl8Pg1()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl8Pg1()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl8Pg1()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl8Pg1()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl8SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl8SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl8Pg1()   endIfendIfendFunctionffunction SpellLvl9Pg1()int SpellChoiceButton=DnDSpellLvl9Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf    if SpellChoiceButton==1	  ;   endIf    if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl9Pg1()   endIf	  if SpellChoiceButton==4	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl9Pg1()   endIf	  if SpellChoiceButton==5	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl9Pg1()   endIf	  if SpellChoiceButton==6	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+1))  endIfendIf   SpellLvl9Pg1()   endIf	  if SpellChoiceButton==7	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl9Pg1()   endIf	  if SpellChoiceButton==8	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl9Pg1()   endIf	  if SpellChoiceButton==9	  int AddRemoveButton = DnDAddRemove.Show()   if AddRemoveButton!=-1	 if AddRemoveButton==0	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+-1))  endIf	 if AddRemoveButton==1	 DnDSpell1DailyCasts.SetValue((DnDSpell1DailyCasts.GetValue() as int)+-1)		   SpellLearner.SetFactionRank(DnDLvl9SpellSlotsRemaining, ((SpellLearner.GetFactionRank(DnDLvl9SpellSlotsRemaining) as int)+1))  endIfendIfSpellLvl9Pg1()   endIfendIfendFunctionfunction ConfirmChoice();1DnDreignofangerDailyCastsR.SetValue(DnDreignofangerDailyCasts.GetValue() as int)DnDarmorDailyCastsR.SetValue(DnDarmorDailyCasts.GetValue() as int)DnDblindnessDailyCastsR.SetValue(DnDblindnessDailyCasts.GetValue() as int)DnDchromaticorbDailyCastsR.SetValue(DnDchromaticorbDailyCasts.GetValue() as int)DnDfistofironDailyCastsR.SetValue(DnDfistofironDailyCasts.GetValue() as int)DnDfriendsDailyCastsR.SetValue(DnDfriendsDailyCasts.GetValue() as int)DnDidentifyDailyCastsR.SetValue(DnDidentifyDailyCasts.GetValue() as int)DnDmagicmissileDailyCastsR.SetValue(DnDmagicmissileDailyCasts.GetValue() as int)DnDminorembalmingDailyCastsR.SetValue(DnDminorembalmingDailyCasts.GetValue() as int)DnDpacifyDailyCastsR.SetValue(DnDpacifyDailyCasts.GetValue() as int)DnDscriptureofsteelDailyCastsR.SetValue(DnDscriptureofsteelDailyCasts.GetValue() as int)DnDseethingflamesDailyCastsR.SetValue(DnDseethingflamesDailyCasts.GetValue() as int)DnDshieldDailyCastsR.SetValue(DnDshieldDailyCastsR.GetValue() as int)DnDsubmergethewillDailyCastsR.SetValue(DnDsubmergethewillDailyCasts.GetValue() as int)DnDvilquarseyeDailyCastsR.SetValue(DnDvilquarseyeDailyCasts.GetValue() as int);2DnDadderskissDailyCastsR.SetValue(DnDadderskissDailyCasts.GetValue() as int)DnDblackbarbedcurseDailyCastsR.SetValue(DnDblackbarbedcurseDailyCasts.GetValue() as int)DnDbloodbridgeDailyCastsR.SetValue(DnDbloodbridgeDailyCasts.GetValue() as int)DnDblurDailyCastsR.SetValue(DnDblurDailyCasts.GetValue() as int)DnDgreaterembalmingDailyCastsR.SetValue(DnDgreaterembalmingDailyCasts.GetValue() as int)DnDhorrorDailyCastsR.SetValue(DnDhorrorDailyCasts.GetValue() as int)DnDiceknifeDailyCastsR.SetValue(DnDiceknifeDailyCasts.GetValue() as int)DnDIgnusterrorDailyCastsR.SetValue(DnDIgnusterrorDailyCasts.GetValue() as int)DnDinfernalorbDailyCastsR.SetValue(DnDinfernalorbDailyCasts.GetValue() as int)DnDknockDailyCastsR.SetValue(DnDknockDailyCasts.GetValue() as int)DnDluckDailyCastsR.SetValue(DnDluckDailyCasts.GetValue() as int)DnDpowerofoneDailyCastsR.SetValue(DnDpowerofoneDailyCasts.GetValue() as int)DnDstrengthDailyCastsR.SetValue(DnDstrengthDailyCasts.GetValue() as int)DnDswarmcurseDailyCastsR.SetValue(DnDswarmcurseDailyCasts.GetValue() as int);3DnDfieryrainDailyCastsR.SetValue(DnDfieryrainDailyCasts.GetValue() as int)DnDaxeoftormentDailyCastsR.SetValue(DnDaxeoftormentDailyCasts.GetValue() as int)DnDbalanceinallthingsDailyCastsR.SetValue(DnDbalanceinallthingsDailyCasts.GetValue() as int)DnDballlightningDailyCastsR.SetValue(DnDballlightningDailyCasts.GetValue() as int)DnDcloakofwardingDailyCastsR.SetValue(DnDcloakofwardingDailyCasts.GetValue() as int)DnDElisiumstearsDailyCastsR.SetValue(DnDElisiumstearsDailyCasts.GetValue() as int)DnDholdundeadDailyCastsR.SetValue(DnDholdundeadDailyCasts.GetValue() as int)DnDinfernalshieldDailyCastsR.SetValue(DnDinfernalshieldDailyCasts.GetValue() as int)DnDvampirictouchDailyCastsR.SetValue(DnDvampirictouchDailyCasts.GetValue() as int)DnDZerthimonsfocusDailyCastsR.SetValue(DnDZerthimonsfocusDailyCasts.GetValue() as int);4DnDelementalstrikeDailyCastsR.SetValue(DnDelementalstrikeDailyCasts.GetValue() as int)DnDblacksphereDailyCastsR.SetValue(DnDblacksphereDailyCasts.GetValue() as int)DnDconfusionDailyCastsR.SetValue(DnDconfusionDailyCasts.GetValue() as int)DnDforcemissilesDailyCastsR.SetValue(DnDforcemissilesDailyCasts.GetValue() as int)DnDimprovedstrengthDailyCastsR.SetValue(DnDimprovedstrengthDailyCasts.GetValue() as int)DnDremovecurseDailyCastsR.SetValue(DnDremovecurseDailyCasts.GetValue() as int)DnDshroudofshadowsDailyCastsR.SetValue(DnDshroudofshadowsDailyCasts.GetValue() as int);5DnDcloudkillDailyCastsR.SetValue(DnDcloudkillDailyCasts.GetValue() as int)DnDconeofcoldDailyCastsR.SetValue(DnDconeofcoldDailyCasts.GetValue() as int)DnDdeserthellDailyCastsR.SetValue(DnDdeserthellDailyCasts.GetValue() as int)DnDEnollEvaduplicationDailyCastsR.SetValue(DnDEnollEvaduplicationDailyCasts.GetValue() as int)DnDfireandiceDailyCastsR.SetValue(DnDfireandiceDailyCasts.GetValue() as int);6DnDchainlightningstormDailyCastsR.SetValue(DnDchainlightningstormDailyCasts.GetValue() as int)DnDglobeofinvulnerabilityDailyCastsR.SetValue(DnDglobeofinvulnerabilityDailyCasts.GetValue() as int);7DnDacidstormDailyCastsR.SetValue(DnDacidstormDailyCasts.GetValue() as int)DnDbladestormDailyCastsR.SetValue(DnDbladestormDailyCasts.GetValue() as int)DnDStygianicestormDailyCastsR.SetValue(DnDStygianicestormDailyCasts.GetValue() as int);8DnDdeathboltDailyCastsR.SetValue(DnDdeathboltDailyCasts.GetValue() as int)DnDMechanuscannonDailyCastsR.SetValue(DnDMechanuscannonDailyCasts.GetValue() as int)DnDmeteorstormbombardmentDailyCastsR.SetValue(DnDmeteorstormbombardmentDailyCasts.GetValue() as int)DnDpowerwordblindDailyCastsR.SetValue(DnDpowerwordblindDailyCasts.GetValue() as int);9DnDabyssalfuryDailyCastsR.SetValue(DnDabyssalfuryDailyCasts.GetValue() as int)DnDcelestialhostDailyCastsR.SetValue(DnDcelestialhostDailyCasts.GetValue() as int)DnDpowerwordkillDailyCastsR.SetValue(DnDpowerwordkillDailyCasts.GetValue() as int)endFunction;now that the daily casts remaining has been set to be equal to your daily casts preferences, we must add spells;to the character, because they may have been removed beforeif DnDreignofangerDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDreignofangerSpell)==0   SpellLearner.addSpell(DnDreignofangerSpell)  endIfif DnDarmorDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDarmorSpell)==0   SpellLearner.addSpell(DnDarmorSpell)  endIfif DnDblindnessDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDblindnessSpell)==0   SpellLearner.addSpell(DnDblindnessSpell)  endIfif DnDchromaticorbDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDchromaticorbSpell)==0   SpellLearner.addSpell(DnDchromaticorbSpell)  endIfif DnDfistofironDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDfistofironSpell)==0   SpellLearner.addSpell(DnDfistofironSpell)  endIfif DnDfriendsDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDfriendsSpell)==0   SpellLearner.addSpell(DnDfriendsSpell)   endIfif DnDidentifyDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDidentifySpell)==0   SpellLearner.addSpell(DnDidentifySpell)  endIfif DnDmagicmissileDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDmagicmissileSpell)==0   SpellLearner.addSpell(DnDmagicmissileSpell)  endIfif DnDminorembalmingDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDminorembalmingSpell)==0   SpellLearner.addSpell(DnDminorembalmingSpell)  endIfif DnDpacifyDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDpacifySpell)==0   SpellLearner.addSpell(DnDpacifySpell)  endIfif DnDscriptureofsteelDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDscriptureofsteelSpell)==0   SpellLearner.addSpell(DnDscriptureofsteelSpell)  endIfif DnDseethingflamesDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDseethingflamesSpell)==0   SpellLearner.addSpell(DnDseethingflamesSpell)  endIfif DnDshieldDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDshieldSpell)==0   SpellLearner.addSpell(DnDshieldSpell)  endIfif DnDsubmergethewillDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDsubmergethewillSpell)==0   SpellLearner.addSpell(DnDsubmergethewillSpell)  endIfif DnDvilquarseyeDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDvilquarseyeSpell)==0   SpellLearner.addSpell(DnDvilquarseyeSpell)  endIf;2if DnDadderskissDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDadderskissSpell)==0   SpellLearner.addSpell(DnDadderskissSpell)  endIfif DnDblackbarbedcurseDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDblackbarbedcurseSpell)==0   SpellLearner.addSpell(DnDblackbarbedcurseSpell)  endIfif DnDbloodbridgeDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDbloodbridgeSpell)==0   SpellLearner.addSpell(DnDbloodbridgeSpell)  endIfif DnDblurDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDblurSpell)==0   SpellLearner.addSpell(DnDblurSpell)  endIfif DnDgreaterembalmingDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDgreaterembalmingSpell)==0   SpellLearner.addSpell(DnDgreaterembalmingSpell)  endIfif DnDhorrorDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDhorrorSpell)==0   SpellLearner.addSpell(DnDhorrorSpell)  endIfif DnDiceknifeDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDiceknifeSpell)==0   SpellLearner.addSpell(DnDiceknifeSpell)  endIfif DnDIgnusterrorDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDIgnusterrorSpell)==0   SpellLearner.addSpell(DnDIgnusterrorSpell)  endIfif DnDinfernalorbDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDinfernalorbSpell)==0   SpellLearner.addSpell(DnDinfernalorbSpell)  endIfif DnDknockDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDknockSpell)==0   SpellLearner.addSpell(DnDknockSpell)  endIfif DnDluckDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDluckSpell)==0   SpellLearner.addSpell(DnDluckSpell)  endIfif DnDpowerofoneDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDpowerofoneSpell)==0   SpellLearner.addSpell(DnDpowerofoneSpell)  endIfif DnDstrengthDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDstrengthSpell)==0   SpellLearner.addSpell(DnDstrengthSpell)  endIfif DnDswarmcurseDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDswarmcurseSpell)==0   SpellLearner.addSpell(DnDswarmcurseSpell)  endIf;3if DnDfieryrainDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDfieryrainSpell)==0   SpellLearner.addSpell(DnDfieryrainSpell)  endIfif DnDaxeoftormentDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDaxeoftormentSpell)==0   SpellLearner.addSpell(DnDaxeoftormentSpell)  endIfif DnDbalanceinallthingsDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDbalanceinallthingsSpell)==0   SpellLearner.addSpell(DnDbalanceinallthingsSpell)  endIfif DnDballlightningDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDballlightningSpell)==0   SpellLearner.addSpell(DnDballlightningSpell)  endIfif DnDcloakofwardingDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDcloakofwardingSpell)==0   SpellLearner.addSpell(DnDcloakofwardingSpell)  endIfif DnDElisiumstearsDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDElisiumstearsSpell)==0   SpellLearner.addSpell(DnDElisiumstearsSpell)  endIfif DnDholdundeadDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDholdundeadSpell)==0   SpellLearner.addSpell(DnDholdundeadSpell)  endIfif DnDinfernalshieldDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDinfernalSpell)==0   SpellLearner.addSpell(DnDinfernalSpell)  endIfif DnDvampirictouchDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDvampirictouchSpell)==0   SpellLearner.addSpell(DnDvampirictouchSpell)  endIfif DnDZerthimonsfocusDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDZerthimonsfocusSpell)==0   SpellLearner.addSpell(DnDZerthimonsfocusSpell)  endIf;4if DnDelementalstrikeDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDelementalstrikeSpell)==0   SpellLearner.addSpell(DnDelementalstrikeSpell)  endIfif DnDblacksphereDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDblacksphereSpell)==0   SpellLearner.addSpell(DnDblacksphereSpell)  endIfif DnDconfusionDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDconfusionSpell)==0   SpellLearner.addSpell(DnDconfusionSpell)  endIfif DnDforcemissilesDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDforcemissilesSpell)==0   SpellLearner.addSpell(DnDforcemissilesSpell)  endIfif DnDimprovedstrengthDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDimprovedstrengthSpell)==0   SpellLearner.addSpell(DnDimprovedstrengthSpell)  endIfif DnDremovecurseDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDremovecurseSpell)==0   SpellLearner.addSpell(DnDremovecurseSpell)  endIfif DnDshroudofshadowsDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDshroudofshadowsSpell)==0   SpellLearner.addSpell(DnDshroudofshadowsSpell)  endIf;5if DnDcloudkillDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDcloudkillSpell)==0   SpellLearner.addSpell(DnDcloudkillSpell)  endIfif DnDconeofcoldDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDconeofcoldSpell)==0   SpellLearner.addSpell(DnDconeofcoldSpell)  endIfif DnDdeserthellDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDdeserthellSpell)==0   SpellLearner.addSpell(DnDdeserthellSpell)  endIfif DnDEnollEvaduplicationDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDEnollEvaduplicationSpell)==0   SpellLearner.addSpell(DnDEnollEvaduplicationSpell)  endIfif DnDfireandiceDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDfireandiceSpell)==0   SpellLearner.addSpell(DnDfireandiceSpell)  endIf;6if DnDchainlightningstormDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(Spell)==0   SpellLearner.addSpell(Spell)  endIfif DnDglobeofinvulnerabilityDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(Spell)==0   SpellLearner.addSpell(Spell)  endIf;7if DnDacidstormDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDacidstormSpell)==0   SpellLearner.addSpell(DnDacidstormSpell)  endIfif DnDbladestormDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDbladestormSpell)==0   SpellLearner.addSpell(DnDbladestormSpell)  endIfif DnDStygianicestormDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDStygianicestormSpell)==0   SpellLearner.addSpell(DnDStygianicestormSpell)  endIf;8if DnDdeathboltDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDdeathboltSpell)==0   SpellLearner.addSpell(DnDdeathboltSpell)  endIfif DnDMechanuscannonDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDMechanuscannonSpell)==0   SpellLearner.addSpell(DnDMechanuscannonSpell)  endIfif DnDmeteorstormbombardmentDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDmeteorstormbombardmentSpell)==0   SpellLearner.addSpell(DnDmeteorstormbombardmentSpell)  endIfif DnDpowerwordblindDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDpowerwordblindSpell)==0   SpellLearner.addSpell(DnDpowerwordblindSpell)  endIf;9if DnDabyssalfuryDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDabyssalfurySpell)==0   SpellLearner.addSpell(DnDabyssalfurySpell)  endIfif DnDcelestialhostDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDcelestialhostSpell)==0   SpellLearner.addSpell(DnDcelestialhostSpell)  endIfif DnDpowerwordkillDailyCastsR.GetValue() as int>=1 && SpellLearner.HasSpell(DnDpowerwordkillSpell)==0   SpellLearner.addSpell(DnDpowerwordkillSpell)  endIfendFunction
User avatar
Zach Hunter
 
Posts: 3444
Joined: Wed Aug 08, 2007 3:26 pm

Post » Wed Jun 20, 2012 2:15 pm

:huh:
User avatar
Josee Leach
 
Posts: 3371
Joined: Tue Dec 26, 2006 10:50 pm

Post » Wed Jun 20, 2012 10:09 pm

2300 lines of code down the drain unless I can think of a workaround. I'm taking a well-earned break methinks.
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Wed Jun 20, 2012 12:30 pm

Have you tried opening the script in an external editor? The built-in editor won't open files beyond a certain length, but editing and compiling code in an external editor allows for longer scripts.
User avatar
Alessandra Botham
 
Posts: 3440
Joined: Mon Nov 13, 2006 6:27 pm

Post » Wed Jun 20, 2012 10:04 pm

Did the papyrus compiler give you the error or the CK?
If its the CK, screw it, its a horrible text editor anyway, use Sublime Text 2 - the very best text editor.

Also you can make your script shorter, there seem to be a lot of very similar blocks - to me that looks like copy-&-paste code, almost unreadable - use more functions and give them descriptive names.
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Wed Jun 20, 2012 10:55 pm

Easy to work around. Import your functions from elsewhere, right?
User avatar
sara OMAR
 
Posts: 3451
Joined: Wed Jul 05, 2006 11:18 pm

Post » Wed Jun 20, 2012 1:57 pm

I didnt check deeply, but, there is a lot of redundant stuff in there... you can propably use function and formlist etc to simplify your code (and lisibility)
User avatar
Steph
 
Posts: 3469
Joined: Sun Nov 19, 2006 7:44 am

Post » Wed Jun 20, 2012 6:54 pm

Xetrill is right... your script could be a lot shorter. Have you looked into arrays or formlists yet? Your whole ConfirmChoice() function could be simplified to this:

Function ConfirmChoice()	GlobalVariable MyGlobal01	GlobalVariable MyGlobal02	int index = MyFormList01.GetSize()	while (index > 0)		index -= 1		MyGlobal01 = MyFormList01.GetAt(index) as GlobalVariable		MyGlobal02 = MyFormList02.GetAt(index) as GlobalVariable		MyGlobal01.SetValue(MyGlobal02.GetValue() as Int)	endwhileEndFunction

EDIT: Just noticed that those were actually different global variables, so you'd need two formlists.
User avatar
Leonie Connor
 
Posts: 3434
Joined: Mon Mar 12, 2007 4:18 pm

Post » Wed Jun 20, 2012 4:57 pm

Had no idea Formlists could be used like that. Welp, time to re-write this mother.
I don't like arrays in Papyrus, just have a distaste for them. But yeah, definitely gonna use the FormList thing.

Also, I wrote this in Notepad++. So can I just save it as a .psc or something to make it work, or...?
User avatar
le GraiN
 
Posts: 3436
Joined: Thu Mar 22, 2007 6:48 pm

Post » Thu Jun 21, 2012 12:47 am

You will need to set up the quick compile in order to compile it in Notepad++.

http://www.creationkit.com/Notepad%2B%2B_Setup
User avatar
Sunnii Bebiieh
 
Posts: 3454
Joined: Wed Apr 11, 2007 7:57 pm

Post » Wed Jun 20, 2012 1:04 pm

You will need to set up the quick compile in order to compile it in Notepad++.

http://www.creationkit.com/Notepad%2B%2B_Setup

Thanks guys, shame I need to re-write this, but it will be much cleaner after I do.
User avatar
Kit Marsden
 
Posts: 3467
Joined: Thu Jul 19, 2007 2:19 pm

Post » Wed Jun 20, 2012 8:04 pm

OMG yes you need to use Notepad++. I hate [censored] and I try really hard not to be one but I get excited talking about Notepad++ the way a frat boy gets excited talking about call of duty.

You'll also notice that in the 'Contruction Kit Preview Trailer' that Bethesda released, when they mention papyrus, the script they show you is in notepad++

BEST TEXT EDITOR EVAR

If only i could also assign properties in notepad++, i would do ALL my scripting in that.
User avatar
An Lor
 
Posts: 3439
Joined: Sun Feb 18, 2007 8:46 pm

Post » Wed Jun 20, 2012 12:43 pm

You wrote it in Notepad++? Good man. Are you compiling from NP++ or from the CK? Is it Papyrus that gives the problem?
User avatar
Cheryl Rice
 
Posts: 3412
Joined: Sat Aug 11, 2007 7:44 am

Post » Wed Jun 20, 2012 6:29 pm

It's not really necessary but I'm gonna this post anyway.

As good as NP++ is, it's http://news.ycombinator.com/item?id=3717754. So people who earn their living writing code prefer vim and Sublime Text 2.
Though I have to say that ST2 beat even Emacs is surprising.
User avatar
katie TWAVA
 
Posts: 3452
Joined: Tue Jul 04, 2006 3:32 am

Post » Wed Jun 20, 2012 9:49 am

There, now I have a function like this:
function AddRemoveSpells(int index, int SpellLevel)   int AddRemoveButton = (DnDSpellAddRemoveMessages.GetAt(index) as Message).Show()   if AddRemoveButton != -1	  if AddRemoveButton==0	  (DnDSpellDailyCasts.GetAt(index) as GlobalVariable).SetValue(((DnDSpellDailyCasts.GetAt(index) as GlobalVariable).GetValue() as int)+1)   SpellLearner.SetFactionRank((DnDSpellSlotsRemaining.GetAt(SpellLevel) as Faction),SpellLearner.GetFactionRank((DnDSpellSlotsRemaining.GetAt(SpellLevel) as Faction)+-1)   endIf   if AddRemoveButton==1	  (DnDSpellDailyCasts.GetAt(index) as GlobalVariable).SetValue(((DnDSpellDailyCasts.GetAt(index) as GlobalVariable).GetValue() as int)+-1)   SpellLearner.SetFactionRank((DnDSpellSlotsRemaining.GetAt(SpellLevel) as Faction),SpellLearner.GetFactionRank((DnDSpellSlotsRemaining.GetAt(SpellLevel) as Faction)+1)   endIf   endIfendFunction

and all my little menu choices just basically make index = a value, and then run the function
User avatar
josie treuberg
 
Posts: 3572
Joined: Wed Feb 07, 2007 7:56 am

Post » Wed Jun 20, 2012 11:32 am

It's not really necessary but I'm gonna this post anyway.

As good as NP++ is, it's http://news.ycombinator.com/item?id=3717754. So people who earn their living writing code prefer vim and Sublime Text 2.
Though I have to say that ST2 beat even Emacs is surprising.

I am not a programmer but I do use it daily at work. It's the familiarity that makes it my personal preference. I'm not programming anything, just scripting in Papyrus, so it's not like I need a fully featured IDE. I cut my scripting teeth on Python 2.7 and IDLE so anything I use (except maybe MS Notepad) will comparatively be at a thousand times better. And that's not even mentioning the Wiki has NP++ specific configuration help.
User avatar
liz barnes
 
Posts: 3387
Joined: Tue Oct 31, 2006 4:10 am

Post » Wed Jun 20, 2012 5:27 pm

Oh my god, I literally just spent the last four hours writing a script that would handle spell memorization in DnD style. It's approximately 100,000 characters long, and the CK is just like "Nope, screw you kid."
GAH!

Split it into subscripts that extend Quest and put them on the quest itself, like this:
Spoiler
Scriptname DnDSpellPropertiesScript extends QuestMessage Property WantToChangeSpells autoMessage Property SpellLevelChoice autoMessage Property ConfirmSpellChoice autoMessage Property AddRemove auto;some testing propertiesGlobalVariable Property Spell1DailyCastsMessage Property SpellLvl1Pg1 autoMessage Property SpellLvl1Pg2 autoMessage Property SpellLvl1Pg3 autoMessage Property SpellLvl2Pg1 autoMessage Property SpellLvl2Pg2 autoMessage Property SpellLvl2Pg3 autoMessage Property SpellLvl3Pg1 autoMessage Property SpellLvl3Pg2 autoMessage Property SpellLvl3Pg3 autoMessage Property SpellLvl4Pg1 autoMessage Property SpellLvl5Pg1 autoMessage Property SpellLvl5Pg1 autoMessage Property SpellLvl7Pg1 autoMessage Property SpellLvl8Pg1 autoMessage Property SpellLvl9Pg1 auto;actual spells;1Spell Property reignofangerSpell autoSpell Property armorSpell autoSpell Property blindnessSpell autoSpell Property chromaticorbSpell autoSpell Property fistofironSpell autoSpell Property friendsSpell autoSpell Property identifySpell autoSpell Property magicmissileSpell autoSpell Property minorembalmingSpell autoSpell Property pacifySpell autoSpell Property scriptureofsteelSpell autoSpell Property seethingflamesSpell autoSpell Property shieldSpell autoSpell Property submergethewillSpell autoSpell Property vilquarseyeSpell auto;2Spell Property adderskissSpell autoSpell Property blackbarbedcurseSpell autoSpell Property bloodbridgeSpell autoSpell Property blurSpell autoSpell Property greaterembalmingSpell autoSpell Property horrorSpell autoSpell Property iceknifeSpell autoSpell Property IgnusterrorSpell autoSpell Property infernalorbSpell autoSpell Property knockSpell autoSpell Property luckSpell autoSpell Property powerofoneSpell autoSpell Property strengthSpell autoSpell Property swarmcurseSpell auto;3Spell Property fieryrainSpell autoSpell Property axeoftormentSpell autoSpell Property balanceinallthingsSpell autoSpell Property balllightningSpell autoSpell Property cloakofwardingSpell autoSpell Property ElisiumstearsSpell autoSpell Property holdundeadSpell autoSpell Property infernalshieldSpell autoSpell Property vampirictouchSpell autoSpell Property ZerthimonsfocusSpell auto;4Spell Property elementalstrikeSpell autoSpell Property blacksphereSpell autoSpell Property confusionSpell autoSpell Property forcemissilesSpell autoSpell Property improvedstrengthSpell autoSpell Property removecurseSpell autoSpell Property shroudofshadowsSpell auto;5Spell Property cloudkillSpell autoSpell Property coneofcoldSpell autoSpell Property deserthellSpell autoSpell Property EnollEvaduplicationSpell autoSpell Property fireandiceSpell auto;6Spell Property chainlightningstormSpell autoSpell Property globeofinvulnerabilitySpell auto;7Spell Property acidstormSpell autoSpell Property bladestormSpell autoSpell Property StygianicestormSpell auto;8Spell Property deathboltSpell autoSpell Property MechanuscannonSpell autoSpell Property meteorstormbombardmentSpell autoSpell Property powerwordblindSpell auto;9Spell Property abyssalfurySpell autoSpell Property celestialhostSpell autoSpell Property powerwordkillSpell auto;the add/remove messages for each [censored] spellMessage Property reignofangerAddRemove autoMessage Property armorAddRemove autoMessage Property blindnessAddRemove autoMessage Property chromaticorbAddRemove autoMessage Property fistofironAddRemove autoMessage Property friendsAddRemove autoMessage Property identifyAddRemove autoMessage Property magicmissileAddRemove autoMessage Property minorembalmingAddRemove autoMessage Property pacifyAddRemove autoMessage Property scriptureofsteelAddRemove autoMessage Property seethingflamesAddRemove autoMessage Property shieldAddRemove autoMessage Property submergethewillAddRemove autoMessage Property vilquarseyeAddRemove auto;2Message Property adderskissAddRemove autoMessage Property blackbarbedcurseAddRemove autoMessage Property bloodbridgeAddRemove autoMessage Property blurAddRemove autoMessage Property greaterembalmingAddRemove autoMessage Property horrorAddRemove autoMessage Property iceknifeAddRemove autoMessage Property IgnusterrorAddRemove autoMessage Property infernalorbAddRemove autoMessage Property knockAddRemove autoMessage Property luckAddRemove autoMessage Property powerofoneAddRemove autoMessage Property strengthAddRemove autoMessage Property swarmcurseAddRemove auto;3Message Property fieryrainAddRemove autoMessage Property axeoftormentAddRemove autoMessage Property balanceinallthingsAddRemove autoMessage Property balllightningAddRemove autoMessage Property cloakofwardingAddRemove autoMessage Property ElisiumstearsAddRemove autoMessage Property holdundeadAddRemove autoMessage Property infernalshieldAddRemove autoMessage Property vampirictouchAddRemove autoMessage Property ZerthimonsfocusAddRemove auto;4Message Property elementalstrikeAddRemove autoMessage Property blacksphereAddRemove autoMessage Property confusionAddRemove autoMessage Property forcemissilesAddRemove autoMessage Property improvedstrengthAddRemove autoMessage Property removecurseAddRemove autoMessage Property shroudofshadowsAddRemove auto;5Message Property cloudkillAddRemove autoMessage Property coneofcoldAddRemove autoMessage Property deserthellAddRemove autoMessage Property EnollEvaduplicationAddRemove autoMessage Property fireandiceAddRemove auto;6Message Property chainlightningstormAddRemove autoMessage Property globeofinvulnerabilityAddRemove auto;7Message Property acidstormAddRemove autoMessage Property bladestormAddRemove autoMessage Property StygianicestormAddRemove auto;8Message Property deathboltAddRemove autoMessage Property MechanuscannonAddRemove autoMessage Property meteorstormbombardmentAddRemove autoMessage Property powerwordblindAddRemove auto;9Message Property abyssalfuryAddRemove autoMessage Property celestialhostAddRemove autoMessage Property powerwordkillAddRemove auto;1GlobalVariable Property reignofangerDailyCasts autoGlobalVariable Property armorDailyCasts autoGlobalVariable Property blindnessDailyCasts autoGlobalVariable Property chromaticorbDailyCasts autoGlobalVariable Property fistofironDailyCasts autoGlobalVariable Property friendsDailyCasts autoGlobalVariable Property identifyDailyCasts autoGlobalVariable Property magicmissileDailyCasts autoGlobalVariable Property minorembalmingDailyCasts autoGlobalVariable Property pacifyDailyCasts autoGlobalVariable Property scriptureofsteelDailyCasts autoGlobalVariable Property seethingflamesDailyCasts autoGlobalVariable Property shieldDailyCasts autoGlobalVariable Property submergethewillDailyCasts autoGlobalVariable Property vilquarseyeDailyCasts auto;2GlobalVariable Property adderskissDailyCasts autoGlobalVariable Property blackbarbedcurseDailyCasts autoGlobalVariable Property bloodbridgeDailyCasts autoGlobalVariable Property blurDailyCasts autoGlobalVariable Property greaterembalmingDailyCasts autoGlobalVariable Property horrorDailyCasts autoGlobalVariable Property iceknifeDailyCasts autoGlobalVariable Property IgnusterrorDailyCasts autoGlobalVariable Property infernalorbDailyCasts autoGlobalVariable Property knockDailyCasts autoGlobalVariable Property luckDailyCasts autoGlobalVariable Property powerofoneDailyCasts autoGlobalVariable Property strengthDailyCasts autoGlobalVariable Property swarmcurseDailyCasts auto;3GlobalVariable Property fieryrainDailyCasts autoGlobalVariable Property axeoftormentDailyCasts autoGlobalVariable Property balanceinallthingsDailyCasts autoGlobalVariable Property balllightningDailyCasts autoGlobalVariable Property cloakofwardingDailyCasts autoGlobalVariable Property ElisiumstearsDailyCasts autoGlobalVariable Property holdundeadDailyCasts autoGlobalVariable Property infernalshieldDailyCasts autoGlobalVariable Property vampirictouchDailyCasts autoGlobalVariable Property ZerthimonsfocusDailyCasts auto;4GlobalVariable Property elementalstrikeDailyCasts autoGlobalVariable Property blacksphereDailyCasts autoGlobalVariable Property confusionDailyCasts autoGlobalVariable Property forcemissilesDailyCasts autoGlobalVariable Property improvedstrengthDailyCasts autoGlobalVariable Property removecurseDailyCasts autoGlobalVariable Property shroudofshadowsDailyCasts auto;5GlobalVariable Property cloudkillDailyCasts autoGlobalVariable Property coneofcoldDailyCasts autoGlobalVariable Property deserthellDailyCasts autoGlobalVariable Property EnollEvaduplicationDailyCasts autoGlobalVariable Property fireandiceDailyCasts auto;6GlobalVariable Property chainlightningstormDailyCasts autoGlobalVariable Property globeofinvulnerabilityDailyCasts auto;7GlobalVariable Property acidstormDailyCasts autoGlobalVariable Property bladestormDailyCasts autoGlobalVariable Property StygianicestormDailyCasts auto;8GlobalVariable Property deathboltDailyCasts autoGlobalVariable Property MechanuscannonDailyCasts autoGlobalVariable Property meteorstormbombardmentDailyCasts autoGlobalVariable Property powerwordblindDailyCasts auto;9GlobalVariable Property abyssalfuryDailyCasts autoGlobalVariable Property celestialhostDailyCasts autoGlobalVariable Property powerwordkillDailyCasts auto;casts remaining;1GlobalVariable Property reignofangerDailyCastsR autoGlobalVariable Property armorDailyCastsR autoGlobalVariable Property blindnessDailyCastsR autoGlobalVariable Property chromaticorbDailyCastsR autoGlobalVariable Property fistofironDailyCastsR autoGlobalVariable Property friendsDailyCastsR autoGlobalVariable Property identifyDailyCastsR autoGlobalVariable Property magicmissileDailyCastsR autoGlobalVariable Property minorembalmingDailyCastsR autoGlobalVariable Property pacifyDailyCastsR autoGlobalVariable Property scriptureofsteelDailyCastsR autoGlobalVariable Property seethingflamesDailyCastsR autoGlobalVariable Property shieldDailyCastsR autoGlobalVariable Property submergethewillDailyCastsR autoGlobalVariable Property vilquarseyeDailyCastsR auto;2GlobalVariable Property adderskissDailyCastsR autoGlobalVariable Property blackbarbedcurseDailyCastsR autoGlobalVariable Property bloodbridgeDailyCastsR autoGlobalVariable Property blurDailyCastsR autoGlobalVariable Property greaterembalmingDailyCastsR autoGlobalVariable Property horrorDailyCastsR autoGlobalVariable Property iceknifeDailyCastsR autoGlobalVariable Property IgnusterrorDailyCastsR autoGlobalVariable Property infernalorbDailyCastsR autoGlobalVariable Property knockDailyCastsR autoGlobalVariable Property luckDailyCastsR autoGlobalVariable Property powerofoneDailyCastsR autoGlobalVariable Property strengthDailyCastsR autoGlobalVariable Property swarmcurseDailyCastsR auto;3GlobalVariable Property fieryrainDailyCastsR autoGlobalVariable Property axeoftormentDailyCastsR autoGlobalVariable Property balanceinallthingsDailyCastsR autoGlobalVariable Property balllightningDailyCastsR autoGlobalVariable Property cloakofwardingDailyCastsR autoGlobalVariable Property ElisiumstearsDailyCastsR autoGlobalVariable Property holdundeadDailyCastsR autoGlobalVariable Property infernalshieldDailyCastsR autoGlobalVariable Property vampirictouchDailyCastsR autoGlobalVariable Property ZerthimonsfocusDailyCastsR auto;4GlobalVariable Property elementalstrikeDailyCastsR autoGlobalVariable Property blacksphereDailyCastsR autoGlobalVariable Property confusionDailyCastsR autoGlobalVariable Property forcemissilesDailyCastsR autoGlobalVariable Property improvedstrengthDailyCastsR autoGlobalVariable Property removecurseDailyCastsR autoGlobalVariable Property shroudofshadowsDailyCastsR auto;5GlobalVariable Property cloudkillDailyCastsR autoGlobalVariable Property coneofcoldDailyCastsR autoGlobalVariable Property deserthellDailyCastsR autoGlobalVariable Property EnollEvaduplicationDailyCastsR autoGlobalVariable Property fireandiceDailyCastsR auto;6GlobalVariable Property chainlightningstormDailyCastsR autoGlobalVariable Property globeofinvulnerabilityDailyCastsR auto;7GlobalVariable Property acidstormDailyCastsR autoGlobalVariable Property bladestormDailyCastsR autoGlobalVariable Property StygianicestormDailyCastsR auto;8GlobalVariable Property deathboltDailyCastsR autoGlobalVariable Property MechanuscannonDailyCastsR autoGlobalVariable Property meteorstormbombardmentDailyCastsR autoGlobalVariable Property powerwordblindDailyCastsR auto;9GlobalVariable Property abyssalfuryDailyCastsR autoGlobalVariable Property celestialhostDailyCastsR autoGlobalVariable Property powerwordkillDailyCastsR autoFaction Property Lvl1SpellSlotsRemaining  autoFaction Property Lvl2SpellSlotsRemaining  autoFaction Property Lvl3SpellSlotsRemaining  autoFaction Property Lvl4SpellSlotsRemaining  autoFaction Property Lvl5SpellSlotsRemaining  autoFaction Property Lvl5SpellSlotsRemaining  autoFaction Property Lvl7SpellSlotsRemaining  autoFaction Property Lvl8SpellSlotsRemaining  autoFaction Property Lvl9SpellSlotsRemaining  auto
(Thats just the properties in a separate script)

Just make a property with the name of that script like so:

DnDSpellPropertiesScript Property DnD Auto
a

and assign it to the script, then preface all the properties in there with "DND." instead of "DnD" like this:

event OnUpdate()   Actor SpellLearner = ((self as referencealias).GetReference() as actor)   int WantToButton = DnD.WantToChangeSpells.Show()   if WantToButton!=-1		  if WantToButton==0				 SpellLevelChoice()		  endIf		  if WantToButton==1				 ConfirmChoice()		  endIf   endIfendEvent

You can put the functions in separate scripts as well, like "DnDChoiceFunctionScript", each of which has properties for the properties script so they can all access them...

DnDChoiceFunctionScript Property DnDCS Auto ; Contains the functions above...event OnUpdate()   Actor SpellLearner = ((self as referencealias).GetReference() as actor)   int WantToButton = DnD.WantToChangeSpells.Show()   if WantToButton!=-1          if WantToButton==0                 DnDCS.SpellLevelChoice()          endIf          if WantToButton==1                 DnDCS.ConfirmChoice()          endIf   endIfendEvent
User avatar
IM NOT EASY
 
Posts: 3419
Joined: Mon Aug 13, 2007 10:48 pm

Post » Wed Jun 20, 2012 9:43 am

Okay, the script looks WAY sixier now, and fits in the character limit.

Here it is:
[Spoiler]
Scriptname DnDSpellChoices extends ReferenceAliasMessage Property DnDWantToChangeSpells autoMessage Property DnDSpellsLevelChoice autoMessage Property DnDConfirmSpellChoice autoMessage Property DnDAddRemove auto;some testing propertiesMessage Property DnDSpellsLvl1Pg1 autoMessage Property DnDSpellsLvl1Pg2 autoMessage Property DnDSpellsLvl1Pg3 autoMessage Property DnDSpellsLvl2Pg1 autoMessage Property DnDSpellsLvl2Pg2 autoMessage Property DnDSpellsLvl2Pg3 autoMessage Property DnDSpellsLvl3Pg1 autoMessage Property DnDSpellsLvl3Pg2 autoMessage Property DnDSpellsLvl3Pg3 autoMessage Property DnDSpellsLvl4Pg1 autoMessage Property DnDSpellsLvl5Pg1 autoMessage Property DnDSpellsLvl6Pg1 autoMessage Property DnDSpellsLvl7Pg1 autoMessage Property DnDSpellsLvl8Pg1 autoMessage Property DnDSpellsLvl9Pg1 autoFormList Property DnDSpells autoFormList Property DnDSpellsAddRemoveMessages autoFormList Property DnDSpellsDailyCasts autoFormList Property DnDSpellsDailyCastsR autoFormList Property DnDSpellsSlotsRemaining autoevent OnUpdate()     int WantToButton = DnDWantToChangeSpells.Show()   if WantToButton!=-1	  if WantToButton==0		 SpellLevelChoice()	  endIf	  if WantToButton==1		 ConfirmChoice()	  endIf   endIfendEventfunction SpellLevelChoice()	int LevelChoice=DnDSpellsLevelChoice.Show()  if  LevelChoice!=-1	if  LevelChoice==0		ConfirmChoice()	endIf	if  LevelChoice==1	 SpellLvl1Pg1()endIfif  LevelChoice==2	 SpellLvl2Pg1()endIfif  LevelChoice==3	 SpellLvl3Pg1()endIfif  LevelChoice==4	 SpellLvl4Pg1()endIfif  LevelChoice==5	 SpellLvl5Pg1()endIfif  LevelChoice==6	 SpellLvl5Pg1()endIfif  LevelChoice==7	 SpellLvl7Pg1()endIfif  LevelChoice==8	 SpellLvl8Pg1()endIfif  LevelChoice==9	 SpellLvl9Pg1()endIf  endIfendFunctionfunction AddRemoveSpells(int index, int SpellLevel)Actor SpellLearner = ((self as referencealias).GetReference() as actor)   int AddRemoveButton = (DnDSpellsAddRemoveMessages.GetAt(index) as Message).Show()   if AddRemoveButton != -1	  if AddRemoveButton==0	  (DnDSpellsDailyCasts.GetAt(index) as GlobalVariable).SetValue(((DnDSpellsDailyCasts.GetAt(index) as GlobalVariable).GetValue() as int)+1)   SpellLearner.SetFactionRank((DnDSpellsSlotsRemaining.GetAt(SpellLevel) as Faction), ((SpellLearner.GetFactionRank(DnDSpellsSlotsRemaining.GetAt(SpellLevel) as Faction) as int) +- 1))   endIf   if AddRemoveButton==1	  (DnDSpellsDailyCasts.GetAt(index) as GlobalVariable).SetValue(((DnDSpellsDailyCasts.GetAt(index) as GlobalVariable).GetValue() as int)+-1)   SpellLearner.SetFactionRank((DnDSpellsSlotsRemaining.GetAt(SpellLevel) as Faction), ((SpellLearner.GetFactionRank(DnDSpellsSlotsRemaining.GetAt(SpellLevel) as Faction) as int) + 1))   endIf   endIfendFunctionfunction SpellLvl1Pg1()int index = 0int SpellLevel = 0int SpellChoiceButton=DnDSpellsLvl1Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  ;   endIf   if SpellChoiceButton==2	  SpellLvl1Pg2()   endIf   if SpellChoiceButton==3	  index=0   SpellLevel = 0   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg1()   endIf   if SpellChoiceButton==4	  index=1   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg1()   endIf   if SpellChoiceButton==5	  index=2   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg1()   endIf   if SpellChoiceButton==6	  index=3   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg1()   endIf   if SpellChoiceButton==7	  index=4   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg1()   endIf   if SpellChoiceButton==8	  index=5   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg1()   endIf   if SpellChoiceButton==9	  index=6   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg1()   endIfendIfendFunctionfunction SpellLvl1Pg2()int SpellChoiceButton=DnDSpellsLvl1Pg2.Show()int index = 0int SpellLevel = 0if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  SpellLvl1Pg1()   endIf   if SpellChoiceButton==2	  SpellLvl1Pg3()   endIf   if SpellChoiceButton==3	  index=7   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg2()   endIf   if SpellChoiceButton==4	  index=8   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg2()   endIf   if SpellChoiceButton==5	  index=9   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg2()   endIf   if SpellChoiceButton==6	  index=10   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg2()   endIf   if SpellChoiceButton==7	  index=11   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg2()   endIf   if SpellChoiceButton==8	  index=12   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg2()   endIf   if SpellChoiceButton==9	  index=13   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg2()   endIfendIfendFunctionfunction SpellLvl1Pg3()int SpellChoiceButton=DnDSpellsLvl1Pg3.Show()int index = 0int SpellLevel = 0if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  SpellLvl1Pg2()   endIf   if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  index=14   AddRemoveSpells(index, SpellLevel)   SpellLvl1Pg3()   endIfendIfendFunctionfunction SpellLvl2Pg1()int index = 0int SpellLevel = 1int SpellChoiceButton=DnDSpellsLvl2Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  ;   endIf   if SpellChoiceButton==2	  SpellLvl2Pg2()   endIf   if SpellChoiceButton==3	  index=15   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg1()   endIf   if SpellChoiceButton==4	  index=16   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg1()   endIf   if SpellChoiceButton==5	  index=17   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg1()   endIf   if SpellChoiceButton==6	  index=18   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg1()   endIf   if SpellChoiceButton==7	  index=19   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg1()   endIf   if SpellChoiceButton==8	  index=20   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg1()   endIf   if SpellChoiceButton==9	  index=21   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg1()   endIfendIfendFunctionfunction SpellLvl2Pg2()int SpellLevel = 1int index = 0int SpellChoiceButton=DnDSpellsLvl2Pg2.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  SpellLvl2Pg1()   endIf   if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  index=22   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg2()   endIf   if SpellChoiceButton==4	  index=23   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg2()   endIf   if SpellChoiceButton==5	  index=24   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg2()   endIf   if SpellChoiceButton==6	  index=25   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg2()   endIf   if SpellChoiceButton==7	  index=26   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg2()   endIf   if SpellChoiceButton==8	  index=27   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg2()   endIf   if SpellChoiceButton==9	  index=28   AddRemoveSpells(index, SpellLevel)   SpellLvl2Pg2()   endIfendIfendFunctionfunction SpellLvl3Pg1()int index = 0int SpellLevel = 2int SpellChoiceButton=DnDSpellsLvl3Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  ;   endIf   if SpellChoiceButton==2	  SpellLvl3Pg2()   endIf   if SpellChoiceButton==3	  index=29	  AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg1()   endIf   if SpellChoiceButton==4	  index=30   AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg1()   endIf   if SpellChoiceButton==5	  index=31   AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg1()   endIf   if SpellChoiceButton==6	  index=32   AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg1()   endIf   if SpellChoiceButton==7	  index=33   AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg1()   endIf   if SpellChoiceButton==8	  index=34   AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg1()   endIf   if SpellChoiceButton==9	  index=35   AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg1()   endIfendIfendFunctionfunction SpellLvl3Pg2()int index = 0int SpellChoiceButton=DnDSpellsLvl3Pg2.Show()int SpellLevel = 2if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  SpellLvl3Pg1()   endIf   if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  index=36   AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg2()   endIf   if SpellChoiceButton==4	  index=37   AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg2()   endIf   if SpellChoiceButton==5	  index=38   AddRemoveSpells(index, SpellLevel)   SpellLvl3Pg2()   endIfendIfendFunctionfunction SpellLvl4Pg1()int index = 0int SpellLevel = 3int SpellChoiceButton=DnDSpellsLvl4Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  SpellLvl4Pg1()   endIf   if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  index=39   AddRemoveSpells(index, SpellLevel)   SpellLvl4Pg1()   endIf   if SpellChoiceButton==4	  index=40   AddRemoveSpells(index, SpellLevel)   SpellLvl4Pg1()   endIf   if SpellChoiceButton==5	  index=41   AddRemoveSpells(index, SpellLevel)   SpellLvl4Pg1()   endIf   if SpellChoiceButton==6	  index=42   AddRemoveSpells(index, SpellLevel)   SpellLvl4Pg1()   endIf   if SpellChoiceButton==7	  index=43   AddRemoveSpells(index, SpellLevel)   SpellLvl4Pg1()   endIf   if SpellChoiceButton==8	  index=44   AddRemoveSpells(index, SpellLevel)   SpellLvl4Pg1()   endIf   if SpellChoiceButton==9	  index=45   AddRemoveSpells(index, SpellLevel)   SpellLvl4Pg1()   endIfendIfendFunctionfunction SpellLvl5Pg1()int index = 0int SpellLevel = 4int SpellChoiceButton=DnDSpellsLvl5Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  ;   endIf   if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  index=46   AddRemoveSpells(index, SpellLevel)   SpellLvl5Pg1()   endIf   if SpellChoiceButton==4	  index=47   AddRemoveSpells(index, SpellLevel)   SpellLvl5Pg1()   endIf   if SpellChoiceButton==5	  index=48   AddRemoveSpells(index, SpellLevel)   SpellLvl5Pg1()   endIf   if SpellChoiceButton==6	  index=49   AddRemoveSpells(index, SpellLevel)   SpellLvl5Pg1()   endIf   if SpellChoiceButton==7	  index=50   AddRemoveSpells(index, SpellLevel)   SpellLvl5Pg1()   endIfendIfendFunctionfunction SpellLvl6Pg1()int index = 0int SpellLevel = 5int SpellChoiceButton=DnDSpellsLvl6Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  ;   endIf   if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  index=51   AddRemoveSpells(index, SpellLevel)   SpellLvl6Pg1()   endIf   if SpellChoiceButton==4	  index=52   AddRemoveSpells(index, SpellLevel)   SpellLvl6Pg1()   endIfendIfendFunctionfunction SpellLvl7Pg1()int index = 0int SpellLevel = 6int SpellChoiceButton=DnDSpellsLvl7Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  ;   endIf   if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  index=53   AddRemoveSpells(index, SpellLevel)   SpellLvl7Pg1()   endIf   if SpellChoiceButton==4	  index=54   AddRemoveSpells(index, SpellLevel)   SpellLvl7Pg1()   endIf   if SpellChoiceButton==5	  index=55   AddRemoveSpells(index, SpellLevel)   SpellLvl7Pg1()   endIfendIfendFunctionfunction SpellLvl8Pg1()int index = 0int SpellLevel = 7int SpellChoiceButton=DnDSpellsLvl8Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  ;   endIf   if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  index=56   AddRemoveSpells(index, SpellLevel)   SpellLvl8Pg1()   endIf   if SpellChoiceButton==4	  index=57   AddRemoveSpells(index, SpellLevel)   SpellLvl8Pg1()   endIf   if SpellChoiceButton==5	  index=58   AddRemoveSpells(index, SpellLevel)   SpellLvl8Pg1()   endIf	if SpellChoiceButton==6	  index=59   AddRemoveSpells(index, SpellLevel)   SpellLvl8Pg1()   endIfendIfendFunctionfunction SpellLvl9Pg1()int index = 0int SpellLevel = 8int SpellChoiceButton=DnDSpellsLvl9Pg1.Show()if SpellChoiceButton!=-1   if SpellChoiceButton==0	  SpellLevelChoice()   endIf   if SpellChoiceButton==1	  ;   endIf   if SpellChoiceButton==2	  ;   endIf   if SpellChoiceButton==3	  index=60   AddRemoveSpells(index, SpellLevel)   SpellLvl9Pg1()   endIf   if SpellChoiceButton==4	  index=61   AddRemoveSpells(index, SpellLevel)   SpellLvl9Pg1()   endIf   if SpellChoiceButton==5	  index=62   AddRemoveSpells(index, SpellLevel)   SpellLvl9Pg1()   endIfendIfendFunctionFunction ConfirmChoice()Actor SpellLearner = ((self as referencealias).GetReference() as actor)		GlobalVariable CastsPref		GlobalVariable CastsRem  Spell AddingSpell		int index = DnDSpellsDailyCasts.GetSize()		while (index > 0)				index -= 1	CastsPref = DnDSpellsDailyCasts.GetAt(index) as GlobalVariable	CastsRem = DnDSpellsDailyCastsR.GetAt(index) as GlobalVariable	CastsRem.SetValue(CastsPref.GetValue() as int)	AddingSpell = DnDSpells.GetAt(index) as Spell	if (CastsRem.GetValue() as int >=1)&&(SpellLearner.HasSpell(AddingSpell) as bool==0)		SpellLearner.AddSpell(AddingSpell)	   endIf	  		endwhileEndFunction
[\Spoiler]
User avatar
Suzy Santana
 
Posts: 3572
Joined: Fri Aug 10, 2007 12:02 am

Post » Wed Jun 20, 2012 6:55 pm

Minor improvments:
Spoiler
event OnUpdate()	int WantToButton = DnDWantToChangeSpells.Show()	if (WantToButton == 0)		SpellLevelChoice()	elseif (WantToButton == 1)		ConfirmChoice()	endifendeventfunction SpellLevelChoice()	int LevelChoice = DnDSpellsLevelChoice.Show()	if (LevelChoice < 0)		return	elseif (LevelChoice == 0)		ConfirmChoice()	elseif (LevelChoice == 1)		SpellLvl1Pg1()	elseif (LevelChoice == 2)		SpellLvl2Pg1()	elseif (LevelChoice == 3)		SpellLvl3Pg1()	elseif (LevelChoice == 4)		SpellLvl4Pg1()	elseif (LevelChoice == 5)		SpellLvl5Pg1()	elseif (LevelChoice == 6)		SpellLvl5Pg1()	elseif (LevelChoice == 7)		SpellLvl7Pg1()	elseif (LevelChoice == 8)		SpellLvl8Pg1()	elseif (LevelChoice == 9)		SpellLvl9Pg1()	endifendfunctionfunction AddRemoveSpells(int index, int spellLevel)	int response = (DnDSpellsAddRemoveMessages.GetAt(index) as Message).Show()	if (response < 0)		return	endif	Actor spellLearner  = GetReference() as Actor	GlobalVariable g = DnDSpellsDailyCasts.GetAt(index) as GlobalVariable	Faction f = DnDSpellsSlotsRemaining.GetAt(spellLevel) as Faction	if (!spellLearner || !g || !f)		return	endif	if (response == 0)		g.SetValue(g.GetValue() + 1.0)		spellLearner.SetFactionRank(f, spellLearner.GetFactionRank(f) - 1)	elseif (response == 1)		g.SetValue(g.GetValue() - 1.0)		spellLearner.SetFactionRank(f, spellLearner.GetFactionRank(f) + 1)	endifendfunction
And so and so forth...
User avatar
Alba Casas
 
Posts: 3478
Joined: Tue Dec 12, 2006 2:31 pm

Post » Wed Jun 20, 2012 12:03 pm

I don't actually understand your code, so I'm gonna keep it as is. It functions, so I can't really ask more from it.
User avatar
Alyce Argabright
 
Posts: 3403
Joined: Mon Aug 20, 2007 8:11 pm

Post » Thu Jun 21, 2012 12:32 am

Well then, as I see it you've got two options, either continue to write http://www.codinghorror.com/blog/2006/05/code-smells.html or improve your skills and your scripts.
User avatar
Alexis Estrada
 
Posts: 3507
Joined: Tue Aug 29, 2006 6:22 pm

Post » Wed Jun 20, 2012 4:16 pm

Oh my, it pains me to see scripts like this... No offense but looking into arrays is a good idea, regardless if it svcks in Papyrus they are powerful and can save you a lot of time.
User avatar
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm

Post » Wed Jun 20, 2012 3:42 pm

Oh my, it pains me to see scripts like this... No offense but looking into arrays is a good idea, regardless if it svcks in Papyrus they are powerful and can save you a lot of time.

They plain don't work 90% of the time. I avoid them at all costs myself. Formlists would work though.
User avatar
Lynette Wilson
 
Posts: 3424
Joined: Fri Jul 14, 2006 4:20 pm

Post » Wed Jun 20, 2012 5:19 pm

They plain don't work 90% of the time. I avoid them at all costs myself. Formlists would work though.

They have yet to fail me. They can sometimes cause problems if you are new at them with Papyrus, the normal "safeties" on arrays in other languages are not there in Papyrus, one wrong move and you can cause infinite loops or spam your VM with run-time errors.
User avatar
Sheila Esmailka
 
Posts: 3404
Joined: Wed Aug 22, 2007 2:31 am

Post » Thu Jun 21, 2012 1:23 am

They have yet to fail me. They can sometimes cause problems if you are new at them with Papyrus, the normal "safeties" on arrays in other languages are not there in Papyrus, one wrong move and you can cause infinite loops or spam your VM with run-time errors.
The first time I tried using them in any truly useful context, passing them as variables to functions and using them as properties, they totally failed to work. The function couldn't read them, and the property always came back as a "None"
User avatar
LuBiE LoU
 
Posts: 3391
Joined: Sun Jun 18, 2006 4:43 pm

Next

Return to V - Skyrim