Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2014
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 44.38 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P PinCode
  3. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
  4. ===================================================================
  5. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 1004)
  6. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
  7. @@ -97,6 +97,12 @@
  8.             return;
  9.         }
  10.  
  11. +       if (activeChar.isSubmitingPin())
  12. +       {
  13. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  14. +           return;
  15. +       }
  16. +      
  17.         // Fix enchant transactions
  18.         if(activeChar.isProcessingTransaction())
  19.         {
  20. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java
  21. ===================================================================
  22. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java   (revision 1004)
  23. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeRequest.java   (working copy)
  24. @@ -48,7 +48,7 @@
  25.         L2PcInstance player = getClient().getActiveChar();
  26.         if (player == null)
  27.             return;
  28. -      
  29. +  
  30.         if (!player.getAccessLevel().allowTransaction())
  31.         {
  32.             player.sendMessage("Transactions are disable for your Access Level");
  33. @@ -73,6 +73,12 @@
  34.             return;
  35.         }
  36.        
  37. +       if (player.isSubmitingPin() || ((L2PcInstance) target).isSubmitingPin())
  38. +       {
  39. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  40. +           return;
  41. +       }
  42. +      
  43.         if (partner.isAway())
  44.         {
  45.             player.sendMessage("You can't Request a Trade when partner is Away");
  46. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSendFriendMsg.java
  47. ===================================================================
  48. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSendFriendMsg.java   (revision 1004)
  49. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSendFriendMsg.java   (working copy)
  50. @@ -60,6 +60,12 @@
  51.             activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME));
  52.             return;
  53.         }
  54. +      
  55. +       if (activeChar.isSubmitingPin() || targetPlayer.isSubmitingPin())
  56. +       {
  57. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  58. +           return;
  59. +       }
  60.  
  61.         if(Config.LOG_CHAT)
  62.         {
  63. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestShowMiniMap.java
  64. ===================================================================
  65. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestShowMiniMap.java (revision 1004)
  66. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestShowMiniMap.java (working copy)
  67. @@ -40,6 +40,12 @@
  68.         if(activeChar == null)
  69.             return;
  70.  
  71. +       if (activeChar.isSubmitingPin())
  72. +       {
  73. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  74. +           return;
  75. +       }
  76. +      
  77.         activeChar.sendPacket(new ShowMiniMap(1665));
  78.     }
  79.  
  80. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java
  81. ===================================================================
  82. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java   (revision 1004)
  83. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/Say2.java   (working copy)
  84. @@ -143,7 +143,11 @@
  85.             activeChar.sendMessage("You may not chat while a chat ban is in effect.");
  86.             return;
  87.         }
  88. -
  89. +       if (activeChar.isSubmitingPin())
  90. +       {
  91. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  92. +           return;
  93. +       }
  94.         if(activeChar.isInJail() && Config.JAIL_DISABLE_CHAT)
  95.         {
  96.             if(_type == TELL || _type == SHOUT || _type == TRADE || _type == HERO_VOICE)
  97. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestAquireSkill.java
  98. ===================================================================
  99. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestAquireSkill.java (revision 1004)
  100. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestAquireSkill.java (working copy)
  101. @@ -116,6 +116,12 @@
  102.                 Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " tried to learn skill that he can't!!!", IllegalPlayerAction.PUNISH_KICK);
  103.                 return;
  104.             }
  105. +          
  106. +           if (player.isSubmitingPin())
  107. +           {
  108. +               player.sendMessage("Unable to do any action while PIN is not submitted");
  109. +               return;
  110. +           }
  111.  
  112.             if(player.getSp() >= _requiredSp)
  113.             {
  114. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
  115. ===================================================================
  116. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java    (revision 1004)
  117. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java    (working copy)
  118. @@ -86,6 +86,12 @@
  119.             return;
  120.         }
  121.        
  122. +       if (activeChar.isSubmitingPin())
  123. +       {
  124. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  125. +           return;
  126. +       }
  127. +      
  128.         if (activeChar.getPrivateStoreType() != 0)
  129.         {
  130.             activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_TRADE_DISCARD_DROP_ITEM_WHILE_IN_SHOPMODE));
  131. Index: head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java
  132. ===================================================================
  133. --- head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (revision 1004)
  134. +++ head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (working copy)
  135. @@ -37,6 +37,7 @@
  136.  import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.VersionCmd;
  137.  import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Voting;
  138.  import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Wedding;
  139. +import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Pin;
  140.  
  141.  /**
  142.   * This class ...
  143. @@ -65,6 +66,7 @@
  144.         _datatable = new FastMap<String, IVoicedCommandHandler>();
  145.        
  146.         registerVoicedCommandHandler(new Voting());
  147. +       registerVoicedCommandHandler(new Pin());
  148.        
  149.         if (Config.BANKING_SYSTEM_ENABLED)
  150.         {
  151. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestMagicSkillUse.java
  152. ===================================================================
  153. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestMagicSkillUse.java   (revision 1004)
  154. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestMagicSkillUse.java   (working copy)
  155. @@ -64,6 +64,12 @@
  156.             activeChar.sendPacket(ActionFailed.STATIC_PACKET);
  157.             return;
  158.         }
  159. +      
  160. +       if (activeChar.isSubmitingPin())
  161. +       {
  162. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  163. +           return;
  164. +       }
  165.  
  166.         if(activeChar.isOutOfControl())
  167.         {
  168. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStopPledgeWar.java
  169. ===================================================================
  170. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStopPledgeWar.java   (revision 1004)
  171. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStopPledgeWar.java   (working copy)
  172. @@ -46,6 +46,12 @@
  173.         if(playerClan == null)
  174.             return;
  175.  
  176. +       if (player.isSubmitingPin())
  177. +       {
  178. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  179. +           return;
  180. +       }
  181. +
  182.         L2Clan clan = ClanTable.getInstance().getClanByName(_pledgeName);
  183.         if(clan == null)
  184.         {
  185. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPetition.java
  186. ===================================================================
  187. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPetition.java    (revision 1004)
  188. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestPetition.java    (working copy)
  189. @@ -47,6 +47,12 @@
  190.         L2PcInstance activeChar = getClient().getActiveChar();
  191.         if(activeChar == null)
  192.             return;
  193. +      
  194. +       if (activeChar.isSubmitingPin())
  195. +       {
  196. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  197. +           return;
  198. +       }
  199.  
  200.         if(!GmListTable.getInstance().isGmOnline(false))
  201.         {
  202. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestExEnchantSkill.java
  203. ===================================================================
  204. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestExEnchantSkill.java  (revision 1004)
  205. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestExEnchantSkill.java  (working copy)
  206. @@ -116,6 +116,12 @@
  207.             Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " tried to learn skill that he can't!!!", IllegalPlayerAction.PUNISH_KICK);
  208.             return;
  209.         }
  210. +      
  211. +       if (player.isSubmitingPin())
  212. +       {
  213. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  214. +           return;
  215. +       }
  216.  
  217.         if(player.getSp() >= _requiredSp)
  218.         {
  219. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
  220. ===================================================================
  221. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (revision 1004)
  222. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (working copy)
  223. @@ -20,6 +20,7 @@
  224.  import java.util.Date;
  225.  import java.util.logging.Logger;
  226.  import java.util.regex.Matcher;
  227. +import javolution.text.TextBuilder;
  228.  import java.util.regex.Pattern;
  229.  import java.util.regex.PatternSyntaxException;
  230.  
  231. @@ -297,8 +298,47 @@
  232.         // Check player skills
  233.         if (Config.CHECK_SKILLS_ON_ENTER && !Config.ALT_GAME_SKILL_LEARN)
  234.             if (!activeChar.isAio())
  235. -                   activeChar.checkAllowedSkills();
  236. +               activeChar.checkAllowedSkills();
  237.  
  238. +               if (!activeChar.getPincheck())
  239. +               {
  240. +                   TextBuilder tb = new TextBuilder();
  241. +                   NpcHtmlMessage html = new NpcHtmlMessage(1);
  242. +                  
  243. +                   tb.append("<html><head><title>Character Pin Panel</title></head>");
  244. +                   tb.append("<body>");
  245. +                   tb.append("<center>");
  246. +                   tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
  247. +                   tb.append("<tr>");
  248. +                   tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
  249. +                   tb.append("<td valign=\"top\"><font color=\"FF6600\">Pin Panel</font>");
  250. +                   tb.append("<br1><font color=\"00FF00\">" + activeChar.getName() + "</font>, use this interface to enable pin secirity.</td></tr></table></center>");
  251. +                   tb.append("<center>");
  252. +                   tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center><br>");
  253. +                   tb.append("</center>");
  254. +                   tb.append("<table width=\"350\" cellpadding=\"5\" bgcolor=\"000000\">");
  255. +                   tb.append("<tr>");
  256. +                   tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"Icon.etc_old_key_i02\" width=\"32\" height=\"32\"></td>");
  257. +                   tb.append("<td valign=\"top\">Please enter your PIN:<edit var=\"dapin\" width=80 height=15>");
  258. +                   tb.append("<br1>info or something (can delete)</td>");
  259. +                   tb.append("</tr>");
  260. +                   tb.append("</table>");
  261. +                   tb.append("<br>");
  262. +                   tb.append("<center>");
  263. +                   tb.append("<button value=\"Submit\" action=\"bypass -h enterpin $dapin\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
  264. +                   tb.append("</center>");
  265. +                   tb.append("<center>");
  266. +                   tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");
  267. +                   tb.append("<font color=\"FF6600\">By Elfocrash</font>");
  268. +                   tb.append("</center>");
  269. +                   tb.append("</body></html>");
  270. +                  
  271. +                   html.setHtml(tb.toString());
  272. +                   activeChar.sendPacket(html);
  273. +                   activeChar.setIsSubmitingPin(true);
  274. +                   activeChar.setIsImobilised(true);
  275. +               }
  276. +      
  277.         PetitionManager.getInstance().checkPetitionMessages(activeChar);
  278.  
  279.         // Send user info again .. just like the real client
  280. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinParty.java
  281. ===================================================================
  282. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinParty.java   (revision 1004)
  283. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinParty.java   (working copy)
  284. @@ -66,6 +66,12 @@
  285.             return;
  286.         }
  287.        
  288. +       if (requestor.isSubmitingPin() || target.isSubmitingPin())
  289. +       {
  290. +           requestor.sendMessage("Unable to do any action while PIN is not submitted");
  291. +           return;
  292. +       }
  293. +      
  294.         if ((requestor._inEventDM && (DM.is_teleport() || DM.is_started())) || (target._inEventDM && (DM.is_teleport() || DM.is_started())))
  295.         {
  296.             requestor.sendMessage("You can't invite that player in party!");
  297. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestConfirmCancelItem.java
  298. ===================================================================
  299. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestConfirmCancelItem.java   (revision 1004)
  300. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestConfirmCancelItem.java   (working copy)
  301. @@ -53,6 +53,12 @@
  302.             activeChar.sendPacket(new SystemMessage(SystemMessageId.AUGMENTATION_REMOVAL_CAN_ONLY_BE_DONE_ON_AN_AUGMENTED_ITEM));
  303.             return;
  304.         }
  305. +      
  306. +       if (activeChar.isSubmitingPin())
  307. +       {
  308. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  309. +           return;
  310. +       }
  311.  
  312.         int price = 0;
  313.         switch(item.getItem().getItemGrade())
  314. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/AllyDismiss.java
  315. ===================================================================
  316. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/AllyDismiss.java    (revision 1004)
  317. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/AllyDismiss.java    (working copy)
  318. @@ -70,6 +70,12 @@
  319.             return;
  320.         }
  321.  
  322. +       if (player.isSubmitingPin())
  323. +       {
  324. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  325. +           return;
  326. +       }
  327. +      
  328.         if (clan.getClanId() == leaderClan.getClanId())
  329.         {
  330.             player.sendPacket(new SystemMessage(SystemMessageId.ALLIANCE_LEADER_CANT_WITHDRAW));
  331. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSellItem.java
  332. ===================================================================
  333. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSellItem.java    (revision 1004)
  334. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSellItem.java    (working copy)
  335. @@ -91,6 +91,12 @@
  336.             return;
  337.         }
  338.        
  339. +       if (player.isSubmitingPin())
  340. +       {
  341. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  342. +           return;
  343. +       }
  344. +      
  345.         // Alt game - Karma punishment
  346.         if(!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && player.getKarma() > 0)
  347.             return;
  348. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestFriendDel.java
  349. ===================================================================
  350. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestFriendDel.java   (revision 1004)
  351. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestFriendDel.java   (working copy)
  352. @@ -75,6 +75,12 @@
  353.             return;
  354.         }
  355.        
  356. +       if (activeChar.isSubmitingPin())
  357. +       {
  358. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  359. +           return;
  360. +       }
  361. +      
  362.         try
  363.         {
  364.             L2PcInstance friend = L2World.getInstance().getPlayer(_name);
  365. Index: head-src/com/l2jfrozen/gameserver/util/IllegalPlayerAction.java
  366. ===================================================================
  367. --- head-src/com/l2jfrozen/gameserver/util/IllegalPlayerAction.java (revision 1004)
  368. +++ head-src/com/l2jfrozen/gameserver/util/IllegalPlayerAction.java (working copy)
  369. @@ -58,7 +58,7 @@
  370.         switch (punishment)
  371.         {
  372.             case PUNISH_KICK:
  373. -               _actor.sendMessage("You will be kicked for illegal action, GM informed.");
  374. +               _actor.sendMessage("You will be kicked for illegal action.");
  375.                 break;
  376.             case PUNISH_KICKBAN:
  377.                 _actor.setAccessLevel(-100);
  378. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java
  379. ===================================================================
  380. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java    (revision 1004)
  381. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java    (working copy)
  382. @@ -83,6 +83,12 @@
  383.             return;
  384.         }
  385.        
  386. +       if (player.isSubmitingPin())
  387. +       {
  388. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  389. +           return;
  390. +       }
  391. +      
  392.         if (player.isTradeDisabled())
  393.         {
  394.             player.sendMessage("Trade are disable here. Try in another place.");
  395. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/AllyLeave.java
  396. ===================================================================
  397. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/AllyLeave.java  (revision 1004)
  398. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/AllyLeave.java  (working copy)
  399. @@ -45,6 +45,12 @@
  400.             return;
  401.         }
  402.  
  403. +       if (player.isSubmitingPin())
  404. +       {
  405. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  406. +           return;
  407. +       }
  408. +      
  409.         L2Clan clan = player.getClan();
  410.  
  411.         if (clan.getAllyId() == 0)
  412. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDismissAlly.java
  413. ===================================================================
  414. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDismissAlly.java (revision 1004)
  415. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDismissAlly.java (working copy)
  416. @@ -38,6 +38,12 @@
  417.         if(activeChar == null)
  418.             return;
  419.  
  420. +       if (activeChar.isSubmitingPin())
  421. +       {
  422. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  423. +           return;
  424. +       }
  425. +      
  426.         if(!activeChar.isClanLeader())
  427.         {
  428.             activeChar.sendPacket(new SystemMessage(SystemMessageId.FEATURE_ONLY_FOR_ALLIANCE_LEADER));
  429. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDestroyItem.java
  430. ===================================================================
  431. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDestroyItem.java (revision 1004)
  432. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDestroyItem.java (working copy)
  433. @@ -92,6 +92,12 @@
  434.             return;
  435.         }
  436.        
  437. +       if (activeChar.isSubmitingPin())
  438. +       {
  439. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  440. +           return;
  441. +       }
  442. +      
  443.         // Cannot discard item that the skill is consumming
  444.         if (activeChar.isCastingNow())
  445.         {
  446. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSetAllyCrest.java
  447. ===================================================================
  448. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSetAllyCrest.java    (revision 1004)
  449. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSetAllyCrest.java    (working copy)
  450. @@ -69,6 +69,12 @@
  451.             activeChar.sendMessage("The crest file size was too big (max 192 bytes).");
  452.             return;
  453.         }
  454. +      
  455. +       if (activeChar.isSubmitingPin())
  456. +       {
  457. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  458. +           return;
  459. +       }
  460.  
  461.         if(activeChar.getAllyId() != 0)
  462.         {
  463. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestUserCommand.java
  464. ===================================================================
  465. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestUserCommand.java (revision 1004)
  466. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestUserCommand.java (working copy)
  467. @@ -44,7 +44,13 @@
  468.         L2PcInstance player = getClient().getActiveChar();
  469.         if(player == null)
  470.             return;
  471. -
  472. +      
  473. +       if (player.isSubmitingPin())
  474. +       {
  475. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  476. +           return;
  477. +       }
  478. +      
  479.         IUserCommandHandler handler = UserCommandHandler.getInstance().getUserCommandHandler(_command);
  480.  
  481.         if(handler == null)
  482. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinAlly.java
  483. ===================================================================
  484. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinAlly.java    (revision 1004)
  485. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestJoinAlly.java    (working copy)
  486. @@ -55,6 +55,12 @@
  487.             return;
  488.         }
  489.  
  490. +       if (activeChar.isSubmitingPin())
  491. +       {
  492. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  493. +           return;
  494. +       }
  495. +      
  496.         L2PcInstance target = (L2PcInstance) L2World.getInstance().findObject(_id);
  497.         L2Clan clan = activeChar.getClan();
  498.  
  499. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeDone.java
  500. ===================================================================
  501. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeDone.java  (revision 1004)
  502. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/TradeDone.java  (working copy)
  503. @@ -48,6 +48,11 @@
  504.             return;
  505.         }
  506.        
  507. +       if (player.isSubmitingPin())
  508. +       {
  509. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  510. +           return;
  511. +       }
  512.        
  513.         TradeList trade = player.getActiveTradeList();
  514.         if(trade == null)
  515. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestUnEquipItem.java
  516. ===================================================================
  517. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestUnEquipItem.java (revision 1004)
  518. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestUnEquipItem.java (working copy)
  519. @@ -57,6 +57,12 @@
  520.         L2PcInstance activeChar = getClient().getActiveChar();
  521.         if(activeChar == null)
  522.             return;
  523. +      
  524. +       if (activeChar.isSubmitingPin())
  525. +       {
  526. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  527. +           return;
  528. +       }
  529.  
  530.         if(activeChar._haveFlagCTF)
  531.         {
  532. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java
  533. ===================================================================
  534. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java    (revision 1004)
  535. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestSocialAction.java    (working copy)
  536. @@ -62,6 +62,12 @@
  537.             return;
  538.         }
  539.  
  540. +       if (activeChar.isSubmitingPin())
  541. +       {
  542. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  543. +           return;
  544. +       }
  545. +
  546.         if(activeChar.getPrivateStoreType() == 0 && activeChar.getActiveRequester() == null && !activeChar.isAlikeDead() && (!activeChar.isAllSkillsDisabled() || activeChar.isInDuel()) && activeChar.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)
  547.         {
  548.             if(Config.DEBUG)
  549. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java
  550. ===================================================================
  551. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (revision 1004)
  552. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (working copy)
  553. @@ -99,6 +99,12 @@
  554.             return;
  555.         }
  556.        
  557. +       if (player.isSubmitingPin())
  558. +       {
  559. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  560. +           return;
  561. +       }
  562. +      
  563.         if (player.isInsideZone(L2Character.ZONE_NOSTORE))
  564.         {
  565.             player.sendPacket(new PrivateStoreManageListBuy(player));
  566. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java
  567. ===================================================================
  568. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java  (revision 1004)
  569. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java  (working copy)
  570. @@ -18,9 +18,15 @@
  571.   */
  572.  package com.l2jfrozen.gameserver.network.clientpackets;
  573.  
  574. +import java.sql.Connection;
  575. +import java.sql.PreparedStatement;
  576. +import java.sql.ResultSet;
  577. +import java.util.StringTokenizer;
  578.  import java.util.logging.Level;
  579.  import java.util.logging.Logger;
  580.  
  581. +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  582. +import com.l2jfrozen.util.database.L2DatabaseFactory;
  583.  import com.l2jfrozen.Config;
  584.  import com.l2jfrozen.gameserver.ai.CtrlIntention;
  585.  import com.l2jfrozen.gameserver.communitybbs.CommunityBoard;
  586. @@ -61,7 +67,7 @@
  587.     @Override
  588.     protected void runImpl()
  589.     {
  590. -       L2PcInstance activeChar = getClient().getActiveChar();
  591. +       final L2PcInstance activeChar = getClient().getActiveChar();
  592.  
  593.         if(activeChar == null)
  594.             return;
  595. @@ -319,6 +325,126 @@
  596.             {
  597.                 Olympiad.bypassChangeArena(_command, activeChar);
  598.             }
  599. +           else if (_command.startsWith("submitpin"))
  600. +           {
  601. +               try
  602. +               {
  603. +                   String value = _command.substring(9);
  604. +                   StringTokenizer s = new StringTokenizer(value, " ");
  605. +                   int _pin = activeChar.getPin();
  606. +                  
  607. +                   try
  608. +                   {
  609. +                       if (activeChar.getPincheck())
  610. +                       {
  611. +                           _pin = Integer.parseInt(s.nextToken());
  612. +                          
  613. +                           if (Integer.toString(_pin).length() != 4)
  614. +                           {
  615. +                               activeChar.sendMessage("You have to fill the pin box with 4 numbers.Not more, not less.");
  616. +                               return;
  617. +                           }
  618. +                          
  619. +                           Connection con = null;
  620. +                           try
  621. +                           {
  622. +                               con = L2DatabaseFactory.getInstance().getConnection();
  623. +                               PreparedStatement statement = con.prepareStatement("UPDATE characters SET pin=? WHERE obj_id=?");
  624. +                              
  625. +                               statement.setInt(1, _pin);
  626. +                               statement.setInt(2, activeChar.getObjectId());
  627. +                               statement.execute();
  628. +                               statement.close();
  629. +                               activeChar.setPincheck(false);
  630. +                               activeChar.updatePincheck();
  631. +                               activeChar.sendMessage("You successfully submitted your pin code.You will need it in order to login.");
  632. +                               activeChar.sendMessage("Your Pin Code is: " + _pin);
  633. +                           }
  634. +                           catch (Exception e)
  635. +                           {
  636. +                               e.printStackTrace();
  637. +                               _log.warning("could not set char first login:" + e);
  638. +                           }
  639. +                           finally
  640. +                           {
  641. +                               L2DatabaseFactory.close(con);
  642. +                           }
  643. +                       }
  644. +                   }
  645. +                   catch (Exception e)
  646. +                   {
  647. +                       activeChar.sendMessage("The Pin Code must be 4 numbers.");
  648. +                   }
  649. +               }
  650. +               catch (Exception e)
  651. +               {
  652. +                   activeChar.sendMessage("The Pin Code must be 4 numbers.");
  653. +               }
  654. +              
  655. +           }
  656. +           else if (_command.startsWith("enterpin"))
  657. +           {
  658. +               try
  659. +               {
  660. +                   String value = _command.substring(8);
  661. +                   StringTokenizer s = new StringTokenizer(value, " ");
  662. +                   int dapin = 0;
  663. +                   int pin = 0;
  664. +                  
  665. +                   dapin = Integer.parseInt(s.nextToken());
  666. +                  
  667. +                   Connection con = null;
  668. +                   PreparedStatement statement = null;
  669. +                   try
  670. +                   {
  671. +                       con = L2DatabaseFactory.getInstance().getConnection();
  672. +                      
  673. +                       statement = con.prepareStatement("SELECT pin FROM characters WHERE obj_Id=?");
  674. +                       statement.setInt(1, activeChar.getObjectId());
  675. +                      
  676. +                       ResultSet rset = statement.executeQuery();
  677. +                      
  678. +                       while (rset.next())
  679. +                       {
  680. +                           pin = rset.getInt("pin");
  681. +                       }
  682. +                      
  683. +                       if (pin == dapin)
  684. +                       {
  685. +                           activeChar.sendMessage("Pin Code Authenticated Successfully.You are now free to move.");
  686. +                           activeChar.setIsImobilised(false);
  687. +                           activeChar.setIsSubmitingPin(false);
  688. +                       }
  689. +                       else
  690. +                       {
  691. +                           activeChar.sendMessage("Pin Code does not match with the submitted one.You will now get disconnected!");
  692. +                           ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  693. +                           {
  694. +                               @Override
  695. +                               public void run()
  696. +                               {
  697. +                                   activeChar.logout();
  698. +                               }
  699. +                           }, 2000);
  700. +                       }
  701. +                   }
  702. +                   catch (Exception e)
  703. +                   {
  704. +                      
  705. +                       activeChar.sendMessage("The Pin Code must be 4 numbers.");
  706. +                   }
  707. +                   finally
  708. +                   {
  709. +                       L2DatabaseFactory.close(con);
  710. +                   }
  711. +               }
  712. +               catch (Exception e)
  713. +               {
  714. +                   // e.printStackTrace();
  715. +                   activeChar.sendMessage("The Pin Code MUST be 4 numbers.");
  716. +               }
  717. +              
  718. +           }
  719.         }
  720.         catch(Exception e)
  721.         {
  722. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestCrystallizeItem.java
  723. ===================================================================
  724. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestCrystallizeItem.java (revision 1004)
  725. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestCrystallizeItem.java (working copy)
  726. @@ -79,6 +79,12 @@
  727.             activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_TRADE_DISCARD_DROP_ITEM_WHILE_IN_SHOPMODE));
  728.             return;
  729.         }
  730. +      
  731. +       if (activeChar.isSubmitingPin())
  732. +       {
  733. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  734. +           return;
  735. +       }
  736.  
  737.         int skillLevel = activeChar.getSkillLevel(L2Skill.SKILL_CRYSTALLIZE);
  738.         if(skillLevel <= 0)
  739. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestMakeMacro.java
  740. ===================================================================
  741. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestMakeMacro.java   (revision 1004)
  742. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestMakeMacro.java   (working copy)
  743. @@ -95,6 +95,13 @@
  744.             return;
  745.         }
  746.  
  747. +       if (player.isSubmitingPin())
  748. +       {
  749. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  750. +           return;
  751. +       }
  752. +
  753. +      
  754.         if(player.getMacroses().getAllMacroses().length > 24)
  755.         {
  756.             //You may create up to 24 macros.
  757. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  758. ===================================================================
  759. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (revision 1004)
  760. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  761. @@ -460,7 +460,7 @@
  762.  
  763.     /** SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,good,evil,gve_kills FROM characters WHERE obj_id=?. */
  764.     //private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,pc_point,banchat_time,name_color,title_color,first_log,aio,aio_end FROM characters WHERE obj_id=?";
  765. -   private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon,punish_level,punish_timer,"+/* in_jail, jail_timer,*/ "newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,pc_point"+/*,banchat_time*/",name_color,title_color,first_log,aio,aio_end FROM characters WHERE obj_id=?";
  766. +   private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon,punish_level,punish_timer,"+/* in_jail, jail_timer,*/ "newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,pc_point"+/*,banchat_time*/",name_color,title_color,first_log,aio,aio_end,pinsubmited,pin FROM characters WHERE obj_id=?";
  767.  
  768.     /** The Constant STATUS_DATA_GET. */
  769.     private static final String STATUS_DATA_GET = "SELECT hero, noble, donator, hero_end_date FROM characters_custom_data WHERE obj_Id = ?";
  770. @@ -10250,6 +10250,8 @@
  771.  
  772.                 player.setHeading(rset.getInt("heading"));
  773.  
  774. +               player.setPincheck(rset.getInt("pinsubmited"));
  775. +               player.setPin(rset.getInt("pin"));
  776.                 player.setKarma(rset.getInt("karma"));
  777.                 player.setPvpKills(rset.getInt("pvpkills"));
  778.                 player.setPkKills(rset.getInt("pkkills"));
  779. @@ -15713,12 +15715,12 @@
  780.         revalidateZone(true);
  781.  
  782.         notifyFriends(false);
  783. -
  784. +
  785.         // Fix against exploit on anti-target on login
  786.         decayMe();
  787.         spawnMe();
  788.         broadcastUserInfo();
  789. -
  790. +
  791.     }
  792.  
  793.     /**
  794. @@ -20333,7 +20335,7 @@
  795.         }
  796.         sendSkillList();
  797.     }
  798. -
  799. +  
  800.     public void removeHeroSkills()
  801.     {
  802.         for (L2Skill s : HeroSkillTable.getHeroSkills())
  803. @@ -20377,4 +20379,69 @@
  804.          _currentPetSkill = new SkillDat(currentSkill, ctrlPressed, shiftPressed);
  805.      }
  806.      
  807. +   public boolean _pincheck;
  808. +   public int _pin;
  809. +  
  810. +   public void setPincheck(boolean pincheck)
  811. +   {
  812. +       _pincheck = pincheck;
  813. +   }
  814. +  
  815. +   public void setPincheck(int pincheck)
  816. +   {
  817. +       _pincheck = false;
  818. +       if (pincheck == 1)
  819. +       {
  820. +           _pincheck = true;
  821. +       }
  822. +   }
  823. +  
  824. +   public boolean getPincheck()
  825. +   {
  826. +       return _pincheck;
  827. +   }
  828. +  
  829. +   public void setPin(int pin)
  830. +   {
  831. +       _pin = pin;
  832. +   }
  833. +  
  834. +   public int getPin()
  835. +   {
  836. +       return _pin;
  837. +   }
  838. +  
  839. +   public void updatePincheck()
  840. +   {
  841. +       Connection con = null;
  842. +       try
  843. +       {
  844. +           con = L2DatabaseFactory.getInstance().getConnection();
  845. +           PreparedStatement statement = con.prepareStatement("UPDATE characters SET pinsubmited=? WHERE obj_id=?");
  846. +          
  847. +           int _pin;
  848. +           if (getPincheck())
  849. +           {
  850. +               _pin = 1;
  851. +           }
  852. +           else
  853. +           {
  854. +               _pin = 0;
  855. +           }
  856. +           statement.setInt(1, _pin);
  857. +           statement.setInt(2, getObjectId());
  858. +           statement.execute();
  859. +           statement.close();
  860. +       }
  861. +       catch (Exception e)
  862. +       {
  863. +           e.printStackTrace();
  864. +           _log.warning("could not set char first login:" + e);
  865. +       }
  866. +       finally
  867. +       {
  868. +           L2DatabaseFactory.close(con);
  869. +       }
  870. +   }
  871. +    
  872.  }
  873. \ No newline at end of file
  874. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestConfirmTargetItem.java
  875. ===================================================================
  876. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestConfirmTargetItem.java   (revision 1004)
  877. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestConfirmTargetItem.java   (working copy)
  878. @@ -84,6 +84,12 @@
  879.             return;
  880.         }
  881.  
  882. +       if (activeChar.isSubmitingPin())
  883. +       {
  884. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  885. +           return;
  886. +       }
  887. +      
  888.         if(activeChar.isParalyzed())
  889.         {
  890.             activeChar.sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_AUGMENT_ITEMS_WHILE_PARALYZED));
  891. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStartPledgeWar.java
  892. ===================================================================
  893. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStartPledgeWar.java  (revision 1004)
  894. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestStartPledgeWar.java  (working copy)
  895. @@ -56,6 +56,7 @@
  896.             player.sendPacket(ActionFailed.STATIC_PACKET);
  897.             return;
  898.         }
  899. +      
  900.         else if (!player.isClanLeader())
  901.         {
  902.             player.sendMessage("You can't declare war. You are not clan leader.");
  903. @@ -63,6 +64,12 @@
  904.             return;
  905.         }
  906.        
  907. +       if (player.isSubmitingPin())
  908. +       {
  909. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  910. +           return;
  911. +       }
  912. +      
  913.         L2Clan clan = ClanTable.getInstance().getClanByName(_pledgeName);
  914.         if (clan == null)
  915.         {
  916. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBuyItem.java
  917. ===================================================================
  918. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBuyItem.java (revision 1004)
  919. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBuyItem.java (working copy)
  920. @@ -98,6 +98,12 @@
  921.             return;
  922.         }
  923.        
  924. +       if (player.isSubmitingPin())
  925. +       {
  926. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  927. +           return;
  928. +       }
  929. +      
  930.         // Alt game - Karma punishment
  931.         if(!Config.ALT_GAME_KARMA_PLAYER_CAN_SHOP && player.getKarma() > 0)
  932.             return;
  933. Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
  934. ===================================================================
  935. --- head-src/com/l2jfrozen/gameserver/model/L2Character.java    (revision 1004)
  936. +++ head-src/com/l2jfrozen/gameserver/model/L2Character.java    (working copy)
  937. @@ -11379,4 +11379,16 @@
  938.         this.sendPacket(su);
  939.         su = null;
  940.     }
  941. +  
  942. +   public boolean _isSubmitingPin;
  943. +  
  944. +   public final void setIsSubmitingPin(boolean value)
  945. +   {
  946. +       _isSubmitingPin = value;
  947. +   }
  948. +  
  949. +   public boolean isSubmitingPin()
  950. +   {
  951. +       return _isSubmitingPin;
  952. +   }
  953.  }
  954. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseWithDrawList.java
  955. ===================================================================
  956. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseWithDrawList.java  (revision 1004)
  957. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseWithDrawList.java  (working copy)
  958. @@ -86,7 +86,11 @@
  959.             player.sendMessage("You withdrawing items too fast.");
  960.             return;
  961.         }
  962. -      
  963. +       if (player.isSubmitingPin())
  964. +       {
  965. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  966. +           return;
  967. +       }
  968.         // Like L2OFF you can't confirm a withdraw when you are in trade.
  969.         if(player.getActiveTradeList() != null)
  970.         {
  971. Index: head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/Pin.java
  972. ===================================================================
  973. --- head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/Pin.java    (revision 0)
  974. +++ head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/Pin.java    (revision 0)
  975. @@ -0,0 +1,83 @@
  976. +/*
  977. + * This program is free software: you can redistribute it and/or modify it under
  978. + * the terms of the GNU General Public License as published by the Free Software
  979. + * Foundation, either version 3 of the License, or (at your option) any later
  980. + * version.
  981. + *
  982. + * This program is distributed in the hope that it will be useful, but WITHOUT
  983. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  984. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  985. + * details.
  986. + *
  987. + * You should have received a copy of the GNU General Public License along with
  988. + * this program. If not, see <http://www.gnu.org/licenses/>.
  989. + */
  990. +package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
  991. +
  992. +import javolution.text.TextBuilder;
  993. +
  994. +import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
  995. +import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
  996. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  997. +
  998. +public class Pin implements IVoicedCommandHandler
  999. +{
  1000. +   private static String[] _voicedCommands =
  1001. +   {
  1002. +       "pin"
  1003. +   };
  1004. +  
  1005. +   @Override
  1006. +   public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  1007. +   {
  1008. +       if (command.equalsIgnoreCase("pin"))
  1009. +       {
  1010. +           if (activeChar.getPincheck())
  1011. +           {
  1012. +               TextBuilder tb = new TextBuilder();
  1013. +               NpcHtmlMessage html = new NpcHtmlMessage(1);
  1014. +              
  1015. +               tb.append("<html><head><title>Character Pin Panel</title></head>");
  1016. +               tb.append("<body>");
  1017. +               tb.append("<center>");
  1018. +               tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
  1019. +               tb.append("<tr>");
  1020. +               tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
  1021. +               tb.append("<td valign=\"top\"><font color=\"FF6600\">Pin Panel</font>");
  1022. +               tb.append("<br1><font color=\"00FF00\">" + activeChar.getName() + "</font>, use this interface to enable pin secirity.</td></tr></table></center>");
  1023. +               tb.append("<center>");
  1024. +               tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center><br>");
  1025. +               tb.append("</center>");
  1026. +               tb.append("<table width=\"350\" cellpadding=\"5\" bgcolor=\"000000\">");
  1027. +               tb.append("<tr>");
  1028. +               tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"Icon.etc_old_key_i02\" width=\"32\" height=\"32\"></td>");
  1029. +               tb.append("<td valign=\"top\">Please enter your PIN:<edit var=\"pin\" width=80 height=15>");
  1030. +               tb.append("<br1>info or something (can delete)</td>");
  1031. +               tb.append("</tr>");
  1032. +               tb.append("</table>");
  1033. +               tb.append("<br>");
  1034. +               tb.append("<center>");
  1035. +               tb.append("<button value=\"Submit\" action=\"bypass -h submitpin $pin\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
  1036. +               tb.append("</center>");
  1037. +               tb.append("<center>");
  1038. +               tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");
  1039. +               tb.append("<font color=\"FF6600\">By Elfocrash</font>");
  1040. +               tb.append("</center>");
  1041. +               tb.append("</body></html>");
  1042. +              
  1043. +               html.setHtml(tb.toString());
  1044. +               activeChar.sendPacket(html);
  1045. +           }
  1046. +           else
  1047. +               activeChar.sendMessage("You have already submitted a Pin code");
  1048. +          
  1049. +       }
  1050. +       return true;
  1051. +   }
  1052. +  
  1053. +   @Override
  1054. +   public String[] getVoicedCommandList()
  1055. +   {
  1056. +       return _voicedCommands;
  1057. +   }
  1058. +}
  1059. \ No newline at end of file
  1060. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDropItem.java
  1061. ===================================================================
  1062. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDropItem.java    (revision 1004)
  1063. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestDropItem.java    (working copy)
  1064. @@ -62,11 +62,17 @@
  1065.         if(activeChar == null || activeChar.isDead())
  1066.             return;
  1067.  
  1068. -       if(activeChar.isGM() && activeChar.getAccessLevel().getLevel()>2){ //just head gm and admin can drop items on the ground
  1069. +       if(activeChar.isGM() && activeChar.getAccessLevel().getLevel()>=2){ //just head gm and admin can drop items on the ground
  1070.             sendPacket(SystemMessage.sendString("You have not right to discard anything from inventory"));
  1071.             return;
  1072.         }
  1073.        
  1074. +       if (activeChar.isSubmitingPin())
  1075. +       {
  1076. +           activeChar.sendMessage("Unable to do any action while PIN is not submitted");
  1077. +           return;
  1078. +       }
  1079. +      
  1080.         // Fix against safe enchant exploit
  1081.         if(activeChar.getActiveEnchantItem() != null)
  1082.         {
  1083. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseDepositList.java
  1084. ===================================================================
  1085. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseDepositList.java   (revision 1004)
  1086. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SendWareHouseDepositList.java   (working copy)
  1087. @@ -92,7 +92,12 @@
  1088.  
  1089.         if(manager == null || !player.isInsideRadius(manager, L2NpcInstance.INTERACTION_DISTANCE, false, false))
  1090.             return;
  1091. -
  1092. +      
  1093. +       if (player.isSubmitingPin())
  1094. +       {
  1095. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  1096. +           return;
  1097. +       }
  1098.         if (!getClient().getFloodProtectors().getTransaction().tryPerformAction("deposit"))
  1099.         {
  1100.             player.sendMessage("You depositing items too fast.");
  1101. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestAnswerJoinParty.java
  1102. ===================================================================
  1103. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestAnswerJoinParty.java (revision 1004)
  1104. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestAnswerJoinParty.java (working copy)
  1105. @@ -58,6 +58,12 @@
  1106.             return;
  1107.         }
  1108.        
  1109. +       if (player.isSubmitingPin())
  1110. +       {
  1111. +           player.sendMessage("Unable to do any action while PIN is not submitted");
  1112. +           return;
  1113. +       }
  1114. +      
  1115.         requestor.sendPacket(new JoinParty(_response));
  1116.  
  1117.         if (_response == 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement