Advertisement
Guest User

Security

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