קהילות פורומים, הורדות, יעוץ ותמיכה


אשכולות דומים

  1. תגובות: 8
    הודעה אחרונה: 08-11-2005, 23:43
  2. (קונה)תטלאי עם כל השחקנים והזירות לwwe raw ב50 נקודות
    על ידי ReDevil בפורום עשינו עסק - ארכיון
    תגובות: 4
    הודעה אחרונה: 01-11-2005, 00:21
  3. 10 השחקנים הטובים ביותר בישראל
    על ידי MaRoKaY בפורום Counter Strike
    תגובות: 18
    הודעה אחרונה: 26-09-2005, 17:46
  4. רונאלדיניו שחקן השנה של השחקנים.
    על ידי Gigi Buffon בפורום כדורגל
    תגובות: 17
    הודעה אחרונה: 21-09-2005, 23:04
+ תגובה לנושא
מציג תוצאות 1 עד 14 מתוך 14

בפקודות של השחקנים!

  1. #1
    משתמש מתחיל
    שם פרטי
    \
    תאריך הצטרפות
    01/2010
    הודעות
    16
    לייקים
    0
    נקודות
    0
    מין: זכר

    ברירת מחדל בפקודות של השחקנים!

    כשאני משנה פקודות בקובץ של PLAYERCOMMANDS.JAVA

    אז אני שומר והכל ואז כשאני נכנס לשרת מריץ זה מראה לי את אותם

    הפקודות כאילו שלא שיניתי בכלל

    אם מישהוא יוכל לשנות לי טוב אז אני מאוד יודה לו

    הינה זה הפקודות שצריך לשנות :

    קוד:
    את ZOMBIE לshanks
    קוד:
     
    package net.sf.odinms.client.messages.commands;
    import java.rmi.RemoteException;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.HashMap;
    import net.sf.odinms.client.ExpTable;
    import net.sf.odinms.client.MapleCharacter;
    import net.sf.odinms.client.MapleClient;
    import net.sf.odinms.client.MapleJob;
    import net.sf.odinms.net.world.remote.WorldChannelInterface;
    import net.sf.odinms.client.MapleStat;
    import net.sf.odinms.client.messages.Command;
    import net.sf.odinms.client.messages.CommandDefinition;
    import net.sf.odinms.client.messages.MessageCallback;
    import net.sf.odinms.net.channel.ChannelServer;
    import net.sf.odinms.database.DatabaseConnection;
    import net.sf.odinms.scripting.npc.NPCScriptManager;
    import net.sf.odinms.server.MapleInventoryManipulator;
    import net.sf.odinms.server.maps.SavedLocationType;
    import net.sf.odinms.tools.MaplePacketCreator;
    import net.sf.odinms.tools.StringUtil;
    public class PlayerCommands implements Command {
        private ResultSet ranking(boolean gm) {
            try {
                Connection con = DatabaseConnection.getConnection();
                PreparedStatement ps;
                if (!gm) {
                    ps = con.prepareStatement("SELECT reborns, level, name, job FROM characters WHERE gm < 3 ORDER BY reborns desc LIMIT 10");
                } else {
                    ps = con.prepareStatement("SELECT name, gm FROM characters WHERE gm >= 3");
                }
                return ps.executeQuery();
            } catch (SQLException ex) {
                return null;
            }
        }
        @Override
        public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception {
            splitted[0] = splitted[0].toLowerCase();
            MapleCharacter player = c.getPlayer();
            if (player.getMapId() != 980000404) {
                if (splitted[0].equals("@str") || splitted[0].equals("@dex") || splitted[0].equals("@int") || splitted[0].equals("@luk") || splitted[0].equals("@hp") || splitted[0].equals("@mp")) {
                    int amount = Integer.parseInt(splitted[1]);
                if (amount > 0 && amount <= player.getRemainingAp() && amount < 31997) {
                    if (splitted[0].equals("@str") && amount + player.getStr() < 32001) {
                        player.setStr(player.getStr() + amount);
                        player.updateSingleStat(MapleStat.STR, player.getStr());
                    } else if (splitted[0].equals("@int") && amount + player.getInt() < 32001) {
                        player.setInt(player.getInt() + amount);
                        player.updateSingleStat(MapleStat.INT, player.getInt());
                    } else if (splitted[0].equals("@luk") && amount + player.getLuk() < 32001) {
                        player.setLuk(player.getLuk() + amount);
                        player.updateSingleStat(MapleStat.LUK, player.getLuk());
                    } else if (splitted[0].equals("@dex") && amount + player.getDex() < 32001) {
                        player.setDex(player.getDex() + amount);
                        player.updateSingleStat(MapleStat.DEX, player.getDex());
                    } else {
                        mc.dropMessage("Make sure the stat you are trying to raise will not be over 32000.");
                    }
                    player.setRemainingAp(player.getRemainingAp() - amount);
                    player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
                } else {
                    mc.dropMessage("Please make sure your AP is not over 32000 and you have enough to distribute.");
                }
                } else if (splitted[0].equalsIgnoreCase("@checkstats")) {
                    mc.dropMessage("Your stats are:");
                    mc.dropMessage("Str: " + player.getStr());
                    mc.dropMessage("Dex: " + player.getDex());
                    mc.dropMessage("Int: " + player.getInt());
                    mc.dropMessage("Luk: " + player.getLuk());
                    mc.dropMessage("Available AP: " + player.getRemainingAp());
                    mc.dropMessage("Rebirths: " + player.getReborns());
                } else if (splitted[0].equalsIgnoreCase("@commands") || splitted[0].equalsIgnoreCase("@help")) {
                    mc.dropMessage("============================================================");
                    mc.dropMessage("        " + c.getChannelServer().getServerName() + " Commands");
                    mc.dropMessage("============================================================");
                    mc.dropMessage("@str/@dex/@int/@luk <number> ~ with these commands you will never have to add AP the slow way.");
                    mc.dropMessage("@buynx <number> ~ NX currency is currently 1000 mesos for 1 nx point.");
                    mc.dropMessage("@save ~ Basically saves.");
                    mc.dropMessage("@rank ~ shows top 10 people.");
                    mc.dropMessage("@dispose ~ Turn off seeing smegas / Turn on.");
                    mc.dropMessage("@togglesmega ~ Turn off seeing smegas / Turn on.");
                    mc.dropMessage("@decieve ~ Sets your fame to -1337");
                    mc.dropMessage("@expfix ~ Got negative EXP ? Type this");
                    mc.dropMessage("@gm <message> ~ Call a gm for help (: ?");
                    mc.dropMessage("@checkstat ~ Allows you to check what your stats are. Including rebirths");
                    mc.dropMessage("@go ~ Try it out, type @go");
                    mc.dropMessage("@revive ~ Revives anyone on the channel besides yourself.");
                    mc.dropMessage("@cody ~ Job Advancer.");
                    mc.dropMessage("@nana ~ Stats reseter.");
                    mc.dropMessage("@nimakin ~ Stylist for Females.");
                    mc.dropMessage("@kin ~ Stylist for Males.");
                    mc.dropMessage("@storage ~ The bank");
                    mc.dropMessage("@reward ~ Reward shop Nr.1 (Using Slimie erasers as currency)");
                    mc.dropMessage("@reward1 ~ Reward shop Nr.2 (Using Slimie erasers currency)");
                    mc.dropMessage("@shop ~ The Shop that sells your every day needs!");
                    mc.dropMessage("@slime ~ Accesses the shop that sells slime erasers for 15m each");
                    mc.dropMessage("@zombie ~ ALL in one NPC");
                } else if (splitted[0].equalsIgnoreCase("@buynx")) {
                    if (splitted.length != 2) {
                        mc.dropMessage("Syntax: @buynx <number> Example: @buynx 1000");
                        return;
                    }
                    int nxamount;
                    try {
                        nxamount = Integer.parseInt(splitted[1]);
                    } catch (NumberFormatException asd) {
                        return;
                    }
                    int cost = nxamount * 1000;
                    if (nxamount > 0 && nxamount < 420000) {
                        if (player.getMeso() >= cost) {
                            player.gainMeso(-cost, true, true, true);
                            player.modifyCSPoints(1, nxamount);
                            mc.dropMessage("You spent " + cost + " mesos. You have gained " + nxamount + " nx.");
                        } else {
                            mc.dropMessage("Not enough mesos. Go get some money you poor hobo. 1 NX is 1000 mesos.");
                        }
                    } else {
                        mc.dropMessage("I cant let you do this, why would you want to do that.");
                    }
                } else if (splitted[0].equalsIgnoreCase("@save")) {
                    if (!player.getCheatTracker().Spam(900000, 0)) { // 15 minutes
                        player.saveToDB(true, false);
                        mc.dropMessage("Saved. <3");
                    } else {
                        mc.dropMessage("You cannot save more than once every 15 minutes.");
                    }
                } else if (splitted[0].equalsIgnoreCase("@expfix")) {
                    player.setExp(0);
                    player.updateSingleStat(MapleStat.EXP, player.getExp());
                } else if (splitted[0].equalsIgnoreCase("@go")) {
                    HashMap<String, Integer> maps = new HashMap<String, Integer>();
                    maps.put("fm", 910000000);
                    maps.put("henesys", 100000000);
                    maps.put("ellinia", 101000000);
                    maps.put("perion", 102000000);
                    maps.put("kerning", 103000000);
                    maps.put("lith", 104000000);
                    maps.put("sleepywood", 105040300);
                    maps.put("florina", 110000000);
                    maps.put("orbis", 200000000);
                    maps.put("happy", 209000000);
                    maps.put("elnath", 211000000);
                    maps.put("ludi", 220000000);
                    maps.put("aqua", 230000000);
                    maps.put("leafre", 240000000);
                    maps.put("mulung", 250000000);
                    maps.put("herb", 251000000);
                    maps.put("omega", 221000000);
                    maps.put("korean", 222000000);
                    maps.put("nlc", 600000000);
                    maps.put("excavation", 990000000);
                    maps.put("mushmom", 100000005);
                    maps.put("showa", 801000000);
                    maps.put("guild", 200000301);
                    maps.put("shrine", 800000000);
                    maps.put("amoria", 680000000);
                    if (splitted.length != 2) {
                        StringBuilder builder = new StringBuilder("Syntax: @go <mapname>");
                        int i = 0;
                        for (String mapss : maps.keySet()) {
                            if (1 % 10 == 0) {// 10 maps per line
                                mc.dropMessage(builder.toString());
                            } else {
                                builder.append(mapss + ", ");
                            }
                        }
                        mc.dropMessage(builder.toString());
                    } else if (maps.containsKey(splitted[1])) {
                        int map = maps.get(splitted[1]);
                        if (map == 910000000) {
                            player.saveLocation(SavedLocationType.FREE_MARKET);
                        }
                        player.changeMap(map);
                        mc.dropMessage("Please feel free to suggest any more locations, Use the @gms commands or post suggestions on the forum.");
                    } else {
                        mc.dropMessage("I could not find the map that you requested, go get an eye test.");
                    }
                    maps.clear();
                } else if (splitted[0].equalsIgnoreCase("@gm")) {
                    if (splitted.length < 2) {
                        return;
                    }
                    else
                        mc.dropMessage("Message sent.");
                    if (!player.getCheatTracker().Spam(60000, 1)) { // 5 minutes.
                        try {
                            c.getChannelServer().getWorldInterface().broadcastGMMessage(null, MaplePacketCreator.serverNotice(6, "Channel: " + c.getChannel() + "  " + player.getName() + ": " + StringUtil.joinStringFrom(splitted, 1)).getBytes());
                        } catch (RemoteException ex) {
                            c.getChannelServer().reconnectWorld();
                        }
                    } else {
                        player.dropMessage(1, "Please don't flood GMs with your messages");
                    }
                } else if (splitted[0].equalsIgnoreCase("@togglesmega")) {
                    if (player.getMeso() >= 10000000) {
                        player.setSmegaEnabled(!player.getSmegaEnabled());
                        String text = (!player.getSmegaEnabled() ? "I blinded you with enchanted dog shit :) ! Now you may not see Avatar smega's" : "You magically grew ears that can see smegas T___T oh god that line is lame.");
                        mc.dropMessage(text);
                        player.gainMeso(-10000000, true);
                    } else {
                        mc.dropMessage("Wheres the mesos you idiot ! I want 10,000,000 meso bitch!");
                    }
                } else if (splitted[0].equalsIgnoreCase("@dispose")) {
                    NPCScriptManager.getInstance().dispose(c);
                    mc.dropMessage("You have been disposed.");
                } else if (splitted[0].equals("@emo")) {
                    player.setHp(0);
                    player.updateSingleStat(MapleStat.HP, 0);
                    mc.dropMessage("Whaaa emo *cut* *cut*.");
                }  else if (splitted[0].equalsIgnoreCase("@rebirth")) {
                int negexp;
                if (player.getLevel() > 199) {
                    player.setLevel(2);
                    player.setExp(0);
                    player.setReborns(player.getReborns() + 1);
                    player.changeJob(MapleJob.getById(0));
                    negexp = player.getExp();
                    player.gainExp(-negexp, false, false);
                    player.updateSingleStat(MapleStat.LEVEL, player.getLevel());
                    player.updateSingleStat(MapleStat.EXP, player.getExp());
                } else {
                    mc.dropMessage("You must be level 200.");
                     }
                 } else if (splitted[0].equalsIgnoreCase("@rank")) {
                    ResultSet rs = ranking(false);
                    mc.dropMessage("Top 10 Players: ");
                    int i = 1;
                    while (rs.next()) {
                        String job; // Should i make it so it shows the actual job ?
                        if (rs.getInt("job") >= 400 && rs.getInt("job") <= 422) {
                            job = "Thief";
                        } else if (rs.getInt("job") >= 300 && rs.getInt("job") <= 322) {
                            job = "Archer";
                        } else if (rs.getInt("job") >= 200 && rs.getInt("job") <= 232) {
                            job = "Mage";
                        } else if (rs.getInt("job") >= 100 && rs.getInt("job") <= 132) {
                            job = "Warrior";
                        } else if (rs.getInt("job") >= 500 && rs.getInt("job") <= 532) {
                            job = "Pirate";
                        } else {
                            job = "Beginner";
                        }
                        mc.dropMessage(i + ". " + rs.getString("name") + "  ||  Job: " + job + "  ||  Rebirths: " + rs.getInt("reborns") + "  ||  Level: " + rs.getInt("level"));
                        i++;
                    }
                } else if (splitted[0].equalsIgnoreCase("@servergms")) {
                    ResultSet rs = ranking(true);
                    String gmType;
                    while (rs.next()) {
                        int gmLevl = rs.getInt("gm");
                        if (gmLevl == 3) {
                            gmType = "GM Helper.";
                        } else if (gmLevl >= 4) {
                            gmType = "Monster GM :D.";
                        } else {
                            gmType = "Error";
                        }
                        mc.dropMessage(rs.getString("name") + "  :  " + gmType);
                    }
                     } else if (splitted[0].equalsIgnoreCase("@credits")) {  
                      mc.dropMessage ("ZombieStory Repack");
                } else if (splitted[0].equalsIgnoreCase("@revive")) {
                    if (splitted.length == 2) {
                        MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
                        if (player != victim) {
                            if (player.getMeso() >= 50000000) { // 50 mil
                                if (victim != null) {
                                    if (!victim.isAlive()) {
                                        victim.setHp(1);
                                        player.gainMeso(-50000000);
                                        victim.updateSingleStat(MapleStat.HP, 1);
                                        mc.dropMessage("You have revived " + victim.getName() + ".");
                                    } else {
                                        mc.dropMessage(victim.getName() + "is not dead.");
                                    }
                                } else {
                                    mc.dropMessage("The player is not online.");
                                }
                            } else {
                                mc.dropMessage("You need 50 million mesos to do this.");
                            }
                        } else {
                            mc.dropMessage("You can't revive yourself.");
                        }
                    } else {
                        mc.dropMessage("Syntax: @revive <player name>");
                    }
                } else if (splitted[0].equalsIgnoreCase("@banme")) {
                    c.getSession().write(MaplePacketCreator.sendGMPolice(0, "Being cool.", 1000000));
                } else if (splitted[0].equalsIgnoreCase("@fakerelog") || splitted[0].equalsIgnoreCase("!fakerelog")) {
                    c.getSession().write(MaplePacketCreator.getCharInfo(player));
                    player.getMap().removePlayer(player);
                    player.getMap().addPlayer(player);
                } else if (splitted[0].equalsIgnoreCase("@cody")) {
                    NPCScriptManager.getInstance().start(c, 9200000);
                } else if (splitted[0].equalsIgnoreCase("@storage")) {
                    player.getStorage().sendStorage(c, 2080005);
                } else if (splitted[0].equalsIgnoreCase("@news")) {
                    NPCScriptManager.getInstance().start(c, 9040011);
                } else if (splitted[0].equalsIgnoreCase("@kin")) {
                    NPCScriptManager.getInstance().start(c, 9900000);
                } else if (splitted[0].equalsIgnoreCase("@nimakin")) {
                    NPCScriptManager.getInstance().start(c, 9900001);
                } else if (splitted[0].equalsIgnoreCase("@reward")) {
                    NPCScriptManager.getInstance().start(c, 2050019);
                } else if (splitted[0].equalsIgnoreCase("@reward1")) {
                    NPCScriptManager.getInstance().start(c, 2020004);
                } else if (splitted[0].equalsIgnoreCase("@fredrick")) {
                    NPCScriptManager.getInstance().start(c, 9030000);
                } else if (splitted[0].equalsIgnoreCase("@spinel")) {
                    NPCScriptManager.getInstance().start(c, 9000020);
                } else if (splitted[0].equalsIgnoreCase("@nana")) {
                    NPCScriptManager.getInstance().start(c, 9201001);
                } else if (splitted[0].equalsIgnoreCase("@shop")) {
                    NPCScriptManager.getInstance().start(c, 9901003);
                    } else if (splitted[0].equalsIgnoreCase("@zombie")) {
                    NPCScriptManager.getInstance().start(c, 9901317);
                } else if (splitted[0].equalsIgnoreCase("@slime")) {
                    NPCScriptManager.getInstance().start(c, 2093002);
                } else if (splitted[0].equalsIgnoreCase("@goafk")) {
                    player.setChalkboard("I'm afk ! drop me a message <3");
                } else if (splitted[0].equalsIgnoreCase("@checkexp")) {
                    MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
                    if (victim == null) {
                        mc.dropMessage("Player was not found in this channel.");
                    } else {
                        mc.dropMessage("EXP: " + victim.getExp() + "   " + victim.getExp() / ExpTable.getExpNeededForLevel(victim.getLevel() + 1) * 100 + " %");
                    }
                }
            } else {
                mc.dropMessage(splitted[0] + " is not a valid command.");
            }
        }
    
        @Override
        public CommandDefinition[] getDefinition() {
            return new CommandDefinition[]{
                        new CommandDefinition("str", 0),
                        new CommandDefinition("dex", 0),
                        new CommandDefinition("int", 0),
                        new CommandDefinition("luk", 0),
                        new CommandDefinition("hp", 0),
                        new CommandDefinition("mp", 0),
                        new CommandDefinition("checkstats", 0),
                        new CommandDefinition("commands", 0),
                        new CommandDefinition("help", 0),
                        new CommandDefinition("buynx", 0),
                        new CommandDefinition("save", 0),
                        new CommandDefinition("expfix", 0),
                        new CommandDefinition("go", 0),
                        new CommandDefinition("gm", 0),
                        new CommandDefinition("togglesmega", 0),
                        new CommandDefinition("deceive", 0),
                        new CommandDefinition("dispose", 0),
                        new CommandDefinition("rank", 0),
                        new CommandDefinition("servergms", 0),
                        new CommandDefinition("credits", 0),
                        new CommandDefinition("revive", 0),
                        new CommandDefinition("banme", 0),
                        new CommandDefinition("clan", 0),
                        new CommandDefinition("afk", 0),
                        new CommandDefinition("onlinetime", 0),
                        new CommandDefinition("emo", 0),
                        new CommandDefinition("rebirth", 0),
                        new CommandDefinition("reborn", 0),
                        new CommandDefinition("slime", 0),
                        new CommandDefinition("kin", 0),
                        new CommandDefinition("nimakin", 0),
                        new CommandDefinition("reward", 0),
                        new CommandDefinition("reward1", 0),
                        new CommandDefinition("cody", 0),
                        new CommandDefinition("storage", 0),
                        new CommandDefinition("fakerelog", 0),
                        new CommandDefinition("fredrick", 0),
                        new CommandDefinition("news", 0),
                        new CommandDefinition("spinel", 0),
                        new CommandDefinition("news", 0),
                        new CommandDefinition("goafk", 0),
                        new CommandDefinition("nana", 0),
                        new CommandDefinition("checkexp", 0),
                        new CommandDefinition("shop", 0),
                        new CommandDefinition("zombie", 0)
            };
        }
    }

  2. קישורים ממומנים

  3. #2
    משתמש משקיע
    שם פרטי
    ספיר
    תאריך הצטרפות
    09/2007
    הודעות
    3,504
    לייקים
    0
    נקודות
    0
    משפט מחץ
    Beauty From Far And Far From Beauty
    מין: נקבה

    ברירת מחדל

    אם שינית ת'שם של הפקודה תוודא שני דברים:
    1.ששינת את ההגדרה של הפקודה בתחתית הקובץ לדוגמא אצלך אתה צריך לשנות
    קוד:
    new CommandDefinition("zombie", 0)
    ל
    קוד:
    new CommandDefinition("shanks", 0)
    2.כמובן לא לשכוח לעשות קומפייל אחרת כל השינויים שעשית לא יקלטו בתוך השרת.



  4. #3
    משתמש מתחיל
    שם פרטי
    \
    תאריך הצטרפות
    01/2010
    הודעות
    16
    לייקים
    0
    נקודות
    0
    מין: זכר

    ברירת מחדל

    מזה קומפייל

  5. #4

    ברירת מחדל

    וייי... עם אם לא יודעים מה זה קומפייל על תפתחו אפילו שרת!!!!!!11


  6. #5

    הק"ב אנחנו אוהבים אותך!
    האוואטר של Eden.
    שם פרטי
    עדן
    תאריך הצטרפות
    01/2010
    גיל
    30
    הודעות
    2,565
    לייקים
    2
    נקודות
    1,545
    משפט מחץ
    עראק עראק, עראק עראק, אוהבים אותך כולם, עראק עראק, עראק עראק, מקיאים אותך בים.
    מין: זכר

    ברירת מחדל

    חפש קומפייל עם netbeans מדריך של Azoref זאתי שהגיבה למעלה.

  7. #6
    משתמש משקיע
    שם פרטי
    טל
    תאריך הצטרפות
    12/2009
    הודעות
    3,165
    לייקים
    0
    נקודות
    381
    משפט מחץ
    מה אכפת לכם?
    מין: זכר

    ברירת מחדל

    קומפייל זאת הפעולה שעושים כשמתמשים בתוכנה Netbeans או כל תוכנה אחרת ולפי השאלה שלך אני מבין שאתה לא יודע גם לקמפל.. אתה רוצה מדריך איך?


    זהו חזי החזרזיר והוא על סמים קשים!

  8. #7
    משתמש מתחיל האוואטר של nugyyman
    שם פרטי
    עידו
    תאריך הצטרפות
    09/2009
    הודעות
    318
    לייקים
    1
    נקודות
    12
    משפט מחץ
    למה לעשות היום, מה שאפשר לדחות למחר ?

    ברירת מחדל

    קוד:
     
    package net.sf.odinms.client.messages.commands;
    import java.rmi.RemoteException;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.HashMap;
    import net.sf.odinms.client.ExpTable;
    import net.sf.odinms.client.MapleCharacter;
    import net.sf.odinms.client.MapleClient;
    import net.sf.odinms.client.MapleJob;
    import net.sf.odinms.net.world.remote.WorldChannelInterface;
    import net.sf.odinms.client.MapleStat;
    import net.sf.odinms.client.messages.Command;
    import net.sf.odinms.client.messages.CommandDefinition;
    import net.sf.odinms.client.messages.MessageCallback;
    import net.sf.odinms.net.channel.ChannelServer;
    import net.sf.odinms.database.DatabaseConnection;
    import net.sf.odinms.scripting.npc.NPCScriptManager;
    import net.sf.odinms.server.MapleInventoryManipulator;
    import net.sf.odinms.server.maps.SavedLocationType;
    import net.sf.odinms.tools.MaplePacketCreator;
    import net.sf.odinms.tools.StringUtil;
    public class PlayerCommands implements Command {
        private ResultSet ranking(boolean gm) {
            try {
                Connection con = DatabaseConnection.getConnection();
                PreparedStatement ps;
                if (!gm) {
                    ps = con.prepareStatement("SELECT reborns, level, name, job FROM characters WHERE gm < 3 ORDER BY reborns desc LIMIT 10");
                } else {
                    ps = con.prepareStatement("SELECT name, gm FROM characters WHERE gm >= 3");
                }
                return ps.executeQuery();
            } catch (SQLException ex) {
                return null;
            }
        }
        @Override
        public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception {
            splitted[0] = splitted[0].toLowerCase();
            MapleCharacter player = c.getPlayer();
            if (player.getMapId() != 980000404) {
                if (splitted[0].equals("@str") || splitted[0].equals("@dex") || splitted[0].equals("@int") || splitted[0].equals("@luk") || splitted[0].equals("@hp") || splitted[0].equals("@mp")) {
                    int amount = Integer.parseInt(splitted[1]);
                if (amount > 0 && amount <= player.getRemainingAp() && amount < 31997) {
                    if (splitted[0].equals("@str") && amount + player.getStr() < 32001) {
                        player.setStr(player.getStr() + amount);
                        player.updateSingleStat(MapleStat.STR, player.getStr());
                    } else if (splitted[0].equals("@int") && amount + player.getInt() < 32001) {
                        player.setInt(player.getInt() + amount);
                        player.updateSingleStat(MapleStat.INT, player.getInt());
                    } else if (splitted[0].equals("@luk") && amount + player.getLuk() < 32001) {
                        player.setLuk(player.getLuk() + amount);
                        player.updateSingleStat(MapleStat.LUK, player.getLuk());
                    } else if (splitted[0].equals("@dex") && amount + player.getDex() < 32001) {
                        player.setDex(player.getDex() + amount);
                        player.updateSingleStat(MapleStat.DEX, player.getDex());
                    } else {
                        mc.dropMessage("Make sure the stat you are trying to raise will not be over 32000.");
                    }
                    player.setRemainingAp(player.getRemainingAp() - amount);
                    player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
                } else {
                    mc.dropMessage("Please make sure your AP is not over 32000 and you have enough to distribute.");
                }
                } else if (splitted[0].equalsIgnoreCase("@checkstats")) {
                    mc.dropMessage("Your stats are:");
                    mc.dropMessage("Str: " + player.getStr());
                    mc.dropMessage("Dex: " + player.getDex());
                    mc.dropMessage("Int: " + player.getInt());
                    mc.dropMessage("Luk: " + player.getLuk());
                    mc.dropMessage("Available AP: " + player.getRemainingAp());
                    mc.dropMessage("Rebirths: " + player.getReborns());
                } else if (splitted[0].equalsIgnoreCase("@commands") || splitted[0].equalsIgnoreCase("@help")) {
                    mc.dropMessage("============================================================");
                    mc.dropMessage("        " + c.getChannelServer().getServerName() + " Commands");
                    mc.dropMessage("============================================================");
                    mc.dropMessage("@str/@dex/@int/@luk <number> ~ with these commands you will never have to add AP the slow way.");
                    mc.dropMessage("@buynx <number> ~ NX currency is currently 1000 mesos for 1 nx point.");
                    mc.dropMessage("@save ~ Basically saves.");
                    mc.dropMessage("@rank ~ shows top 10 people.");
                    mc.dropMessage("@dispose ~ Turn off seeing smegas / Turn on.");
                    mc.dropMessage("@togglesmega ~ Turn off seeing smegas / Turn on.");
                    mc.dropMessage("@decieve ~ Sets your fame to -1337");
                    mc.dropMessage("@expfix ~ Got negative EXP ? Type this");
                    mc.dropMessage("@gm <message> ~ Call a gm for help (: ?");
                    mc.dropMessage("@checkstat ~ Allows you to check what your stats are. Including rebirths");
                    mc.dropMessage("@go ~ Try it out, type @go");
                    mc.dropMessage("@revive ~ Revives anyone on the channel besides yourself.");
                    mc.dropMessage("@cody ~ Job Advancer.");
                    mc.dropMessage("@nana ~ Stats reseter.");
                    mc.dropMessage("@nimakin ~ Stylist for Females.");
                    mc.dropMessage("@kin ~ Stylist for Males.");
                    mc.dropMessage("@storage ~ The bank");
                    mc.dropMessage("@reward ~ Reward shop Nr.1 (Using Slimie erasers as currency)");
                    mc.dropMessage("@reward1 ~ Reward shop Nr.2 (Using Slimie erasers currency)");
                    mc.dropMessage("@shop ~ The Shop that sells your every day needs!");
                    mc.dropMessage("@slime ~ Accesses the shop that sells slime erasers for 15m each");
                    mc.dropMessage("@shanks ~ ALL in one NPC");
                } else if (splitted[0].equalsIgnoreCase("@buynx")) {
                    if (splitted.length != 2) {
                        mc.dropMessage("Syntax: @buynx <number> Example: @buynx 1000");
                        return;
                    }
                    int nxamount;
                    try {
                        nxamount = Integer.parseInt(splitted[1]);
                    } catch (NumberFormatException asd) {
                        return;
                    }
                    int cost = nxamount * 1000;
                    if (nxamount > 0 && nxamount < 420000) {
                        if (player.getMeso() >= cost) {
                            player.gainMeso(-cost, true, true, true);
                            player.modifyCSPoints(1, nxamount);
                            mc.dropMessage("You spent " + cost + " mesos. You have gained " + nxamount + " nx.");
                        } else {
                            mc.dropMessage("Not enough mesos. Go get some money you poor hobo. 1 NX is 1000 mesos.");
                        }
                    } else {
                        mc.dropMessage("I cant let you do this, why would you want to do that.");
                    }
                } else if (splitted[0].equalsIgnoreCase("@save")) {
                    if (!player.getCheatTracker().Spam(900000, 0)) { // 15 minutes
                        player.saveToDB(true, false);
                        mc.dropMessage("Saved. <3");
                    } else {
                        mc.dropMessage("You cannot save more than once every 15 minutes.");
                    }
                } else if (splitted[0].equalsIgnoreCase("@expfix")) {
                    player.setExp(0);
                    player.updateSingleStat(MapleStat.EXP, player.getExp());
                } else if (splitted[0].equalsIgnoreCase("@go")) {
                    HashMap<String, Integer> maps = new HashMap<String, Integer>();
                    maps.put("fm", 910000000);
                    maps.put("henesys", 100000000);
                    maps.put("ellinia", 101000000);
                    maps.put("perion", 102000000);
                    maps.put("kerning", 103000000);
                    maps.put("lith", 104000000);
                    maps.put("sleepywood", 105040300);
                    maps.put("florina", 110000000);
                    maps.put("orbis", 200000000);
                    maps.put("happy", 209000000);
                    maps.put("elnath", 211000000);
                    maps.put("ludi", 220000000);
                    maps.put("aqua", 230000000);
                    maps.put("leafre", 240000000);
                    maps.put("mulung", 250000000);
                    maps.put("herb", 251000000);
                    maps.put("omega", 221000000);
                    maps.put("korean", 222000000);
                    maps.put("nlc", 600000000);
                    maps.put("excavation", 990000000);
                    maps.put("mushmom", 100000005);
                    maps.put("showa", 801000000);
                    maps.put("guild", 200000301);
                    maps.put("shrine", 800000000);
                    maps.put("amoria", 680000000);
                    if (splitted.length != 2) {
                        StringBuilder builder = new StringBuilder("Syntax: @go <mapname>");
                        int i = 0;
                        for (String mapss : maps.keySet()) {
                            if (1 % 10 == 0) {// 10 maps per line
                                mc.dropMessage(builder.toString());
                            } else {
                                builder.append(mapss + ", ");
                            }
                        }
                        mc.dropMessage(builder.toString());
                    } else if (maps.containsKey(splitted[1])) {
                        int map = maps.get(splitted[1]);
                        if (map == 910000000) {
                            player.saveLocation(SavedLocationType.FREE_MARKET);
                        }
                        player.changeMap(map);
                        mc.dropMessage("Please feel free to suggest any more locations, Use the @gms commands or post suggestions on the forum.");
                    } else {
                        mc.dropMessage("I could not find the map that you requested, go get an eye test.");
                    }
                    maps.clear();
                } else if (splitted[0].equalsIgnoreCase("@gm")) {
                    if (splitted.length < 2) {
                        return;
                    }
                    else
                        mc.dropMessage("Message sent.");
                    if (!player.getCheatTracker().Spam(60000, 1)) { // 5 minutes.
                        try {
                            c.getChannelServer().getWorldInterface().broadcastGMMessage(null, MaplePacketCreator.serverNotice(6, "Channel: " + c.getChannel() + "  " + player.getName() + ": " + StringUtil.joinStringFrom(splitted, 1)).getBytes());
                        } catch (RemoteException ex) {
                            c.getChannelServer().reconnectWorld();
                        }
                    } else {
                        player.dropMessage(1, "Please don't flood GMs with your messages");
                    }
                } else if (splitted[0].equalsIgnoreCase("@togglesmega")) {
                    if (player.getMeso() >= 10000000) {
                        player.setSmegaEnabled(!player.getSmegaEnabled());
                        String text = (!player.getSmegaEnabled() ? "I blinded you with enchanted dog shit :) ! Now you may not see Avatar smega's" : "You magically grew ears that can see smegas T___T oh god that line is lame.");
                        mc.dropMessage(text);
                        player.gainMeso(-10000000, true);
                    } else {
                        mc.dropMessage("Wheres the mesos you idiot ! I want 10,000,000 meso bitch!");
                    }
                } else if (splitted[0].equalsIgnoreCase("@dispose")) {
                    NPCScriptManager.getInstance().dispose(c);
                    mc.dropMessage("You have been disposed.");
                } else if (splitted[0].equals("@emo")) {
                    player.setHp(0);
                    player.updateSingleStat(MapleStat.HP, 0);
                    mc.dropMessage("Whaaa emo *cut* *cut*.");
                }  else if (splitted[0].equalsIgnoreCase("@rebirth")) {
                int negexp;
                if (player.getLevel() > 199) {
                    player.setLevel(2);
                    player.setExp(0);
                    player.setReborns(player.getReborns() + 1);
                    player.changeJob(MapleJob.getById(0));
                    negexp = player.getExp();
                    player.gainExp(-negexp, false, false);
                    player.updateSingleStat(MapleStat.LEVEL, player.getLevel());
                    player.updateSingleStat(MapleStat.EXP, player.getExp());
                } else {
                    mc.dropMessage("You must be level 200.");
                     }
                 } else if (splitted[0].equalsIgnoreCase("@rank")) {
                    ResultSet rs = ranking(false);
                    mc.dropMessage("Top 10 Players: ");
                    int i = 1;
                    while (rs.next()) {
                        String job; // Should i make it so it shows the actual job ?
                        if (rs.getInt("job") >= 400 && rs.getInt("job") <= 422) {
                            job = "Thief";
                        } else if (rs.getInt("job") >= 300 && rs.getInt("job") <= 322) {
                            job = "Archer";
                        } else if (rs.getInt("job") >= 200 && rs.getInt("job") <= 232) {
                            job = "Mage";
                        } else if (rs.getInt("job") >= 100 && rs.getInt("job") <= 132) {
                            job = "Warrior";
                        } else if (rs.getInt("job") >= 500 && rs.getInt("job") <= 532) {
                            job = "Pirate";
                        } else {
                            job = "Beginner";
                        }
                        mc.dropMessage(i + ". " + rs.getString("name") + "  ||  Job: " + job + "  ||  Rebirths: " + rs.getInt("reborns") + "  ||  Level: " + rs.getInt("level"));
                        i++;
                    }
                } else if (splitted[0].equalsIgnoreCase("@servergms")) {
                    ResultSet rs = ranking(true);
                    String gmType;
                    while (rs.next()) {
                        int gmLevl = rs.getInt("gm");
                        if (gmLevl == 3) {
                            gmType = "GM Helper.";
                        } else if (gmLevl >= 4) {
                            gmType = "Monster GM :D.";
                        } else {
                            gmType = "Error";
                        }
                        mc.dropMessage(rs.getString("name") + "  :  " + gmType);
                    }
                     } else if (splitted[0].equalsIgnoreCase("@credits")) {  
                      mc.dropMessage ("ZombieStory Repack");
                } else if (splitted[0].equalsIgnoreCase("@revive")) {
                    if (splitted.length == 2) {
                        MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
                        if (player != victim) {
                            if (player.getMeso() >= 50000000) { // 50 mil
                                if (victim != null) {
                                    if (!victim.isAlive()) {
                                        victim.setHp(1);
                                        player.gainMeso(-50000000);
                                        victim.updateSingleStat(MapleStat.HP, 1);
                                        mc.dropMessage("You have revived " + victim.getName() + ".");
                                    } else {
                                        mc.dropMessage(victim.getName() + "is not dead.");
                                    }
                                } else {
                                    mc.dropMessage("The player is not online.");
                                }
                            } else {
                                mc.dropMessage("You need 50 million mesos to do this.");
                            }
                        } else {
                            mc.dropMessage("You can't revive yourself.");
                        }
                    } else {
                        mc.dropMessage("Syntax: @revive <player name>");
                    }
                } else if (splitted[0].equalsIgnoreCase("@banme")) {
                    c.getSession().write(MaplePacketCreator.sendGMPolice(0, "Being cool.", 1000000));
                } else if (splitted[0].equalsIgnoreCase("@fakerelog") || splitted[0].equalsIgnoreCase("!fakerelog")) {
                    c.getSession().write(MaplePacketCreator.getCharInfo(player));
                    player.getMap().removePlayer(player);
                    player.getMap().addPlayer(player);
                } else if (splitted[0].equalsIgnoreCase("@cody")) {
                    NPCScriptManager.getInstance().start(c, 9200000);
                } else if (splitted[0].equalsIgnoreCase("@storage")) {
                    player.getStorage().sendStorage(c, 2080005);
                } else if (splitted[0].equalsIgnoreCase("@news")) {
                    NPCScriptManager.getInstance().start(c, 9040011);
                } else if (splitted[0].equalsIgnoreCase("@kin")) {
                    NPCScriptManager.getInstance().start(c, 9900000);
                } else if (splitted[0].equalsIgnoreCase("@nimakin")) {
                    NPCScriptManager.getInstance().start(c, 9900001);
                } else if (splitted[0].equalsIgnoreCase("@reward")) {
                    NPCScriptManager.getInstance().start(c, 2050019);
                } else if (splitted[0].equalsIgnoreCase("@reward1")) {
                    NPCScriptManager.getInstance().start(c, 2020004);
                } else if (splitted[0].equalsIgnoreCase("@fredrick")) {
                    NPCScriptManager.getInstance().start(c, 9030000);
                } else if (splitted[0].equalsIgnoreCase("@spinel")) {
                    NPCScriptManager.getInstance().start(c, 9000020);
                } else if (splitted[0].equalsIgnoreCase("@nana")) {
                    NPCScriptManager.getInstance().start(c, 9201001);
                } else if (splitted[0].equalsIgnoreCase("@shop")) {
                    NPCScriptManager.getInstance().start(c, 9901003);
                    } else if (splitted[0].equalsIgnoreCase("@shanks")) {
                    NPCScriptManager.getInstance().start(c, 9901317);
                } else if (splitted[0].equalsIgnoreCase("@slime")) {
                    NPCScriptManager.getInstance().start(c, 2093002);
                } else if (splitted[0].equalsIgnoreCase("@goafk")) {
                    player.setChalkboard("I'm afk ! drop me a message <3");
                } else if (splitted[0].equalsIgnoreCase("@checkexp")) {
                    MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
                    if (victim == null) {
                        mc.dropMessage("Player was not found in this channel.");
                    } else {
                        mc.dropMessage("EXP: " + victim.getExp() + "   " + victim.getExp() / ExpTable.getExpNeededForLevel(victim.getLevel() + 1) * 100 + " %");
                    }
                }
            } else {
                mc.dropMessage(splitted[0] + " is not a valid command.");
            }
        }
     
        @Override
        public CommandDefinition[] getDefinition() {
            return new CommandDefinition[]{
                        new CommandDefinition("str", 0),
                        new CommandDefinition("dex", 0),
                        new CommandDefinition("int", 0),
                        new CommandDefinition("luk", 0),
                        new CommandDefinition("hp", 0),
                        new CommandDefinition("mp", 0),
                        new CommandDefinition("checkstats", 0),
                        new CommandDefinition("commands", 0),
                        new CommandDefinition("help", 0),
                        new CommandDefinition("buynx", 0),
                        new CommandDefinition("save", 0),
                        new CommandDefinition("expfix", 0),
                        new CommandDefinition("go", 0),
                        new CommandDefinition("gm", 0),
                        new CommandDefinition("togglesmega", 0),
                        new CommandDefinition("deceive", 0),
                        new CommandDefinition("dispose", 0),
                        new CommandDefinition("rank", 0),
                        new CommandDefinition("servergms", 0),
                        new CommandDefinition("credits", 0),
                        new CommandDefinition("revive", 0),
                        new CommandDefinition("banme", 0),
                        new CommandDefinition("clan", 0),
                        new CommandDefinition("afk", 0),
                        new CommandDefinition("onlinetime", 0),
                        new CommandDefinition("emo", 0),
                        new CommandDefinition("rebirth", 0),
                        new CommandDefinition("reborn", 0),
                        new CommandDefinition("slime", 0),
                        new CommandDefinition("kin", 0),
                        new CommandDefinition("nimakin", 0),
                        new CommandDefinition("reward", 0),
                        new CommandDefinition("reward1", 0),
                        new CommandDefinition("cody", 0),
                        new CommandDefinition("storage", 0),
                        new CommandDefinition("fakerelog", 0),
                        new CommandDefinition("fredrick", 0),
                        new CommandDefinition("news", 0),
                        new CommandDefinition("spinel", 0),
                        new CommandDefinition("news", 0),
                        new CommandDefinition("goafk", 0),
                        new CommandDefinition("nana", 0),
                        new CommandDefinition("checkexp", 0),
                        new CommandDefinition("shop", 0),
                        new CommandDefinition("shanks", 0)
            };
        }
    }
    שונה, אבל אתה חייב לקמפל.
    נערך לאחרונה על ידי nugyyman; 20-01-2010 בשעה 20:52.

  9. #8
    משתמש מתחיל
    שם פרטי
    \
    תאריך הצטרפות
    01/2010
    הודעות
    16
    לייקים
    0
    נקודות
    0
    מין: זכר

    ברירת מחדל

    כן ומהר

  10. #9

    הק"ב אנחנו אוהבים אותך!
    האוואטר של Eden.
    שם פרטי
    עדן
    תאריך הצטרפות
    01/2010
    גיל
    30
    הודעות
    2,565
    לייקים
    2
    נקודות
    1,545
    משפט מחץ
    עראק עראק, עראק עראק, אוהבים אותך כולם, עראק עראק, עראק עראק, מקיאים אותך בים.
    מין: זכר

    ברירת מחדל

    ציטוט נכתב במקור על ידי SigaRa צפיה בהודעה
    כן ומהר
    אתה ממש חוצפן מנסים לעזור לך ואתה מזרז אותנו?

  11. #10
    משתמש משקיע
    שם פרטי
    טל
    תאריך הצטרפות
    12/2009
    הודעות
    3,165
    לייקים
    0
    נקודות
    381
    משפט מחץ
    מה אכפת לכם?
    מין: זכר

    ברירת מחדל

    הנה המדריך http://www.iatraf.co.il/showthread.php?t=535824 קרדיט לספיר הסוסה על ההכנה שלו!
    נערך לאחרונה על ידי Warden; 20-01-2010 בשעה 20:56.


    זהו חזי החזרזיר והוא על סמים קשים!

  12. #11
    משתמש מתחיל
    שם פרטי
    \
    תאריך הצטרפות
    01/2010
    הודעות
    16
    לייקים
    0
    נקודות
    0
    מין: זכר

    ברירת מחדל

    תודה רבה! עזרתם לי מאוד !

  13. #12
    משתמש מתחיל
    שם פרטי
    \
    תאריך הצטרפות
    01/2010
    הודעות
    16
    לייקים
    0
    נקודות
    0
    מין: זכר

    ברירת מחדל

    אתה ממש חוצפן מנסים לעזור לך ואתה מזרז אותנו?
    סבבה סליחה פשוט אני חייב דחוף !

  14. #13
    משתמש מתחיל
    שם פרטי
    \
    תאריך הצטרפות
    01/2010
    הודעות
    16
    לייקים
    0
    נקודות
    0
    מין: זכר

    ברירת מחדל

    מנהלים לנעול ! הבעיה נפטרה
    נערך לאחרונה על ידי SigaRa; 20-01-2010 בשעה 21:00.

  15. #14

    הק"ב אנחנו אוהבים אותך!
    האוואטר של Eden.
    שם פרטי
    עדן
    תאריך הצטרפות
    01/2010
    גיל
    30
    הודעות
    2,565
    לייקים
    2
    נקודות
    1,545
    משפט מחץ
    עראק עראק, עראק עראק, אוהבים אותך כולם, עראק עראק, עראק עראק, מקיאים אותך בים.
    מין: זכר

    ברירת מחדל

    ציטוט נכתב במקור על ידי SigaRa צפיה בהודעה
    תודה רבה! עזרתם לי מאוד !
    ציטוט נכתב במקור על ידי SigaRa צפיה בהודעה
    סבבה סליחה פשוט אני חייב דחוף !
    ציטוט נכתב במקור על ידי SigaRa צפיה בהודעה
    מנהלים לנעול ! הבעיה נפטרה
    טריפל? קרא חוקי פורום.

