FANDOM


Created by Taz.

Using "RC_Core.rcm"
; testingrc1 1.26
; Date/Time: 2:00:21 AM on 9/10/2010
; By Naddaz on TAZCO
;PLAYER ACHIEVEMENTS
;this will be used for a achievement script, so player will have other things to do. Make a quest or somthing
;that will unlock achievements. Since most attributes and actor globals are used.
;going to use a file to store achievements.
;will need to make a file that will have a list of achievements.

;-------------------------------------
;achievements so far. In order of added to script list.
;-------------------------------------
;Lion Tamer
 ;Mining Maniac
 ;Herb Horder
 ;Master Alchemist
;Larvae balance
 
 ;-------------------------------------

;When ran this will tell player there Achievements
Function Main()
Player = Actor()
Pname$ = Name(Player)


ScriptLog("Achievements script running by " + Pname)
FinishAch% = 5
Repeat ;repeat the Achievements part till cancaled.

                
   ChatBox$ = OpenDialog(Player, Target, "Achievements", 272) ;change to other background to show trophys.

  ;options for achevements.
  DialogOutPut(Player, ChatBox, "") ;just a space.
  PAOption% = DialogInPut(Player, ChatBox, "Krystalics Slayer,Mining Maniac,Herb Horder,Master Alchemist,Tree Chopper,Larvae balance,More,Close") 
 
                 

