Advertisement
Guest User

Account Locker Script

a guest
Jun 12th, 2012
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //===== eAthena Script =======================================
  2. //= Account Locker
  3. //===== By: ==================================================
  4. //= eathenanabs
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= eAthena SVN (SQL ONLY)
  9. //===== Description: =========================================
  10. //= Locks Account.
  11. //= Disables Trade / Drop / Vend / Storage of players.
  12. //===== Additional Comments: =================================
  13. //= Special Thanks to:
  14. //= theultramage
  15. //============================================================
  16.  
  17. prontera.gat,174,142,3  script  Bogart the Locksmith    63,{   
  18.    
  19.  
  20. if (getgmlevel() >= 2) goto L_forbidden;
  21. if (#locked == 1) goto L_aunlock;
  22. mes " [ ^FF0000Bogart Mao^000000 ]";
  23. mes "Hello, do you want to use my account locking powers?";    
  24. mes "In this world now, no one is your friend because we are in the Era of Money War";
  25. menu "Yes Master.",-,"No thanks.",L_noty;  
  26. next;  
  27.    
  28.  
  29.  
  30. mes " [ ^FF0000Bogart Mao^000000 ]";   
  31. mes "Well you have to input 10 Numbers for your password as long as you can remember it.";
  32. next;  
  33. mes " [ ^FF0000Bogart Mao^000000 ]";   
  34. mes "Example: 10 207 4 1 2 6 48 7 37 8";
  35. next;
  36. mes " [ ^FF0000Bogart Mao^000000 ]";   
  37. mes "If you leave it to 0, you will have to set it again.";
  38. next;
  39. mes "^FF0000Note: GM's are NOT reliable if you forgot your password / secret answer! and they will not entertain such problems.^000000";
  40. next;  
  41.    
  42. mes " [ ^FF0000Bogart Mao^000000 ]";   
  43. mes "Input 1st number";
  44. input #pas1;   
  45. next;  
  46. if (#pas1 == 0) {
  47. mes " [ ^FF0000Bogart Mao^000000 ]";
  48. mes "Your Password cannot contain Zero!";
  49. close;
  50. }
  51.  
  52.    
  53.    
  54. mes " [ ^FF0000Bogart Mao^000000 ]";   
  55. mes "Input 2nd number";
  56. input #pas2;   
  57. next;  
  58. if (#pas2 == 0) {
  59. mes " [ ^FF0000Bogart Mao^000000 ]";
  60. mes "Your Password cannot contain Zero!";
  61. close;
  62. }
  63.  
  64.    
  65.    
  66. mes " [ ^FF0000Bogart Mao^000000 ]";   
  67. mes "Input 3rd number";
  68. input #pas3;   
  69. next;  
  70. if (#pas3 == 0) {
  71. mes " [ ^FF0000Bogart Mao^000000 ]";
  72. mes "Your Password cannot contain Zero!";
  73. close;
  74. }
  75.    
  76.    
  77. mes " [ ^FF0000Bogart Mao^000000 ]";   
  78. mes "Input 4th number";
  79. input #pas4;   
  80. next;  
  81. if (#pas4 == 0) {
  82. mes " [ ^FF0000Bogart Mao^000000 ]";
  83. mes "Your Password cannot contain Zero!";
  84. close;
  85. }
  86.    
  87.    
  88.    
  89.  
  90. mes " [ ^FF0000Bogart Mao^000000 ]";   
  91. mes "Input 5th number";
  92. input #pas5;   
  93. next;  
  94. if (#pas5 == 0) {
  95. mes " [ ^FF0000Bogart Mao^000000 ]";
  96. mes "Your Password cannot contain Zero!";
  97. close;
  98. }
  99.    
  100.        
  101. mes " [ ^FF0000Bogart Mao^000000 ]";   
  102. mes "Input 6th number";
  103. input #pas6;   
  104. next;  
  105. if (#pas6 == 0) {
  106. mes " [ ^FF0000Bogart Mao^000000 ]";
  107. mes "Your Password cannot contain Zero!";
  108. close;
  109. }
  110.    
  111.    
  112. mes " [ ^FF0000Bogart Mao^000000 ]";   
  113. mes "Input 7th number";
  114. input #pas7;   
  115. next;  
  116. if (#pas7 == 0) {
  117. mes " [ ^FF0000Bogart Mao^000000 ]";
  118. mes "Your Password cannot contain Zero!";
  119. close;
  120. }
  121.  
  122.        
  123. mes " [ ^FF0000Bogart Mao^000000 ]";   
  124. mes "Input 8th number";
  125. input #pas8;   
  126. next;  
  127. if (#pas8 == 0) {
  128. mes " [ ^FF0000Bogart Mao^000000 ]";
  129. mes "Your Password cannot contain Zero!";
  130. close;
  131. }
  132.    
  133.        
  134. mes " [ ^FF0000Bogart Mao^000000 ]";   
  135. mes "Input 9th number";
  136. input #pas9;   
  137. next;  
  138. if (#pas9 == 0) {
  139. mes " [ ^FF0000Bogart Mao^000000 ]";
  140. mes "Your Password cannot contain Zero!";
  141. close;
  142. }
  143.  
  144.  
  145. mes " [ ^FF0000Bogart Mao^000000 ]";   
  146. mes "Input 10th number";
  147. input #pas10;  
  148. set #locked,1;
  149. next;  
  150. if (#pas10 == 0) {
  151. mes " [ ^FF0000Bogart Mao^000000 ]";
  152. mes "Your Password cannot contain Zero!";
  153. close;
  154. }
  155.  
  156. if (#setsecreta == 1) goto Lyessecret;
  157. next;
  158. mes " [ ^FF0000Bogart Mao^000000 ]";       
  159. mes "Please Input your secret word. Incase you forgot your password, we will be asking for this information..";
  160. input #secret$;    
  161. if(#secret$==" " || #secret$==null) goto Lnosecret;
  162. set #setsecreta,1;
  163. mes " [ ^FF0000Bogart Mao^000000 ]";       
  164. mes "Your Account is now Locked";  
  165. atcommand "@adjgmlvl 1 "+ strcharinfo(0);  
  166. close;     
  167.  
  168. Lnosecret:
  169. mes " [ ^FF0000Bogart Mao^000000 ]";   
  170. mes "You cannot input a blank word.. do it again";
  171. close;
  172.  
  173. Lyessecret:
  174. mes " [ ^FF0000Bogart Mao^000000 ]";       
  175. mes "Your Account is now Locked";      
  176. atcommand "@adjgmlvl 1 "+ strcharinfo(0);  
  177. close; 
  178.        
  179.    
  180. L_forbidden:
  181. mes " [ ^FF0000Bogart Mao^000000 ]";
  182. mes "You are a Staff! You can't use this NPC!";
  183. close;
  184.  
  185.  
  186. L_aunlock: 
  187. mes " [ ^FF0000Bogart Mao^000000 ]";   
  188. mes "Hi there, do you want to unlock your account?";   
  189. mes "You only have 5 times to enter the CORRECT password, if you enter the incorrect password for 5 times, you'll be banned for 5 minutes";
  190. menu "Yes",-,"No",L_ayawpa,"Forgot Password",L_forgot; 
  191. next;  
  192.    
  193.  
  194. mes " [ ^FF0000Bogart Mao^000000 ]";       
  195. mes "Please input the 1st number of your password";
  196. input upas1;   
  197. if (upas1 != #pas1) {
  198. mes " [ ^FF0000Bogart Mao^000000 ]";
  199. mes "Incorrect Password!";
  200. set incorrectpass,incorrectpass+1;
  201. if(incorrectpass >= 5)
  202. {
  203. set incorrectpass,0;
  204. atcommand "@ban 5mn "+strcharinfo(0);
  205. }
  206.  
  207. close;
  208. }
  209. if (upas1 == #pas1);   
  210. next;      
  211.    
  212. mes " [ ^FF0000Bogart Mao^000000 ]";       
  213. mes "Please input the 2nd number of your password";
  214. input upas2;   
  215. if (upas2 != #pas2) {
  216. mes " [ ^FF0000Bogart Mao^000000 ]";
  217. mes "Incorrect Password!";
  218. set incorrectpass,incorrectpass+1;
  219. if(incorrectpass >= 5)
  220. {
  221. set incorrectpass,0;
  222. atcommand "@ban 5mn "+strcharinfo(0);
  223. }
  224.  
  225. close;
  226. }
  227. if (upas2 == #pas2);   
  228. next;  
  229.    
  230. mes " [ ^FF0000Bogart Mao^000000 ]";       
  231. mes "Please input the 3rd number of your password";
  232. input upas3;   
  233. if (upas3 != #pas3) {
  234. mes " [ ^FF0000Bogart Mao^000000 ]";
  235. mes "Incorrect Password!";
  236. set incorrectpass,incorrectpass+1;
  237. if(incorrectpass >= 5)
  238. {
  239. set incorrectpass,0;
  240. atcommand "@ban 5mn "+strcharinfo(0);
  241. }
  242.  
  243. close;
  244. }
  245. if (upas3 == #pas3);   
  246. next;
  247.  
  248. mes " [ ^FF0000Bogart Mao^000000 ]";       
  249. mes "Please input the 4th number of your password";
  250. input upas4;   
  251. if (upas4 != #pas4) {
  252. mes " [ ^FF0000Bogart Mao^000000 ]";
  253. mes "Incorrect Password!";
  254. set incorrectpass,incorrectpass+1;
  255. if(incorrectpass >= 5)
  256. {
  257. set incorrectpass,0;
  258. atcommand "@ban 5mn "+strcharinfo(0);
  259. }
  260.  
  261. close;
  262. }
  263. if(upas4 == #pas4);
  264. next;
  265.    
  266. mes " [ ^FF0000Bogart Mao^000000 ]";       
  267. mes "Please input the 5th number of your password";
  268. input upas5;   
  269. if (upas5 != #pas5) {
  270. mes " [ ^FF0000Bogart Mao^000000 ]";
  271. mes "Incorrect Password!";
  272. set incorrectpass,incorrectpass+1;
  273. if(incorrectpass >= 5)
  274. {
  275. set incorrectpass,0;
  276. atcommand "@ban 5mn "+strcharinfo(0);
  277. }
  278.  
  279. close;
  280. }
  281. if (upas5 == #pas5);   
  282. next;  
  283.    
  284. mes " [ ^FF0000Bogart Mao^000000 ]";       
  285. mes "Please input the 6th number of your password";
  286. input upas6;   
  287. if (upas6 != #pas6) {
  288. mes " [ ^FF0000Bogart Mao^000000 ]";
  289. mes "Incorrect Password!";
  290.  
  291. set incorrectpass,incorrectpass+1;
  292. if(incorrectpass >= 5)
  293. {
  294. set incorrectpass,0;
  295. atcommand "@ban 5mn "+strcharinfo(0);
  296. }
  297.  
  298. close;
  299. }
  300. if(upas6 == #pas6);
  301. next;  
  302.    
  303. mes " [ ^FF0000Bogart Mao^000000 ]";       
  304. mes "Please input the 7th number of your password";
  305. input upas7;   
  306. if (upas7 != #pas7) {
  307. mes " [ ^FF0000Bogart Mao^000000 ]";
  308. mes "Incorrect Password!";
  309. set incorrectpass,incorrectpass+1;
  310. if(incorrectpass >= 5)
  311. {
  312. set incorrectpass,0;
  313.  
  314. atcommand "@ban 5mn "+strcharinfo(0);
  315. }
  316.  
  317. close;
  318. }
  319. if(upas7 == #pas7);
  320. next;  
  321.    
  322. mes " [ ^FF0000Bogart Mao^000000 ]";       
  323. mes "Please input the 8th number of your password";
  324. input upas8;   
  325. if (upas8 != #pas8) {
  326. mes " [ ^FF0000Bogart Mao^000000 ]";
  327. mes "Incorrect Password!";
  328. set incorrectpass,incorrectpass+1;
  329. if(incorrectpass >= 5)
  330. {
  331. set incorrectpass,0;
  332. atcommand "@ban 5mn "+strcharinfo(0);
  333. }
  334.  
  335. close;
  336. }
  337. if(upas8 == #pas8);
  338. next;  
  339.    
  340.    
  341. mes " [ ^FF0000Bogart Mao^000000 ]";       
  342. mes "Please input the 9th number of your password";
  343. input upas9;   
  344. if (upas9 != #pas9) {
  345. mes " [ ^FF0000Bogart Mao^000000 ]";
  346. mes "Incorrect Password!";
  347. set incorrectpass,incorrectpass+1;
  348. if(incorrectpass >= 5)
  349. {
  350. set incorrectpass,0;
  351. atcommand "@ban 5mn "+strcharinfo(0);
  352. }
  353.  
  354. close;
  355. }
  356. if(upas9 == #pas9);
  357. next;  
  358.    
  359. mes " [ ^FF0000Bogart Mao^000000 ]";       
  360. mes "Please input the 10th number of your password";   
  361. input upas10;  
  362. if (upas10 != #pas10) {
  363. mes " [ ^FF0000Bogart Mao^000000 ]";
  364. mes "Incorrect Password!";
  365. set incorrectpass,incorrectpass+1;
  366. if(incorrectpass >= 5)
  367. {
  368. set incorrectpass,0;
  369. atcommand "@ban 5mn "+strcharinfo(0);
  370. }
  371.  
  372. close;
  373. }
  374. if(upas10 == #pas10);
  375. next;  
  376.    
  377. mes " [ ^FF0000Bogart Mao^000000 ]";       
  378. set #locked,0; 
  379. mes "Your account is now unlocked!";   
  380. atcommand "@adjgmlvl 0 "+ strcharinfo(0);
  381. set incorrectpass,0;               
  382. close;
  383.    
  384.    
  385.    
  386. L_noty:
  387. mes " [ ^FF0000Bogart Mao^000000 ]";   
  388. mes "Okay, come again if you need me.";
  389. close; 
  390.    
  391. L_ayawpa:  
  392. mes " [ ^FF0000Bogart Mao^000000 ]";   
  393. mes "Okay, come again if you need me.";
  394. close; 
  395.        
  396.  
  397.    
  398.    
  399. L_forgot:  
  400. next;
  401. mes " [ ^FF0000Bogart Mao^000000 ]";
  402. mes "You have to enter your email address & your secret answer for you to reset your password";
  403. next;
  404. mes " [ ^FF0000Bogart Mao^000000 ]";
  405. query_sql "SELECT `email` FROM `login` WHERE `account_id` = "+getcharid(3), .@email$;  
  406. mes "Input your email address";
  407. input .@emailc$;
  408. next;      
  409. mes " [ ^FF0000Bogart Mao^000000 ]";
  410. mes "Input your secret answer";
  411. input .@secreta$;  
  412. if(.@secreta$ != #secret$ || .@email$ != .@emailc$) goto L_wrongf; 
  413. if(.@secreta$ == #secret$ && .@email$ == .@emailc$) goto L_correctinfo;
  414.  
  415.  
  416. L_correctinfo:
  417. next;
  418. mes " [ ^FF0000Bogart Mao^000000 ]";   
  419. mes "Your passwords has been reset and your account has been unlocked";
  420. set #locked,0; 
  421. atcommand "@adjgmlvl 0 "+ strcharinfo(0);
  422. close;
  423. L_wrongf:      
  424. next;
  425. mes " [ ^FF0000Bogart Mao^000000 ]";
  426. mes "Incorrect Info!";
  427. close; 
  428.  
  429.  
  430. OnPcLoginEvent:    
  431. if (#locked >= 1 && getgmlevel() < 1)  
  432. {
  433. atcommand "@adjgmlvl 1 "+ strcharinfo(0);          
  434. message strcharinfo(0),"This account is currently Locked";
  435. }
  436. if (#locked >= 1 && getgmlevel() >= 1) 
  437.  
  438. message strcharinfo(0),"This account is currently Locked";
  439.  
  440. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement