Bubblesdev ver75 PlayersCommand, Rev 206 and higher

Results 1 to 17 of 17
  1. #1
    I LOVE RAGEZONE! HaruTheHero is offline
    MemberRank
    Jan 2010 Join Date
    MYOB!Location
    239Posts

    Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    This works for rev 206 or higher :

    Go to :
    src\client\command\CommandProcessor.java

    PHP Code:
        if (s.charAt(0) == '!' && c.getPlayer().isGM()) {
            
    String[] sp s.split(" ");
            
    sp[0] = sp[0].toLowerCase().substring(1);
            
    c.getPlayer().addCommandToList(s);
            if (
    GMCommand.execute(csp'!'))
                return 
    true;
            else if (
    c.getPlayer().gmLevel() > 3)
                
    AdminCommand.execute(csp'!');
            return 
    true;
        }
        if (
    s.charAt(0) == '@') {
            
    String[] sp s.split(" ");
            
    sp[0] = sp[0].toLowerCase().substring(1);
            
    PlayerCommand.execute(csp'@');
            return 
    true;
        }
        return 
    false;
    }
    }

    Add a file in the same folder and name it PlayerCommand.java

    Add this code in the folder

    PHP Code:
    package client.command;

    import client.ISkill;
    import client.MapleCharacter;
    import client.MapleClient;
    import client.MapleStat;
    import client.SkillFactory;
    import java.io.File;
    import net.channel.ChannelServer;
    import provider.MapleData;
    import provider.MapleDataProviderFactory;
    import scripting.npc.NPCScriptManager;
    import tools.MaplePacketCreator;

    /**
     *
     * @author HaruTheHero
     */
    public class PlayerCommand {
        static 
    void execute(MapleClient cString[] splittedchar heading) {
            
    ChannelServer cserv c.getChannelServer();
            
    MapleCharacter player c.getPlayer();
           if (
    splitted[0].equals("str") || splitted[0].equals("int") || splitted[0].equals("luk") || splitted[0].equals("dex")) {
                
    int amount Integer.parseInt(splitted[1]);
            
    boolean str splitted[0].equals("str");
            
    boolean Int splitted[0].equals("int");
            
    boolean luk splitted[0].equals("luk");
            
    boolean dex splitted[0].equals("dex");
              if(
    amount && amount <= player.getRemainingAp() && amount <= 32763 || amount && amount >= -32763 && Math.abs(amount) + player.getRemainingAp() <= 32767) {
            if (
    str && amount player.getStr() <= 32767 && amount player.getStr() >= 4) {
            
    player.setStr(player.getStr() + amount);
            
    player.updateSingleStat(MapleStat.STRplayer.getStr());
            
    player.setRemainingAp(player.getRemainingAp() - amount);
            
    player.updateSingleStat(MapleStat.AVAILABLEAPplayer.getRemainingAp());
        } else if (
    Int && amount player.getInt() <= 32767 && amount player.getInt() >= 4) {
            
    player.setInt(player.getInt() + amount);
            
    player.updateSingleStat(MapleStat.INTplayer.getInt());
            
    player.setRemainingAp(player.getRemainingAp() - amount);
            
    player.updateSingleStat(MapleStat.AVAILABLEAPplayer.getRemainingAp());
        } else if (
    luk && amount player.getLuk() <= 32767 && amount player.getLuk() >= 4) {
            
    player.setLuk(player.getLuk() + amount);
            
    player.updateSingleStat(MapleStat.LUKplayer.getLuk());
            
    player.setRemainingAp(player.getRemainingAp() - amount);
            
    player.updateSingleStat(MapleStat.AVAILABLEAPplayer.getRemainingAp());
        } else if (
    dex && amount player.getDex() <= 32767 && amount player.getDex() >= 4) {
            
    player.setDex(player.getDex() + amount);
            
    player.updateSingleStat(MapleStat.DEXplayer.getDex());
            
    player.setRemainingAp(player.getRemainingAp() - amount);
            
    player.updateSingleStat(MapleStat.AVAILABLEAPplayer.getRemainingAp());
        } else {
        
    player.dropMessage("Please make sure the stat you are trying to raise is not over ***767 or under 4.");
        }
            } else {
                
    player.dropMessage("Please make sure your AP is not over ***767 and you have enough to distribute.");
            }
        } else if (
    splitted[0].equals("expfix")) {
                    
    player.setExp(0);
                    
    player.updateSingleStat(MapleStat.EXPplayer.getExp());
            
    player.dropMessage("Your exp has been fixed~!");
        } else if (
    splitted[0].equals("dispose")) {
                
    NPCScriptManager.getInstance().dispose(c);
                
    c.getSession().write(MaplePacketCreator.enableActions());
                
    player.message("Done.");

            } else if (
    splitted[0].equals("save")) {
                
    player.saveToDB(true);
                
    player.dropMessage("Save complete, have fun in HaruMS!");

                } else if (
    splitted[0].equals("emo")) {
            
    player.setHp(0);
            
    player.updateSingleStat(MapleStat.HP0);
                  
    player.dropMessage("Congratulations, You Have Just Killed YourSelf");

            } else if (
    splitted[0].equals("commands") || splitted[0].equals("help")) {
                
    player.dropMessage("@fmnpc - Use this to talk to the fmnpc.");
                
    player.dropMessage("@dispose - Use this if you cannot tlk to npc.");
                
    player.dropMessage("@emo  - Stuck In Map? Use This.");
                
    player.dropMessage("@str/@dex/@int/@luk - Helps you to add your stats faster!");
                
    player.dropMessage("@expfix  - Sets your exp to 0.");

            } else{
            
    player.message("Command " heading splitted[0] + " does not exist.");
             }
        }

    At general chat handler : replace with this

    PHP Code:
    package net.channel.handler;

    import client.command.CommandProcessor;
    import tools.MaplePacketCreator;
    import tools.data.input.SeekableLittleEndianAccessor;
    import client.MapleClient;

    public final class 
    GeneralchatHandler extends net.AbstractMaplePacketHandler {
        public final 
    void handlePacket(SeekableLittleEndianAccessor sleaMapleClient c) {
            
    String text slea.readMapleAsciiString();
            if (!
    CommandProcessor.processCommand(ctext)) {
                
    c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), textc.getPlayer().getGMChat(), slea.readByte()));
            }
        }

    To Add Commands Dun Add With '@'.

    credit : HARUTHEHERO...
    Last edited by HaruTheHero; 25-01-10 at 09:04 AM.


  2. #2
    Gamma Xerixe is offline
    MemberRank
    Apr 2008 Join Date
    MalaysiaLocation
    3,605Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Isn't it a little USELESS?

  3. #3
    Infraction Banned Franzi is offline
    MemberRank
    Dec 2009 Join Date
    137Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    let me test this.

  4. #4
    Apprentice Megadeth is offline
    MemberRank
    Oct 2009 Join Date
    The HellLocation
    11Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    tested and working thanks.

  5. #5
    Account Upgraded | Title Enabled! Buya is offline
    MemberRank
    Oct 2008 Join Date
    1,303Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Quote Originally Posted by Xerixe View Post
    Isn't it a little USELESS?
    this.

  6. #6
    Valued Member jjaim is offline
    MemberRank
    Feb 2007 Join Date
    116Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Thanks :D

    I compiled it and everything is ok, but i have 1 problem the player command is not working =o

    Im doing @ and nothing!
    Last edited by jjaim; 25-01-10 at 08:32 PM.

  7. #7
    Account Upgraded | Title Enabled! maplegamer is offline
    MemberRank
    Nov 2009 Join Date
    ThereLocation
    587Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Quote Originally Posted by jjaim View Post
    Thanks :D

    I compiled it and everything is ok, but i have 1 problem the player command is not working =o

    Im doing @ and nothing!
    If you were adding more commands, do not put '@' in the script.

  8. #8
    Valued Member jjaim is offline
    MemberRank
    Feb 2007 Join Date
    116Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    I didnt add nothing!
    I just pasted the code and made it work :]

    Now when i log my char ( not gm char / gm char) Im writing @str / @dex / @dex / @help /@whatever and its do nothing its just write it like i write "hello";
    now you understand?

  9. #9
    Account Upgraded | Title Enabled! redeemer34 is offline
    MemberRank
    Aug 2008 Join Date
    335Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Shouldn't the Command processor be like this?


    Code:
    package client.command;
    
    import client.MapleClient;
    
    public final class CommandProcessor {
    if (s.charAt(0) == '!' && c.getPlayer().isGM()) {
            String[] sp = s.split(" ");
            sp[0] = sp[0].toLowerCase().substring(1);
            c.getPlayer().addCommandToList(s);
            if (GMCommand.execute(c, sp, '!'))
                return true;
            else if (c.getPlayer().gmLevel() > 3)
                AdminCommand.execute(c, sp, '!');
            return true;
        }
        if (s.charAt(0) == '@') {
            String[] sp = s.split(" ");
            sp[0] = sp[0].toLowerCase().substring(1);
            PlayerCommand.execute(c, sp, '@');
            return true;
        }

  10. #10
    Valued Member jjaim is offline
    MemberRank
    Feb 2007 Join Date
    116Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    You are missing return false; at the end.
    some one can answer my question up there?

  11. #11
    I LOVE RAGEZONE! HaruTheHero is offline
    MemberRank
    Jan 2010 Join Date
    MYOB!Location
    239Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Thanks guys, i love your good comments. = )

  12. #12
    Valued Member jjaim is offline
    MemberRank
    Feb 2007 Join Date
    116Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Quote Originally Posted by jjaim View Post
    I didnt add nothing!
    I just pasted the code and made it work :]

    Now when i log my char ( not gm char / gm char) Im writing @str / @dex / @dex / @help /@whatever and its do nothing its just write it like i write "hello";
    now you understand?
    Can i get help?

  13. #13
    I LOVE RAGEZONE! HaruTheHero is offline
    MemberRank
    Jan 2010 Join Date
    MYOB!Location
    239Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Quote Originally Posted by jjaim View Post
    Can i get help?
    i can help u but i don't understand this part "i log my char ( not gm char / gm char) Im writing @str / @dex / @dex / @help /@whatever" of you saying.

  14. #14
    Valued Member maddoc9999 is offline
    MemberRank
    Nov 2006 Join Date
    104Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    i am lost

  15. #15
    I LOVE RAGEZONE! HaruTheHero is offline
    MemberRank
    Jan 2010 Join Date
    MYOB!Location
    239Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Quote Originally Posted by maddoc9999 View Post
    i am lost
    i can't do anything if you're lost

  16. #16
    Eternal Slumber Meteorite is offline
    MemberRank
    Jun 2008 Join Date
    875Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    Fail.

  17. #17
    Valued Member jjaim is offline
    MemberRank
    Feb 2007 Join Date
    116Posts

    Re: Bubblesdev ver75 PlayersCommand, Rev 206 and higher

    ill explain you.

    I edited the code fine!

    now when i log into my char.

    Im writing @str or @dex or @(any command) and its do nothing. its just write it like im writing hello do you understand?
    Last edited by jjaim; 28-01-10 at 02:35 PM.



Advertisement