If (PAOption = 1) ;show Krystalics Slayer


        LTIsComplete$ = "False" ; set to false till true when player finished lion tamer achievement
        PAName$ = + PName + "Achievements.txt"
        PA$ = OpenFile(PAName) ;using to check if file exestits below. (P)layer (A)chievements
    
 ;only run this if file is not there otherwize close opend file above and continue with script.
    
               Repeat
                    DoEvents(12)
                    ;SeekFile(PA, FileSize(PAName))
                    AchCheck$ = ReadLine(PA) 
                    EndFile$ = Eof(PA)
                    AName$ = "Krystalics Slayer" ;must be changed to achievement name
                   ; OutPut(Player, "----- DeBug ----- Checking line " + AchCheck, 32, 23, 43)
                     
                        If (AchCheck = AName) ; if line in file, end script since player has avh already
                            ;OutPut(Player, "----- DeBug ----- ach complete", 32, 23, 43)
                            DoEvents(50) ; keep number low.
                            EndFile = 1 ;end repeat and end script
                            LTIsComplete$ = "True" ;player has finished this achievment 
                        EndIf
                       CloseFile(AchCheck) ;close file.
                   
                Until (EndFile = 1)
                CloseFile(PA) ;close file

    If (LTIsComplete = "True") ; player has completed Krystalics Slayer achievement.
        CloseDialog(Player, ChatBox)
        ChatBox$ = OpenDialog(Player, Target, "Achievements", 276) ;change to other background to show trophys.
        DialogOutPut(Player, ChatBox, "You have completed Krystalics Slayer achievement. Congratulations!!", 230, 145, 23)
       ; DialogOutPUt(Player, ChatBox, "", 0, 0, 0) ;take space
        DialogInput(Player, ChatBox, "                                                                                                                                                                                                                                                                                                                                                                  Close")
        CloseDialog(Player, ChatBox)
        
     Else
     ;get kill amount to display to player.
     ;---------------------------------------------
  ;Check Player status in Krystalics Slayer achievenmet  
    ;give player different text based on if achienemet is started or not.
     YoungLionA$ = + PName + " Krystalics Slayer.txt" ;file name to be opened
     CloseDialog(Player, ChatBox)
     ChatBox$ = OpenDialog(Player, Target, "Achievements", 275) ;change to other background to show trophys.
     YLionFile% = OpenFile(YoungLionA) 

        If (YLionFile = 0)
            DialogOUtPut(Player, ChatBox, "You have not started, this Achievement yet. You can start this Achievement, by killing a Krystalics.", 230, 145, 23)   
            TestNumber% = 0 ; set to 0 since achievment has not been started.    
        Else ;Achievenemet started read file to get amount that player has collected/killed.
            ;using code names from other place to speed up procces.        
            ;SeekFile(YLionFile, FileSize(YLionA))
            YLionCheck% = ReadLine(YLionFile) ;read number if ther is one to add to amount.
            TestNumber% = YLionCheck%         
        EndIf
         
         CloseFile(YLionFile) ;close achievements file that is made  
        DialogOutPut(Player, ChatBox, "You have killed " + TestNumber + " out of 125 Krystalics.", 255, 255, 0) ;tele player the amount of kills or items collected.       
        PNOption% = DialogInput(Player, ChatBox, "Close Krystalics Slayer,Close Achievements")
        CloseDialog(Player, ChatBox)
        If (PNOption = 1) ;close this achievements and use repeat
        CloseDialog(Player, ChatBox)
        Else ;close portable trainer
        FinishAch = 0 ;set to zero and end repeat.
        CloseDialog(Player, ChatBox)
        EndIf
     EndIf
  ;End Krystalics Slayer achievment    

 ;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------

 
  
     
 ElseIf (PAOption = 2)  
 
 ;Mining Maniac Achievment

        MMIsComplete$ = "False" ; set to false till true when player finished achievement
        PAName$ = + PName + "Achievements.txt"
        PA$ = OpenFile(PAName) ;using to check if file exestits below. (P)layer (A)chievements
    
 ;only run this if file is not there otherwize close opend file above and continue with script.
    
               Repeat
                    DoEvents(12)
                    ;SeekFile(PA, FileSize(PAName))
                    AchCheck$ = ReadLine(PA) 
                    EndFile$ = Eof(PA)
                    AName$ = "Mining Maniac" ;must be changed to achievement name
                   ; OutPut(Player, "----- DeBug ----- Checking line " + AchCheck, 32, 23, 43)
                     
                        If (AchCheck = AName) ; if line in file, end script since player has avh already
                            ;OutPut(Player, "----- DeBug ----- ach complete", 32, 23, 43)
                            DoEvents(50) ; keep number low.
                            EndFile = 1 ;end repeat and end script
                            MMIsComplete$ = "True" ;player has finished this achievment
                        EndIf
                       CloseFile(AchCheck) ;close file.
                   
                Until (EndFile = 1)
                CloseFile(PA) ;close file

    If (MMIsComplete = "True") ; player has completed lion tamer achievement.
        CloseDialog(Player, ChatBox)
        ChatBox$ = OpenDialog(Player, Target, "Achievements", 280) ;change to other background to show trophys.
        DialogOutPut(Player, "You have completed Mining Maniac achievement. Congratulations!!", 230, 145, 23)
       ; DialogOutPUt(Player, ChatBox, "", 0, 0, 0) ;take space
        DialogInput(Player, ChatBox, "                                                                                                                                                                                                                                                                                                                                                                  Close")
        CloseDialog(Player, ChatBox)
    Else ;player has not completed achevienemet
        CloseDialog(Player, ChatBox)
  ;---------------------------------------------
  ;Check Player status in mining maniac achievenmet  
    ;give player different text based on if achienemet is started or not.
     MiningMan$ = + PName + " Mining Maniac.txt" ;file name to be opened
     ChatBox$ = OpenDialog(Player, Target, "Achievements", 279) ;change to other background to show trophys.
     YLionFile% = OpenFile(MiningMan) 

        If (YLionFile = 0)
            DialogOUtPut(Player, ChatBox, "You have not started, this Achievement yet. You can start this Achievement, by mining any ore.", 230, 145, 23)   
            TestNumber% = 0 ; set to 0 since achievment has not been started. 
        Else ;Achievenemet started read file to get amount that player has collected/killed.
            ;using code names from other place to speed up procces.        
            ;SeekFile(YLionFile, FileSize(YLionA))
            YLionCheck% = ReadLine(YLionFile) ;read number if ther is one to add to amount.
            TestNumber% = YLionCheck%         
        EndIf
         
             CloseFile(YLionFile) ;close achievements file that is made  
       
         DialogOutPut(Player, ChatBox, "You have collected " + TestNumber + " Out of 400.", 255, 255, 0) ;tele player the amount of kills or items collected.
        PNOption% = DialogInput(Player, ChatBox, "Close Mining Maniac,Close Achievements")
        If (PNOption = 1) ;close this achievements and use repeat
            CloseDialog(Player, ChatBox)
        Else ;close portable trainer
            FinishAch = 0 ;set to zero and end repeat.
            CloseDialog(Player, ChatBox)
        EndIf
     EndIf
 ;End Mining Maniac  

