viewing paste Midgard Security System | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
//Midgard Security System
//Version 3.4
//by GmOcean
 
prontera,160,180,0  script  Midgard Security    413,{
set .@npcName$,"[^0000FF Security Personel ^000000]";
 
mes .@npcName$;
mes "Welcome! I am a member of Midgard's Security.";
mes "As such, it is my job to ensure account safety of our players.";
mes "That is of course if they wish to use our service.";
next;
mes "So, what would you like to do?";
goto LacctCheck;
  LacctCheck:
  menu "Enable / Disable Security",iAD,"Change Password",iCP,"Change RecoveryPhrase",iRP,"View Password Attempts",iVP,"Cancel",cancel;
    iAD:
    if (#SecurityPass$!="NoPopUp"){set #SecurityPass$,"NoPopUp"; mes "Security is now turned OFF."; close;}
    if (#SecurityPass$=="NoPopUp")
           {next;
              mes "Input a new Password"; 
              input .@CSpassword$;
                if (.@CSpassword$==#RecoveryPhrase$){next; mes "Your Password cannot be the same as your Recovery-Phrase. Please try agian."; goto iAD;}
                set @CSpassword$,.@CSpassword$;
                next;
                mes "Input it again for confirmation.";
                input .@CSpassword$;
                if (.@CSpassword$!=@CSpassword$){mes "That is incorrect. Try again."; close;}
                set #SecurityPass$,@CSpassword$;
                mes "Security is now turned ON.";
                next;
                goto iRecoveryPhrase;
                iRecoveryPhrase:
                mes "... ... ... ...";
                mes "Now then, please input a recovery phrase";
                mes "This phrase will be used to recover your password, in case you forget it.";
                input .@RecoveryPhrase$;
                if (.@RecoveryPhrase$==#SecurityPass$){next; mes "Your Recovery-Phrase cannot be the same as your Password. Please try again."; next; goto iRecoveryPhrase;}
                set @RecoveryPhrase$,.@RecoveryPhrase$;
                next;
                mes "Input it again for confirmation.";
                input .@RecoveryPhrase$;
                if (@RecoveryPhrase$!=.@RecoveryPhrase$){mes "Those phrases don't match. Please try again."; close;}
                set #RecoveryPhrase$,@RecoveryPhrase$;
                mes "Please write this phrase down. It will be used to recover your password should you ever forget it.";
                next;
                mes "Once again, here it is:";
                mes "^0000FF"+#RecoveryPhrase$+"^000000";
                mes "WRITE IT DOWN ! ";
                close;}
    end;
    iCP:
        next;
    mes .@npcName$;
    if (#SecurityPass$=="NoPopUp"){mes "You don't have a password set."; mes "^0000FFPlease go set one by enabling the security.^000000"; close;}
        mes "Very well then. Please Enter your Current Security Password.";
    input .@CSpassword$;
    if (.@CSpassword$!=#SecurityPass$){next; mes "That is incorrect. Try again."; close;}
    next;
        mes "Now then. Please Enter your new Security Password.";
        input .@NSpassword$;
        if (.@NSpassword$==#RecoveryPhrase$){next; mes "Your Password cannot be the same as your Recovery-Phrase. Please try agian."; goto iCP;}
        set @NSpassword$,.@NSpassword$;
        next;
        mes "Please Enter it again for confirmation.";
        input .@CNSpassword$;
        if (@NSpassword$!=.@CNSpassword$){next; mes "That is incorrect. Try again."; close;}
        set #SecurityPass$,.@CNSpassword$;
        next;
        mes "Your password was changed successfully. Come again.";
        close;
        iRP:
        next;
        mes .@npcName$;
        if (#RecoveryPhrase$=="")
           {mes "You don't have a Recovery Phrase set.";
            mes "Please set one by enabling the Security.";
                close;}
        mes "Very well then. Please Enter your Current Recovery Phrase.";
        input .@RecovPhrase$;
        if (.@RecovPhrase$!=#RecoveryPhrase$){next; mes "That is incorrect. Try again."; close;}
        next;
        mes "Now then. Please Enter your new Recovery Phrase.";
        input .@NRP$;
        if (.@NRP$==#SecurityPass$){next; mes "Your Recovery-Phrase cannot be the same as your Password. Please try again."; goto iRP;}
        set @NRP$,.@NRP$;
        next;
        mes "Please enter it again for confirmation.";
        input .@NRP$;
        if (@NRP$!=.@NRP$){next; mes "Those phrases don't match. Try again."; close;}
        set #RecoveryPhrase$,@NRP$;
        next;
        mes "Your Recovery Phrase was changed successfully.";
        mes "Please write it down. It will be used in case you forget your password.";
        next;
        mes "Here it is:";
        mes "^0000FF"+#RecoveryPhrase$+"^000000";
        mes "WRITE IT DOWN !";
        close;
        iVP:
        next;
        mes .@npcName$;
        mes "Alright. Here you go.";
        mes "There have been in total: ^0000FF"+#SecurityAttempt+"^000000 password attempts.";
        close;
        cancel:
        close;
 
OnPCLoginEvent:
set .@npcName$,"[^0000FF Security Personel ^000000]";
set @BanTime,5;
if (#SecurityPass$=="")
  {mes .@npcName$;
     mes "This server has a unique system which allows you to have a SECOND password.";
     mes "This is of course optional. Would you like to use it?";
     menu "Yes, set it up.",iYes,"No, and please stop showing up.",iNo;
       iYes:
         next;
         callfunc "Set_AcctSecure";
         iNo:
         set #SecurityPass$,"NoPopUp";
         percentheal 100,100;
         mes "Alright then. Just remember, if you're interested, talk to the Security Personel in prontera.";
         close;
         end;}
if (#SecurityPass$=="NoPopUp"){set @SecurityPass,1; end;}
if (#SecurityPass$!="NoPopUp" && #SecurityPass$==#SecurityPass$)          
   {sc_start 112,999999999,100;
sc_start 1,999999999,100;
sc_start 8,999999999,100;
goto InputSecurityPass;}
end;
 
OnPCLoadMapEvent:
getmapxy(@Map$,@X,@Y,0);
if (@Map$=="prontera" || @Map$!="prontera"){
if (@SecurityPass==0 && #SecurityPass$!="NoPopUp" && #SecurityPass$==#SecurityPass$)
   {goto InputSecurityPass;}
if (@SecurityPass==0 && #SecurityPass$=="NoPopUp"){set @SecurityPass,1; end;}
if (@SecurityPass==1){end;}
end;
}    
 
InputSecurityPass:
mes "This account is protected by Midgard Security Personel.";
mes "Input your password to continue playing.";
mes "OR";
mes "Input your Recovery-Phrase in case you lost your password.";
input .@spass$;
if (#RecoveryPhrase$==.@spass$)
   {next;
      mes "Here is your password, don't lose it again.";
    mes "^0000FF"+#SecurityPass$+"^000000";
    next; goto InputSecurityPass;}
if (#SecurityPass$==.@spass$)
   {mes "That is correct"; set @SecurityPass,1; sc_end 1; sc_end 112; sc_end 8; 
      percentheal 100,100; close; end;}
if (#SecurityPass$!=.@spass$ && #RecoveryPhrase$!=.@spass$)
   {set @Attempt,@Attempt+1; mes "INCORRECT!!"; 
    if (@Attempt>=3){atcommand "@ban "+@BanTime+"mn "+strcharinfo(0)+""; end;} 
        next; goto InputSecurityPass;}
close;
end;
}
 
function    script  Set_AcctSecure  {
set .@npcName$,"[^0000FF Security Personel ^000000]";
menu "Set up a Security Password",iSP,"Information on System",iSI,"Cancel",cancel;
  iSP:
    next;
    mes .@npcName$;
    mes "Very well then. Please enter a Password.";
    mes "It may contain 4-32 alphanumeric characters";
    mes "(A-Z) & (1-0) are all alphanumeric characters.";
    input .@Npassword$;
    set @Npassword$,.@Npassword$;
    next;
    mes "Please enter your password again for confirmation.";
    input .@Npassword$;
    if (.@Npassword$!=@Npassword$){mes "The Passwords did not match. Try again by talking to a security personel."; goto iSP;}
    set #SecurityPass$,@Npassword$;
    next;
    mes "Your password was set successfully.";
    next;
    goto iRecoveryPhrase;
    iRecoveryPhrase:
    mes "Now then. Please enter a Recovery Phrase";
    mes "This phrase will be used in case you forget your password.";
    input .@RecovPhrase$;
    if (.@RecovPhrase$==#SecurityPass$){mes "Your Recovery-Phrase cannot be the same as your Password. Please try agian."; next; goto iRecoveryPhrase;}
    set @RecovPhrase$,.@RecovPhrase$;
    next;
    mes "Please input your Recovery Phrase again for confirmation.";
    input .@RecovPhrase$;
    if (@RecovPhrase$!=.@RecovPhrase$){mes "The Recovery Phrases did not match. Try again by talking to a security personel."; next; goto iRecoveryPhrase;}
    set #RecoveryPhrase$,@RecovPhrase$;
    next;
    mes "Your Recovery Phrase was set successfully.";
    mes "Please write this down. It will be used if you forgot your password.";
    mes "Here it is:";
    mes "^0000FF"+#RecoveryPhrase$+"^000000";
  mes "WRITE IT DOWN !!";
    close;
    iSI:
    next;
    mes .@npcName$;
    mes "This system is a unique system that will allow you to have a second password for your account.";
    mes "In other words, after you login at the login screen, our security personel will ask you to enter your Security Password.";
    mes "This will prevent others from hacking into your account while you're away.";
    next;
    mes .@npcName$;
    mes "That is all there is to this system.";
    mes "So, what would you like to do?";
    callfunc "Set_AcctSecure";
    end;
    cancel:
    close;
}
Viewed 862 times, submitted by Guest.