+ תגובה לנושא


הרשאות פרסום

  • אין באפשרותך לפרסם נושאים חדשים
  • אין באפשרותך לפרסם תגובות
  • אין באפשרותך לצרף קבצים
  • אין באפשרותך לערוך את הודעותיך


כל הזמנים הם לפי GMT +3. השעה כרגע היא 05:15.
מופעל על ידי vBulletin™ © גרסה 4.1, 2011 vBulletin Solutions, Inc. כל הזכויות שמורות.
פעילות הגולשים
אומנות וגרפיקה
מוזיקה
ספורט
סדרות טלוויזיה
סרטים וקולנוע
קנייה ומכירה
רשתות חברתיות
הבורר 3
פורומי פנאי ובידור
סרטים
סדרות
משחקים
דיבורים
אקטואליה
בעלי חיים
בדיחות והומור
משחקי ספורט
הבורר
מחשבים וטכנולוגיה
תמיכה טכנית
חומרה ומודינג
תוכנות להורדה
סלולארי וגאדג'טים
רקעים למחשב
ציוד הקפי למחשב
אבטחת מידע
תכנות ובניית אתרים
כסף ברשת
אייפון
בריאות ואורח חיים
כושר ופיתוח גוף
דיאטה
צבא וגיוס
יעוץ מיני
מה שבלב
אומנות הפיתוי
יהדות
מיסטיקה ורוחניות
אתאיזם ודתות

נושאים: 2,473,293 | הודעות: 8,173,880 | משתמשים: 315,603 | המשתמש החדש ביותר: upizijoj | עיצוב גרפי: סטודיו עודד בביוף | קידוד: rellect