;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------

ElseIf (PAOption = 3)
;Herb Horder using lion code as a template.

        LTIsComplete$ = "False" ; set to false till true when player finished lion tamer achievement
        PAName$ = + PName + "Achievements.txt"
        PA$ = OpenFile(PAName) ;using to check if file exestits below. (P)layer (A)chievements
    
 ;only run this if file is not there otherwize close opend file above and continue with script.
    
               Repeat
                    DoEvents(12)
                    ;SeekFile(PA, FileSize(PAName))
                    AchCheck$ = ReadLine(PA) 
                    EndFile$ = Eof(PA)
                    AName$ = "Herb Horder" ;must be changed to achievement name
                   ; OutPut(Player, "----- DeBug ----- Checking line " + AchCheck, 32, 23, 43)
                     
                        If (AchCheck = AName) ; if line in file, end script since player has avh already
                        ;OutPut(Player, "----- DeBug ----- ach complete", 32, 23, 43)
                        DoEvents(50) ; keep number low.
                        EndFile = 1 ;end repeat and end script
                        LTIsComplete$ = "True" ;player has finished this achievment
 
                         EndIf
                       CloseFile(AchCheck) ;close file.
                   
                Until (EndFile = 1)
                CloseFile(PA) ;close file

    If (LTIsComplete = "True") ; player has completed lion tamer achievement.
        CloseDialog(Player, ChatBox)
        ChatBox$ = OpenDialog(Player, Target, "Achievements", 274) ;change to other background to show trophys.
        DialogOutPut(Player, "You have completed Herb Horder achievement. Congratulations!!", 230, 145, 23)
       ; DialogOutPUt(Player, ChatBox, "", 0, 0, 0) ;take space
        DialogInput(Player, ChatBox, "                                                                                                                                                                                                                                                                                                                                                                  Close")
        CloseDialog(Player, ChatBox)
        
     Else
     ;get kill amount to display to player.
     ;---------------------------------------------
  ;Check Player status in Lion Tamer achievenmet  
    ;give player different text based on if achienemet is started or not.
     YoungLionA$ = + PName + " Herb Horder.txt" ;file name to be opened
     CloseDialog(Player, ChatBox)
     ChatBox$ = OpenDialog(Player, Target, "Achievements", 273) ;change to other background to show trophys.
     YLionFile% = OpenFile(YoungLionA) 

        If (YLionFile = 0)
            DialogOUtPut(Player, ChatBox, "You have not started, this Achievement yet. You can start this Achievement, by collecting a herb.", 230, 145, 23)   
            TestNumber% = 0 ; set to 0 since achievment has not been started.     
        Else ;Achievenemet started read file to get amount that player has collected/killed.
            ;using code names from other place to speed up procces.        
            ;SeekFile(YLionFile, FileSize(YLionA))
            YLionCheck% = ReadLine(YLionFile) ;read number if ther is one to add to amount.
            TestNumber% = YLionCheck%         
        EndIf
         
         CloseFile(YLionFile) ;close achievements file that is made  
        DialogOutPut(Player, ChatBox, "You have Collected " + TestNumber + " out of 400 Herbs.", 255, 255, 0) ;tele player the amount of kills or items collected.       
        PNOption% = DialogInput(Player, ChatBox, "Close Herb Horder,Close Achievements")
        CloseDialog(Player, ChatBox)
        If (PNOption = 1) ;close this achievements and use repeat
        CloseDialog(Player, ChatBox)
        Else ;close portable trainer
        FinishAch = 0 ;set to zero and end repeat.
        CloseDialog(Player, ChatBox)
        EndIf
     EndIf
 ;End Herb Horder
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------

ElseIf (PAOption = 4)
;Master Alchemist   


        LTIsComplete$ = "False" ; set to false till true when player finished lion tamer achievement
        PAName$ = + PName + "Achievements.txt"
        PA$ = OpenFile(PAName) ;using to check if file exestits below. (P)layer (A)chievements
    
 ;only run this if file is not there otherwize close opend file above and continue with script.
    
               Repeat
                    DoEvents(12)
                    ;SeekFile(PA, FileSize(PAName))
                    AchCheck$ = ReadLine(PA) 
                    EndFile$ = Eof(PA)
                    AName$ = "Master Alchemist" ;must be changed to achievement name
                   ; OutPut(Player, "----- DeBug ----- Checking line " + AchCheck, 32, 23, 43)
                     
                        If (AchCheck = AName) ; if line in file, end script since player has avh already
                        ;OutPut(Player, "----- DeBug ----- ach complete", 32, 23, 43)
                        DoEvents(50) ; keep number low.
                        EndFile = 1 ;end repeat and end script
                        LTIsComplete$ = "True" ;player has finished this achievment
 
                         EndIf
                       CloseFile(AchCheck) ;close file.
                   
                Until (EndFile = 1)
                CloseFile(PA) ;close file

    If (LTIsComplete = "True") ; player has completed lion tamer achievement.
        CloseDialog(Player, ChatBox)
        ChatBox$ = OpenDialog(Player, Target, "Achievements", 278) ;change to other background to show trophys.
        DialogOutPut(Player, "You have completed Master Alchemist achievement. Congratulations!!", 230, 145, 23)
       ; DialogOutPUt(Player, ChatBox, "", 0, 0, 0) ;take space
        DialogInput(Player, ChatBox, "                                                                                                                                                                                                                                                                                                                                                                  Close")
        CloseDialog(Player, ChatBox)
        
     Else
     ;get kill amount to display to player.
     ;---------------------------------------------
  ;Check Player status in Lion Tamer achievenmet  
    ;give player different text based on if achienemet is started or not.
     YoungLionA$ = + PName + " Master Alchemist.txt" ;file name to be opened
     CloseDialog(Player, ChatBox)
     ChatBox$ = OpenDialog(Player, Target, "Achievements", 277) ;change to other background to show trophys.
     YLionFile% = OpenFile(YoungLionA) 

        If (YLionFile = 0)
            DialogOUtPut(Player, ChatBox, "You have not started, this Achievement yet. You can start this Achievement, by making a potion.", 230, 145, 23)   
            TestNumber% = 0 ; set to 0 since achievment has not been started.     
        Else ;Achievenemet started read file to get amount that player has collected/killed.
            ;using code names from other place to speed up procces.        
            ;SeekFile(YLionFile, FileSize(YLionA))
            YLionCheck% = ReadLine(YLionFile) ;read number if ther is one to add to amount.
            TestNumber% = YLionCheck%         
        EndIf
         
         CloseFile(YLionFile) ;close achievements file that is made  
        DialogOutPut(Player, ChatBox, "You have made " + TestNumber + " out of 250 potions.", 255, 255, 0) ;tele player the amount of kills or items collected.       
        PNOption% = DialogInput(Player, ChatBox, "Close Master Alchemist,Close Achievements")
        CloseDialog(Player, ChatBox)
        If (PNOption = 1) ;close this achievements and use repeat
        CloseDialog(Player, ChatBox)
        Else ;close portable trainer
        FinishAch = 0 ;set to zero and end repeat.
        CloseDialog(Player, ChatBox)
        EndIf
     EndIf
     
 
 
 
 
 ;End Master Alchemist
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
Elseif (PAOption = 5) ;Tree Chopper

