Better @stat

Status
Not open for further replies.
Junior Spellweaver
Joined
Jun 27, 2008
Messages
148
Reaction score
0
PHP:
else if (splitted[0].equals("@str")) {
                   int up;
                    up = Integer.parseInt(splitted[1]);
                    if ( player.getRemainingAp() < up ||  player.getRemainingAp() < 0 || player.getStr() >= 2000 || up < 0) {
                        mc.dropMessage("Insufficient AP or above the 2000 limit.");
                    } else if ( player.getRemainingAp() > 0) {
                          player.setStr(player.getStr() + up);
                          player.setRemainingAp(player.getRemainingAp() - up);
                          player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
                          player.updateSingleStat(MapleStat.STR, player.getStr());
                }
                 
                }else if (splitted[0].equals("@int")) {
                   int up;
                    up = Integer.parseInt(splitted[1]);
                    if ( player.getRemainingAp() < up ||  player.getRemainingAp() < 0 || player.getInt() >= 2000 || up < 0) {
                        mc.dropMessage("Insufficient AP or above the 2000 limit");
                    } else if ( player.getRemainingAp() > 0) {
                          player.setInt(player.getInt() + up);
                          player.setRemainingAp(player.getRemainingAp() - up);
                          player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
                          player.updateSingleStat(MapleStat.INT, player.getInt());
                }
                    //DEX
                }else if (splitted[0].equals("@dex")) {
                   int up;
                    up = Integer.parseInt(splitted[1]);
                    if ( player.getRemainingAp() < up ||  player.getRemainingAp() < 0 || player.getDex() >= 2000 || up < 0) {
                        mc.dropMessage("Insufficient AP or above the 2000 limit");
                    } else if ( player.getRemainingAp() > 0) {
                          player.setDex(player.getDex() + up);
                          player.setRemainingAp(player.getRemainingAp() - up);
                           player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
                          player.updateSingleStat(MapleStat.DEX, player.getDex());
                }
                    //LUCK
                }else if (splitted[0].equals("@luk")) {
                   int up;
                    up = Integer.parseInt(splitted[1]);
                    if ( player.getRemainingAp() < up ||  player.getRemainingAp() < 0 || player.getLuk() >= 2000 || up < 0) {
                        mc.dropMessage("Insufficient AP or above the 2000 limit");
                    } else if ( player.getRemainingAp() > 0) {
                          player.setLuk(player.getLuk() + up);
                             player.setRemainingAp(player.getRemainingAp() - up);
                           player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
                          player.updateSingleStat(MapleStat.LUK, player.getLuk());
                }
                        }
Has a limit for stats, and it also has a fix where you could have done @stat -#.
Enjoy.
Credits to that guy who coded it first and me for sexifying it? D:
 
Re: [Release] Better @stat

so wats the limit 2000

its nt bad better then the one i have with infinite @str and etc
 
Re: [Release] Better @stat

This seems stupid, you have to have at least 2000 in the stat if you want to use the command?
At least you fixed: @str -50000
What? Do you know how to read English?
If there's a "limit" that means maximum, not minimum, therefor your "at least" is nullified. So you're wrong, sir.
 
Re: [Release] Better @stat

highest is 2k 2k isnt needed this is better then the other normal release
 
Re: [Release] Better @stat

"player.getDex() >= 2000"
=
you must have at least 2000 in dex

Code:
                    if ( player.getRemainingAp() < up ||  player.getRemainingAp() < 0 || player.getInt() >= 2000 || up < 0) {
                        mc.dropMessage("Insufficient AP or above the 2000 limit");
                    }
If the player has 2000 and you're trying to add more, it'll say you're over.
learn2/if,else/
 
Re: [Release] Better @stat

v1ral do you know if using mega tubi for adding stats/skills fast will cause anything bad.
 
Re: [Release] Better @stat

I love this guy lol always fixing and perfecting stuff and creating shit no one would ever think about
 
Re: [Release] Better @stat

Nice job! I tried doing this myself but I couldn't get it working..
 
Status
Not open for further replies.