Commands overhaul + Selective loot + Antimulticlient Coordinator
Completely overhauled commands layout, each command splitted in Java classes. Optimized "ranks" command, no more calling the DB to get ranking info. Implemented a mechanic where mobs only spawns loots that are visible/collectable by the player's party. Implemented a server flag which sets whether explorers, cygnus and legends are allowed to share the cash shop inventory or not. Implemented support for dynamic server rates at bootup. Rates can now be assigned at the configuration.ini file. Devised the anti-multiclient login coordinator feature. Besides multiclient attempts by the same machine, it also prevents unauthorized login attempts into an account. Fixed PQ instances being forcefully closed even when party leader reassignment upon logout is available. Fixed mob statis not concurrently protected.
This commit is contained in:
83
src/client/command/commands/v4/ProItemCommand.java
Normal file
83
src/client/command/commands/v4/ProItemCommand.java
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
|
||||
Copyleft (L) 2016 - 2018 RonanLana
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
@Author: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v4;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import constants.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
|
||||
public class ProItemCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 2) {
|
||||
player.yellowMessage("Syntax: !proitem <itemid> <statvalue>");
|
||||
return;
|
||||
}
|
||||
int itemid = Integer.parseInt(params[0]);
|
||||
short multiply = Short.parseShort(params[1]);
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
MapleInventoryType type = ItemConstants.getInventoryType(itemid);
|
||||
if (type.equals(MapleInventoryType.EQUIP)) {
|
||||
Item it = ii.getEquipById(itemid);
|
||||
it.setOwner(player.getName());
|
||||
|
||||
hardsetItemStats((Equip) it, multiply);
|
||||
MapleInventoryManipulator.addFromDrop(c, it);
|
||||
} else {
|
||||
player.dropMessage(6, "Make sure it's an equippable item.");
|
||||
}
|
||||
}
|
||||
private static void hardsetItemStats(Equip equip, short stat) {
|
||||
equip.setStr(stat);
|
||||
equip.setDex(stat);
|
||||
equip.setInt(stat);
|
||||
equip.setLuk(stat);
|
||||
equip.setMatk(stat);
|
||||
equip.setWatk(stat);
|
||||
equip.setAcc(stat);
|
||||
equip.setAvoid(stat);
|
||||
equip.setJump(stat);
|
||||
equip.setSpeed(stat);
|
||||
equip.setWdef(stat);
|
||||
equip.setMdef(stat);
|
||||
equip.setHp(stat);
|
||||
equip.setMp(stat);
|
||||
|
||||
byte flag = equip.getFlag();
|
||||
flag |= ItemConstants.UNTRADEABLE;
|
||||
equip.setFlag(flag);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user