;Tree Chopper using lion code as a template.

        LTIsComplete$ = "False" ; set to false till true when player finished lion tamer achievement
        PAName$ = + PName + "Achievements.txt"
        PA$ = OpenFile(PAName) ;using to check if file exestits below. (P)layer (A)chievements
    
 ;only run this if file is not there otherwize close opend file above and continue with script.
    
               Repeat
                    DoEvents(12)
                    ;SeekFile(PA, FileSize(PAName))
                    AchCheck$ = ReadLine(PA) 
                    EndFile$ = Eof(PA)
                    AName$ = "Tree Chopper" ;must be changed to achievement name
                   ; OutPut(Player, "----- DeBug ----- Checking line " + AchCheck, 32, 23, 43)
                     
                        If (AchCheck = AName) ; if line in file, end script since player has avh already
                        ;OutPut(Player, "----- DeBug ----- ach complete", 32, 23, 43)
                        DoEvents(50) ; keep number low.
                        EndFile = 1 ;end repeat and end script
                        LTIsComplete$ = "True" ;player has finished this achievment
 
                         EndIf
                       CloseFile(AchCheck) ;close file.
                   
                Until (EndFile = 1)
                CloseFile(PA) ;close file

    If (LTIsComplete = "True") ; player has completed lion tamer achievement.
        CloseDialog(Player, ChatBox)
        ChatBox$ = OpenDialog(Player, Target, "Achievements", 282) ;change to other background to show trophys.
        DialogOutPut(Player, "You have completed Tree Chopper achievement. Congratulations!!", 230, 145, 23)
       ; DialogOutPUt(Player, ChatBox, "", 0, 0, 0) ;take space
        DialogInput(Player, ChatBox, "                                                                                                                                                                                                                                                                                                                                                                  Close")
        CloseDialog(Player, ChatBox)
        
     Else
     ;get kill amount to display to player.
     ;---------------------------------------------
  ;Check Player status in Lion Tamer achievenmet  
    ;give player different text based on if achienemet is started or not.
     YoungLionA$ = + PName + " Tree Chopper.txt" ;file name to be opened
     CloseDialog(Player, ChatBox)
     ChatBox$ = OpenDialog(Player, Target, "Achievements", 281) ;change to other background to show trophys.
     YLionFile% = OpenFile(YoungLionA) 

        If (YLionFile = 0)
            DialogOUtPut(Player, ChatBox, "You have not started, this Achievement yet. You can start this Achievement, by cutting a tree and collecting a log.", 230, 145, 23)   
            TestNumber% = 0 ; set to 0 since achievment has not been started.    
        Else ;Achievenemet started read file to get amount that player has collected/killed.
            ;using code names from other place to speed up procces.        
            ;SeekFile(YLionFile, FileSize(YLionA))
            YLionCheck% = ReadLine(YLionFile) ;read number if ther is one to add to amount.
            TestNumber% = YLionCheck%         
        EndIf
         
         CloseFile(YLionFile) ;close achievements file that is made  
        DialogOutPut(Player, ChatBox, "You have Collected " + TestNumber + " out of 400 Logs.", 255, 255, 0) ;tele player the amount of kills or items collected.       
        PNOption% = DialogInput(Player, ChatBox, "Close Tree Chopper,Close Achievements")
        CloseDialog(Player, ChatBox)
        If (PNOption = 1) ;close this achievements and use repeat
        CloseDialog(Player, ChatBox)
        Else ;close portable trainer
        FinishAch = 0 ;set to zero and end repeat.
        CloseDialog(Player, ChatBox)
        EndIf
     EndIf
 ;End Tree Chopper
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
Elseif (PAOption = 6) ;Larvae balance
        LTIsComplete$ = "False" ; set to false till true when player finished lion tamer achievement
        PAName$ = + PName + "Achievements.txt"
        PA$ = OpenFile(PAName) ;using to check if file exestits below. (P)layer (A)chievements
    
 ;only run this if file is not there otherwize close opend file above and continue with script.
    
               Repeat
                    DoEvents(12)
                    ;SeekFile(PA, FileSize(PAName))
                    AchCheck$ = ReadLine(PA) 
                    EndFile$ = Eof(PA)
                    AName$ = "Larvae balance" ;must be changed to achievement name
                   ; OutPut(Player, "----- DeBug ----- Checking line " + AchCheck, 32, 23, 43)
                     
                        If (AchCheck = AName) ; if line in file, end script since player has avh already
                        ;OutPut(Player, "----- DeBug ----- ach complete", 32, 23, 43)
                        DoEvents(50) ; keep number low.
                        EndFile = 1 ;end repeat and end script
                        LTIsComplete$ = "True" ;player has finished this achievment
 
                         EndIf
                       CloseFile(AchCheck) ;close file.
                   
                Until (EndFile = 1)
                CloseFile(PA) ;close file

    If (LTIsComplete = "True") ; player has completed Larvae balance achievement.
        CloseDialog(Player, ChatBox)
        ChatBox$ = OpenDialog(Player, Target, "Achievements", 752) ;change to other background to show trophys.
        DialogOutPut(Player, "You have completed Larvae balance achievement. Congratulations!!", 230, 145, 23)
       ; DialogOutPUt(Player, ChatBox, "", 0, 0, 0) ;take space
        DialogInput(Player, ChatBox, "                                                                                                                                                                                                                                                                                                                                                                  Close")
        CloseDialog(Player, ChatBox)
        
     Else
     ;get kill amount to display to player.
     ;---------------------------------------------
  ;Check Player status in Lion Tamer achievenmet  
    ;give player different text based on if achienemet is started or not.
     YoungLionA$ = + PName + " Larvae balance.txt" ;file name to be opened
     CloseDialog(Player, ChatBox)
     ChatBox$ = OpenDialog(Player, Target, "Achievements", 751) ;change to other background to show trophys.
     YLionFile% = OpenFile(YoungLionA) 

        If (YLionFile = 0)
            DialogOUtPut(Player, ChatBox, "You have not started, this Achievement yet. You can start this Achievement, by killing any Larvae.", 230, 145, 23)   
            TestNumber% = 0 ; set to 0 since achievment has not been started.    
        Else ;Achievenemet started read file to get amount that player has collected/killed.
            ;using code names from other place to speed up procces.        
            ;SeekFile(YLionFile, FileSize(YLionA))
            YLionCheck% = ReadLine(YLionFile) ;read number if ther is one to add to amount.
            TestNumber% = YLionCheck%         
        EndIf
         
         CloseFile(YLionFile) ;close achievements file that is made  
        DialogOutPut(Player, ChatBox, "You have killed " + TestNumber + " out of 125 Larvaes.", 255, 255, 0) ;tele player the amount of kills or items collected.       
        PNOption% = DialogInput(Player, ChatBox, "Close Larvae balance,Close Achievements")
        CloseDialog(Player, ChatBox)
        If (PNOption = 1) ;close this achievements and use repeat
        CloseDialog(Player, ChatBox)
        Else ;close portable trainer
        FinishAch = 0 ;set to zero and end repeat.
        CloseDialog(Player, ChatBox)
        EndIf
     EndIf
 
 ;End Larvae balance 
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------
;----------------------------------------------------------------------------------------------




    
 Elseif (PAOption = 7) ;show more 
 DoEvents(1000)
 ;close dialog and open a new one, with other achevments.
CloseDialog(Player, ChatBox)
ElseIf (PAOption = 8) ;close do nothing.
DoEvents(1000)
CloseDialog(Player, ChatBox)
FinishAch = 0 ;set to zero and end repeat.
EndIf
DoEvents(600)



Until (FinishAch = 0) ;when finishach = 0 stop repeat.









End Function