Ignore:
Timestamp:
Jan 16, 2012 7:56:19 AM (4 months ago)
Author:
MELERIX
Message:

STABLE: Sync with BETA [8629]

Location:
trunk/L2J_DataPack
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/L2J_DataPack

  • trunk/L2J_DataPack/dist/game/data/scripts/handlers/admincommandhandlers/AdminExpSp.java

    r7720 r8630  
    2424import com.l2jserver.gameserver.network.SystemMessageId; 
    2525import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; 
    26 import com.l2jserver.gameserver.network.serverpackets.SystemMessage; 
    27  
    2826 
    2927/** 
     
    4543        }; 
    4644         
     45        @Override 
    4746        public boolean useAdminCommand(String command, L2PcInstance activeChar) 
    4847        { 
     
    7776        } 
    7877         
     78        @Override 
    7979        public String[] getAdminCommandList() 
    8080        { 
     
    9090                else 
    9191                { 
    92                         activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INCORRECT_TARGET)); 
     92                        activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET); 
    9393                        return; 
    9494                } 
     
    113113                else 
    114114                { 
    115                         activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INCORRECT_TARGET)); 
     115                        activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET); 
    116116                        return false; 
    117117                } 
     
    121121                        return false; 
    122122                } 
    123                 else 
     123                 
     124                String exp = st.nextToken(); 
     125                String sp = st.nextToken(); 
     126                long expval = 0; 
     127                int spval = 0; 
     128                try 
    124129                { 
    125                         String exp = st.nextToken(); 
    126                         String sp = st.nextToken(); 
    127                         long expval = 0; 
    128                         int spval = 0; 
    129                         try 
    130                         { 
    131                                 expval = Long.parseLong(exp); 
    132                                 spval = Integer.parseInt(sp); 
    133                         } 
    134                         catch (Exception e) 
    135                         { 
    136                                 return false; 
    137                         } 
    138                         if (expval != 0 || spval != 0) 
    139                         { 
    140                                 //Common character information 
    141                                 player.sendMessage("Admin is adding you " + expval + " xp and " + spval + " sp."); 
    142                                 player.addExpAndSp(expval, spval); 
    143                                 //Admin information 
    144                                 activeChar.sendMessage("Added " + expval + " xp and " + spval + " sp to " + player.getName() + "."); 
    145                                 if (Config.DEBUG) 
    146                                         _log.fine("GM: " + activeChar.getName() + "(" + activeChar.getObjectId() + ") added " + expval + " xp and " + spval + " sp to " + player.getObjectId() + "."); 
    147                         } 
     130                        expval = Long.parseLong(exp); 
     131                        spval = Integer.parseInt(sp); 
     132                } 
     133                catch (Exception e) 
     134                { 
     135                        return false; 
     136                } 
     137                if (expval != 0 || spval != 0) 
     138                { 
     139                        //Common character information 
     140                        player.sendMessage("Admin is adding you " + expval + " xp and " + spval + " sp."); 
     141                        player.addExpAndSp(expval, spval); 
     142                        //Admin information 
     143                        activeChar.sendMessage("Added " + expval + " xp and " + spval + " sp to " + player.getName() + "."); 
     144                        if (Config.DEBUG) 
     145                                _log.fine("GM: " + activeChar.getName() + "(" + activeChar.getObjectId() + ") added " + expval + " xp and " + spval + " sp to " + player.getObjectId() + "."); 
    148146                } 
    149147                return true; 
     
    160158                else 
    161159                { 
    162                         activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INCORRECT_TARGET)); 
     160                        activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET); 
    163161                        return false; 
    164162                } 
    165163                StringTokenizer st = new StringTokenizer(ExpSp); 
    166164                if (st.countTokens() != 2) 
     165                { 
    167166                        return false; 
    168                 else 
     167                } 
     168                 
     169                String exp = st.nextToken(); 
     170                String sp = st.nextToken(); 
     171                long expval = 0; 
     172                int spval = 0; 
     173                try 
    169174                { 
    170                         String exp = st.nextToken(); 
    171                         String sp = st.nextToken(); 
    172                         long expval = 0; 
    173                         int spval = 0; 
    174                         try 
    175                         { 
    176                                 expval = Long.parseLong(exp); 
    177                                 spval = Integer.parseInt(sp); 
    178                         } 
    179                         catch (Exception e) 
    180                         { 
    181                                 return false; 
    182                         } 
    183                         if (expval != 0 || spval != 0) 
    184                         { 
    185                                 //Common character information 
    186                                 player.sendMessage("Admin is removing you " + expval + " xp and " + spval + " sp."); 
    187                                 player.removeExpAndSp(expval, spval); 
    188                                 //Admin information 
    189                                 activeChar.sendMessage("Removed " + expval + " xp and " + spval + " sp from " + player.getName() + "."); 
    190                                 if (Config.DEBUG) 
    191                                         _log.fine("GM: " + activeChar.getName() + "(" + activeChar.getObjectId() + ") removed " + expval + " xp and " + spval + " sp from " + player.getObjectId() + "."); 
    192                         } 
     175                        expval = Long.parseLong(exp); 
     176                        spval = Integer.parseInt(sp); 
     177                } 
     178                catch (Exception e) 
     179                { 
     180                        return false; 
     181                } 
     182                if (expval != 0 || spval != 0) 
     183                { 
     184                        //Common character information 
     185                        player.sendMessage("Admin is removing you " + expval + " xp and " + spval + " sp."); 
     186                        player.removeExpAndSp(expval, spval); 
     187                        //Admin information 
     188                        activeChar.sendMessage("Removed " + expval + " xp and " + spval + " sp from " + player.getName() + "."); 
     189                        if (Config.DEBUG) 
     190                                _log.fine("GM: " + activeChar.getName() + "(" + activeChar.getObjectId() + ") removed " + expval + " xp and " + spval + " sp from " + player.getObjectId() + "."); 
    193191                } 
    194192                return true; 
Note: See TracChangeset for help on using the changeset viewer.