Rename and clean up MapleCharacter
This commit is contained in:
@@ -47,8 +47,8 @@ function action(mode, type, selection) {
|
|||||||
} else if(status == 2) {
|
} else if(status == 2) {
|
||||||
var text = cm.getText();
|
var text = cm.getText();
|
||||||
|
|
||||||
const MapleCharacter = Java.type('client.MapleCharacter');
|
const Character = Java.type('client.Character');
|
||||||
var canCreate = MapleCharacter.canCreateChar(text);
|
var canCreate = Character.canCreateChar(text);
|
||||||
if(canCreate) {
|
if(canCreate) {
|
||||||
cm.getPlayer().setName(text);
|
cm.getPlayer().setName(text);
|
||||||
cm.sendOk("Your name has been changed to #b" + text + "#k. You will have to login again for this to take effect.", 1);
|
cm.sendOk("Your name has been changed to #b" + text + "#k. You will have to login again for this to take effect.", 1);
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public class BuddyList {
|
|||||||
|
|
||||||
public void broadcast(Packet packet, PlayerStorage pstorage) {
|
public void broadcast(Packet packet, PlayerStorage pstorage) {
|
||||||
for(int bid : getBuddyIds()) {
|
for(int bid : getBuddyIds()) {
|
||||||
MapleCharacter chr = pstorage.getCharacterById(bid);
|
Character chr = pstorage.getCharacterById(bid);
|
||||||
|
|
||||||
if(chr != null && chr.isLoggedinWorld()) {
|
if(chr != null && chr.isLoggedinWorld()) {
|
||||||
chr.sendPacket(packet);
|
chr.sendPacket(packet);
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class MapleCharacter extends AbstractMapleCharacterObject {
|
public class Character extends AbstractMapleCharacterObject {
|
||||||
private static final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
private static final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||||
private static final String LEVEL_200 = "[Congrats] %s has reached Level %d! Congratulate %s on such an amazing achievement!";
|
private static final String LEVEL_200 = "[Congrats] %s has reached Level %d! Congratulate %s on such an amazing achievement!";
|
||||||
private static final String[] BLOCKED_NAMES = {"admin", "owner", "moderator", "intern", "donor", "administrator", "FREDRICK", "help", "helper", "alert", "notice", "maplestory", "fuck", "wizet", "fucking", "negro", "fuk", "fuc", "penis", "pussy", "asshole", "gay",
|
private static final String[] BLOCKED_NAMES = {"admin", "owner", "moderator", "intern", "donor", "administrator", "FREDRICK", "help", "helper", "alert", "notice", "maplestory", "fuck", "wizet", "fucking", "negro", "fuk", "fuc", "penis", "pussy", "asshole", "gay",
|
||||||
@@ -142,12 +142,12 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
private String commandtext;
|
private String commandtext;
|
||||||
private String dataString;
|
private String dataString;
|
||||||
private String search = null;
|
private String search = null;
|
||||||
private AtomicBoolean mapTransitioning = new AtomicBoolean(true); // player client is currently trying to change maps or log in the game map
|
private final AtomicBoolean mapTransitioning = new AtomicBoolean(true); // player client is currently trying to change maps or log in the game map
|
||||||
private AtomicBoolean awayFromWorld = new AtomicBoolean(true); // player is online, but on cash shop or mts
|
private final AtomicBoolean awayFromWorld = new AtomicBoolean(true); // player is online, but on cash shop or mts
|
||||||
private AtomicInteger exp = new AtomicInteger();
|
private final AtomicInteger exp = new AtomicInteger();
|
||||||
private AtomicInteger gachaexp = new AtomicInteger();
|
private final AtomicInteger gachaexp = new AtomicInteger();
|
||||||
private AtomicInteger meso = new AtomicInteger();
|
private final AtomicInteger meso = new AtomicInteger();
|
||||||
private AtomicInteger chair = new AtomicInteger(-1);
|
private final AtomicInteger chair = new AtomicInteger(-1);
|
||||||
private int merchantmeso;
|
private int merchantmeso;
|
||||||
private BuddyList buddylist;
|
private BuddyList buddylist;
|
||||||
private EventInstanceManager eventInstance = null;
|
private EventInstanceManager eventInstance = null;
|
||||||
@@ -162,7 +162,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
private MapleRockPaperScissor rps;
|
private MapleRockPaperScissor rps;
|
||||||
private MapleMount maplemount;
|
private MapleMount maplemount;
|
||||||
private MapleParty party;
|
private MapleParty party;
|
||||||
private Pet[] pets = new Pet[3];
|
private final Pet[] pets = new Pet[3];
|
||||||
private MaplePlayerShop playerShop = null;
|
private MaplePlayerShop playerShop = null;
|
||||||
private MapleShop shop = null;
|
private MapleShop shop = null;
|
||||||
private MapleSkinColor skinColor = MapleSkinColor.NORMAL;
|
private MapleSkinColor skinColor = MapleSkinColor.NORMAL;
|
||||||
@@ -170,28 +170,28 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
private MapleTrade trade = null;
|
private MapleTrade trade = null;
|
||||||
private MonsterBook monsterbook;
|
private MonsterBook monsterbook;
|
||||||
private CashShop cashshop;
|
private CashShop cashshop;
|
||||||
private Set<NewYearCardRecord> newyears = new LinkedHashSet<>();
|
private final Set<NewYearCardRecord> newyears = new LinkedHashSet<>();
|
||||||
private SavedLocation savedLocations[];
|
private final SavedLocation[] savedLocations;
|
||||||
private SkillMacro[] skillMacros = new SkillMacro[5];
|
private final SkillMacro[] skillMacros = new SkillMacro[5];
|
||||||
private List<Integer> lastmonthfameids;
|
private List<Integer> lastmonthfameids;
|
||||||
private List<WeakReference<MapleMap>> lastVisitedMaps = new LinkedList<>();
|
private final List<WeakReference<MapleMap>> lastVisitedMaps = new LinkedList<>();
|
||||||
private WeakReference<MapleMap> ownedMap = new WeakReference<>(null);
|
private WeakReference<MapleMap> ownedMap = new WeakReference<>(null);
|
||||||
private final Map<Short, MapleQuestStatus> quests;
|
private final Map<Short, MapleQuestStatus> quests;
|
||||||
private Set<MapleMonster> controlled = new LinkedHashSet<>();
|
private final Set<MapleMonster> controlled = new LinkedHashSet<>();
|
||||||
private Map<Integer, String> entered = new LinkedHashMap<>();
|
private final Map<Integer, String> entered = new LinkedHashMap<>();
|
||||||
private Set<MapleMapObject> visibleMapObjects = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
private final Set<MapleMapObject> visibleMapObjects = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||||
private Map<Skill, SkillEntry> skills = new LinkedHashMap<>();
|
private final Map<Skill, SkillEntry> skills = new LinkedHashMap<>();
|
||||||
private Map<Integer, Integer> activeCoupons = new LinkedHashMap<>();
|
private final Map<Integer, Integer> activeCoupons = new LinkedHashMap<>();
|
||||||
private Map<Integer, Integer> activeCouponRates = new LinkedHashMap<>();
|
private final Map<Integer, Integer> activeCouponRates = new LinkedHashMap<>();
|
||||||
private EnumMap<BuffStat, MapleBuffStatValueHolder> effects = new EnumMap<>(BuffStat.class);
|
private final EnumMap<BuffStat, MapleBuffStatValueHolder> effects = new EnumMap<>(BuffStat.class);
|
||||||
private Map<BuffStat, Byte> buffEffectsCount = new LinkedHashMap<>();
|
private final Map<BuffStat, Byte> buffEffectsCount = new LinkedHashMap<>();
|
||||||
private Map<MapleDisease, Long> diseaseExpires = new LinkedHashMap<>();
|
private final Map<MapleDisease, Long> diseaseExpires = new LinkedHashMap<>();
|
||||||
private Map<Integer, Map<BuffStat, MapleBuffStatValueHolder>> buffEffects = new LinkedHashMap<>(); // non-overriding buffs thanks to Ronan
|
private final Map<Integer, Map<BuffStat, MapleBuffStatValueHolder>> buffEffects = new LinkedHashMap<>(); // non-overriding buffs thanks to Ronan
|
||||||
private Map<Integer, Long> buffExpires = new LinkedHashMap<>();
|
private final Map<Integer, Long> buffExpires = new LinkedHashMap<>();
|
||||||
private Map<Integer, KeyBinding> keymap = new LinkedHashMap<>();
|
private final Map<Integer, KeyBinding> keymap = new LinkedHashMap<>();
|
||||||
private Map<Integer, MapleSummon> summons = new LinkedHashMap<>();
|
private final Map<Integer, MapleSummon> summons = new LinkedHashMap<>();
|
||||||
private Map<Integer, MapleCoolDownValueHolder> coolDowns = new LinkedHashMap<>();
|
private final Map<Integer, MapleCoolDownValueHolder> coolDowns = new LinkedHashMap<>();
|
||||||
private EnumMap<MapleDisease, Pair<MapleDiseaseValueHolder, MobSkill>> diseases = new EnumMap<>(MapleDisease.class);
|
private final EnumMap<MapleDisease, Pair<MapleDiseaseValueHolder, MobSkill>> diseases = new EnumMap<>(MapleDisease.class);
|
||||||
private byte[] m_aQuickslotLoaded;
|
private byte[] m_aQuickslotLoaded;
|
||||||
private QuickslotBinding m_pQuickslotKeyMapped;
|
private QuickslotBinding m_pQuickslotKeyMapped;
|
||||||
private MapleDoor pdoor = null;
|
private MapleDoor pdoor = null;
|
||||||
@@ -209,36 +209,36 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
private ScheduledFuture<?> chairRecoveryTask = null;
|
private ScheduledFuture<?> chairRecoveryTask = null;
|
||||||
private ScheduledFuture<?> pendantOfSpirit = null; //1122017
|
private ScheduledFuture<?> pendantOfSpirit = null; //1122017
|
||||||
private ScheduledFuture<?> cpqSchedule = null;
|
private ScheduledFuture<?> cpqSchedule = null;
|
||||||
private Lock chrLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_CHR, true);
|
private final Lock chrLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_CHR, true);
|
||||||
private Lock evtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_EVT, true);
|
private final Lock evtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_EVT, true);
|
||||||
private Lock petLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PET, true);
|
private final Lock petLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PET, true);
|
||||||
private Lock prtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PRT);
|
private final Lock prtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PRT);
|
||||||
private Lock cpnLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_CPN);
|
private final Lock cpnLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_CPN);
|
||||||
private Map<Integer, Set<Integer>> excluded = new LinkedHashMap<>();
|
private final Map<Integer, Set<Integer>> excluded = new LinkedHashMap<>();
|
||||||
private Set<Integer> excludedItems = new LinkedHashSet<>();
|
private final Set<Integer> excludedItems = new LinkedHashSet<>();
|
||||||
private Set<Integer> disabledPartySearchInvites = new LinkedHashSet<>();
|
private final Set<Integer> disabledPartySearchInvites = new LinkedHashSet<>();
|
||||||
private static String[] ariantroomleader = new String[3];
|
private static final String[] ariantroomleader = new String[3];
|
||||||
private static int[] ariantroomslot = new int[3];
|
private static final int[] ariantroomslot = new int[3];
|
||||||
private long portaldelay = 0, lastcombo = 0;
|
private long portaldelay = 0, lastcombo = 0;
|
||||||
private short combocounter = 0;
|
private short combocounter = 0;
|
||||||
private List<String> blockedPortals = new ArrayList<>();
|
private final List<String> blockedPortals = new ArrayList<>();
|
||||||
private Map<Short, String> area_info = new LinkedHashMap<>();
|
private final Map<Short, String> area_info = new LinkedHashMap<>();
|
||||||
private AutobanManager autoban;
|
private AutobanManager autoban;
|
||||||
private boolean isbanned = false;
|
private boolean isbanned = false;
|
||||||
private boolean blockCashShop = false;
|
private boolean blockCashShop = false;
|
||||||
private boolean allowExpGain = true;
|
private boolean allowExpGain = true;
|
||||||
private byte pendantExp = 0, lastmobcount = 0, doorSlot = -1;
|
private byte pendantExp = 0, lastmobcount = 0, doorSlot = -1;
|
||||||
private List<Integer> trockmaps = new ArrayList<>();
|
private final List<Integer> trockmaps = new ArrayList<>();
|
||||||
private List<Integer> viptrockmaps = new ArrayList<>();
|
private final List<Integer> viptrockmaps = new ArrayList<>();
|
||||||
private Map<String, MapleEvents> events = new LinkedHashMap<>();
|
private Map<String, MapleEvents> events = new LinkedHashMap<>();
|
||||||
private PartyQuest partyQuest = null;
|
private PartyQuest partyQuest = null;
|
||||||
private List<Pair<DelayedQuestUpdate, Object[]>> npcUpdateQuests = new LinkedList<>();
|
private final List<Pair<DelayedQuestUpdate, Object[]>> npcUpdateQuests = new LinkedList<>();
|
||||||
private MapleDragon dragon = null;
|
private MapleDragon dragon = null;
|
||||||
private MapleRing marriageRing;
|
private MapleRing marriageRing;
|
||||||
private int marriageItemid = -1;
|
private int marriageItemid = -1;
|
||||||
private int partnerId = -1;
|
private int partnerId = -1;
|
||||||
private List<MapleRing> crushRings = new ArrayList<>();
|
private final List<MapleRing> crushRings = new ArrayList<>();
|
||||||
private List<MapleRing> friendshipRings = new ArrayList<>();
|
private final List<MapleRing> friendshipRings = new ArrayList<>();
|
||||||
private boolean loggedIn = false;
|
private boolean loggedIn = false;
|
||||||
private boolean useCS; //chaos scroll upon crafting item.
|
private boolean useCS; //chaos scroll upon crafting item.
|
||||||
private long npcCd;
|
private long npcCd;
|
||||||
@@ -259,7 +259,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
private long loginTime;
|
private long loginTime;
|
||||||
private boolean chasing = false;
|
private boolean chasing = false;
|
||||||
|
|
||||||
private MapleCharacter() {
|
private Character() {
|
||||||
super.setListener(new AbstractCharacterListener() {
|
super.setListener(new AbstractCharacterListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onHpChanged(int oldHp) {
|
public void onHpChanged(int oldHp) {
|
||||||
@@ -296,7 +296,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
statup.add(new Pair<>(s.getKey(), s.getValue()));
|
statup.add(new Pair<>(s.getKey(), s.getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(PacketCreator.updatePlayerStats(statup, true, MapleCharacter.this));
|
sendPacket(PacketCreator.updatePlayerStats(statup, true, Character.this));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (type == InventoryType.CASH) {
|
if (type == InventoryType.CASH) {
|
||||||
b = 96;
|
b = 96;
|
||||||
}
|
}
|
||||||
inventory[type.ordinal()] = new Inventory(this, type, (byte) b);
|
inventory[type.ordinal()] = new Inventory(this, type, b);
|
||||||
}
|
}
|
||||||
inventory[InventoryType.CANHOLD.ordinal()] = new InventoryProof(this);
|
inventory[InventoryType.CANHOLD.ordinal()] = new InventoryProof(this);
|
||||||
|
|
||||||
@@ -356,8 +356,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
return getJobStyle((byte) ((this.getStr() > this.getDex()) ? 0x80 : 0x40));
|
return getJobStyle((byte) ((this.getStr() > this.getDex()) ? 0x80 : 0x40));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MapleCharacter getDefault(MapleClient c) {
|
public static Character getDefault(MapleClient c) {
|
||||||
MapleCharacter ret = new MapleCharacter();
|
Character ret = new Character();
|
||||||
ret.client = c;
|
ret.client = c;
|
||||||
ret.setGMLevel(0);
|
ret.setGMLevel(0);
|
||||||
ret.hp = 50;
|
ret.hp = 50;
|
||||||
@@ -579,9 +579,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
String prop = eim.getProperty("groomId");
|
String prop = eim.getProperty("groomId");
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
if((Integer.parseInt(prop) == id || eim.getIntProperty("brideId") == id) && (mapid == 680000110 || mapid == 680000210)) {
|
return (Integer.parseInt(prop) == id || eim.getIntProperty("brideId") == id) && (mapid == 680000110 || mapid == 680000210);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -924,7 +922,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
hasSandboxItem = false;
|
hasSandboxItem = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FameStatus canGiveFame(MapleCharacter from) {
|
public FameStatus canGiveFame(Character from) {
|
||||||
if (this.isGM()) {
|
if (this.isGM()) {
|
||||||
return FameStatus.OK;
|
return FameStatus.OK;
|
||||||
} else if (lastfametime >= System.currentTimeMillis() - 3600000 * 24) {
|
} else if (lastfametime >= System.currentTimeMillis() - 3600000 * 24) {
|
||||||
@@ -1020,7 +1018,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void broadcastChangeJob() {
|
private void broadcastChangeJob() {
|
||||||
for (MapleCharacter chr : map.getAllPlayers()) {
|
for (Character chr : map.getAllPlayers()) {
|
||||||
MapleClient chrC = chr.getClient();
|
MapleClient chrC = chr.getClient();
|
||||||
|
|
||||||
if (chrC != null) { // propagate new job 3rd-person effects (FJ, Aran 1st strike, etc)
|
if (chrC != null) { // propagate new job 3rd-person effects (FJ, Aran 1st strike, etc)
|
||||||
@@ -1032,7 +1030,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
TimerManager.getInstance().schedule(new Runnable() { // need to delay to ensure clientside has finished reloading character data
|
TimerManager.getInstance().schedule(new Runnable() { // need to delay to ensure clientside has finished reloading character data
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
MapleCharacter thisChr = MapleCharacter.this;
|
Character thisChr = Character.this;
|
||||||
MapleMap map = thisChr.getMap();
|
MapleMap map = thisChr.getMap();
|
||||||
|
|
||||||
if (map != null) {
|
if (map != null) {
|
||||||
@@ -1443,11 +1441,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
if (value == 1 && ((returnMapid == 211000000 && thisMapid != 200082300) || returnMapid == 193000000)) {
|
if (value == 1 && ((returnMapid == 211000000 && thisMapid != 200082300) || returnMapid == 193000000)) {
|
||||||
return true; //protection from cold
|
return true; //protection from cold
|
||||||
} else if(value == 2 && (returnMapid == 230000000 || thisMapid == 200082300)) {
|
} else return value == 2 && (returnMapid == 230000000 || thisMapid == 200082300); //breathing underwater
|
||||||
return true; //breathing underwater
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -1483,7 +1477,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
return lastVisited;
|
return lastVisited;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void partyOperationUpdate(MapleParty party, List<MapleCharacter> exPartyMembers) {
|
public void partyOperationUpdate(MapleParty party, List<Character> exPartyMembers) {
|
||||||
List<WeakReference<MapleMap>> mapids;
|
List<WeakReference<MapleMap>> mapids;
|
||||||
|
|
||||||
petLock.lock();
|
petLock.lock();
|
||||||
@@ -1493,14 +1487,14 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
petLock.unlock();
|
petLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<MapleCharacter> partyMembers = new LinkedList<>();
|
List<Character> partyMembers = new LinkedList<>();
|
||||||
for(MapleCharacter mc : (exPartyMembers != null) ? exPartyMembers : this.getPartyMembersOnline()) {
|
for (Character mc : (exPartyMembers != null) ? exPartyMembers : this.getPartyMembersOnline()) {
|
||||||
if (mc.isLoggedinWorld()) {
|
if (mc.isLoggedinWorld()) {
|
||||||
partyMembers.add(mc);
|
partyMembers.add(mc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter partyLeaver = null;
|
Character partyLeaver = null;
|
||||||
if (exPartyMembers != null) {
|
if (exPartyMembers != null) {
|
||||||
partyMembers.remove(this);
|
partyMembers.remove(this);
|
||||||
partyLeaver = this;
|
partyLeaver = this;
|
||||||
@@ -1528,18 +1522,18 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
updatePartyTownDoors(party, this, partyLeaver, partyMembers);
|
updatePartyTownDoors(party, this, partyLeaver, partyMembers);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addPartyPlayerDoor(MapleCharacter target) {
|
private static void addPartyPlayerDoor(Character target) {
|
||||||
MapleDoor targetDoor = target.getPlayerDoor();
|
MapleDoor targetDoor = target.getPlayerDoor();
|
||||||
if (targetDoor != null) {
|
if (targetDoor != null) {
|
||||||
target.applyPartyDoor(targetDoor, true);
|
target.applyPartyDoor(targetDoor, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void removePartyPlayerDoor(MapleParty party, MapleCharacter target) {
|
private static void removePartyPlayerDoor(MapleParty party, Character target) {
|
||||||
target.removePartyDoor(party);
|
target.removePartyDoor(party);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void updatePartyTownDoors(MapleParty party, MapleCharacter target, MapleCharacter partyLeaver, List<MapleCharacter> partyMembers) {
|
private static void updatePartyTownDoors(MapleParty party, Character target, Character partyLeaver, List<Character> partyMembers) {
|
||||||
if (partyLeaver != null) {
|
if (partyLeaver != null) {
|
||||||
removePartyPlayerDoor(party, target);
|
removePartyPlayerDoor(party, target);
|
||||||
} else {
|
} else {
|
||||||
@@ -1550,7 +1544,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (!partyMembers.isEmpty()) {
|
if (!partyMembers.isEmpty()) {
|
||||||
partyDoors = party.getDoors();
|
partyDoors = party.getDoors();
|
||||||
|
|
||||||
for(MapleCharacter pchr : partyMembers) {
|
for (Character pchr : partyMembers) {
|
||||||
MapleDoor door = partyDoors.get(pchr.getId());
|
MapleDoor door = partyDoors.get(pchr.getId());
|
||||||
if (door != null) {
|
if (door != null) {
|
||||||
door.updateDoorPortal(pchr);
|
door.updateDoorPortal(pchr);
|
||||||
@@ -1558,7 +1552,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (MapleDoor door : partyDoors.values()) {
|
for (MapleDoor door : partyDoors.values()) {
|
||||||
for(MapleCharacter pchar : partyMembers) {
|
for (Character pchar : partyMembers) {
|
||||||
MapleDoorObject mdo = door.getTownDoor();
|
MapleDoorObject mdo = door.getTownDoor();
|
||||||
mdo.sendDestroyData(pchar.getClient(), true);
|
mdo.sendDestroyData(pchar.getClient(), true);
|
||||||
pchar.removeVisibleMapObject(mdo);
|
pchar.removeVisibleMapObject(mdo);
|
||||||
@@ -1568,7 +1562,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (partyLeaver != null) {
|
if (partyLeaver != null) {
|
||||||
Collection<MapleDoor> leaverDoors = partyLeaver.getDoors();
|
Collection<MapleDoor> leaverDoors = partyLeaver.getDoors();
|
||||||
for (MapleDoor door : leaverDoors) {
|
for (MapleDoor door : leaverDoors) {
|
||||||
for(MapleCharacter pchar : partyMembers) {
|
for (Character pchar : partyMembers) {
|
||||||
MapleDoorObject mdo = door.getTownDoor();
|
MapleDoorObject mdo = door.getTownDoor();
|
||||||
mdo.sendDestroyData(pchar.getClient(), true);
|
mdo.sendDestroyData(pchar.getClient(), true);
|
||||||
pchar.removeVisibleMapObject(mdo);
|
pchar.removeVisibleMapObject(mdo);
|
||||||
@@ -1581,7 +1575,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
MapleDoor door = partyDoors.get(chrid);
|
MapleDoor door = partyDoors.get(chrid);
|
||||||
|
|
||||||
if (door != null) {
|
if (door != null) {
|
||||||
for(MapleCharacter pchar : partyMembers) {
|
for (Character pchar : partyMembers) {
|
||||||
MapleDoorObject mdo = door.getTownDoor();
|
MapleDoorObject mdo = door.getTownDoor();
|
||||||
mdo.sendSpawnData(pchar.getClient());
|
mdo.sendSpawnData(pchar.getClient());
|
||||||
pchar.addVisibleMapObject(mdo);
|
pchar.addVisibleMapObject(mdo);
|
||||||
@@ -1662,7 +1656,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
public void notifyMapTransferToPartner(int mapid) {
|
public void notifyMapTransferToPartner(int mapid) {
|
||||||
if (partnerId > 0) {
|
if (partnerId > 0) {
|
||||||
final MapleCharacter partner = getWorldServer().getPlayerStorage().getCharacterById(partnerId);
|
final Character partner = getWorldServer().getPlayerStorage().getCharacterById(partnerId);
|
||||||
if (partner != null && !partner.isAwayFromWorld()) {
|
if (partner != null && !partner.isAwayFromWorld()) {
|
||||||
partner.sendPacket(WeddingPackets.OnNotifyWeddingPartnerTransfer(id, mapid));
|
partner.sendPacket(WeddingPackets.OnNotifyWeddingPartnerTransfer(id, mapid));
|
||||||
}
|
}
|
||||||
@@ -1709,8 +1703,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
} finally {
|
} finally {
|
||||||
prtLock.unlock();
|
prtLock.unlock();
|
||||||
}
|
}
|
||||||
if (MapleCharacter.this.getParty() != null) {
|
if (Character.this.getParty() != null) {
|
||||||
MapleCharacter.this.getParty().setEnemy(k);
|
Character.this.getParty().setEnemy(k);
|
||||||
}
|
}
|
||||||
silentPartyUpdateInternal(getParty()); // EIM script calls inside
|
silentPartyUpdateInternal(getParty()); // EIM script calls inside
|
||||||
|
|
||||||
@@ -1788,7 +1782,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (berserkSchedule != null) {
|
if (berserkSchedule != null) {
|
||||||
berserkSchedule.cancel(false);
|
berserkSchedule.cancel(false);
|
||||||
}
|
}
|
||||||
final MapleCharacter chr = this;
|
final Character chr = this;
|
||||||
if (job.equals(MapleJob.DARKKNIGHT)) {
|
if (job.equals(MapleJob.DARKKNIGHT)) {
|
||||||
Skill BerserkX = SkillFactory.getSkill(DarkKnight.BERSERK);
|
Skill BerserkX = SkillFactory.getSkill(DarkKnight.BERSERK);
|
||||||
final int skilllevel = getSkillLevel(BerserkX);
|
final int skilllevel = getSkillLevel(BerserkX);
|
||||||
@@ -1803,9 +1797,9 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
sendPacket(PacketCreator.showOwnBerserk(skilllevel, berserk));
|
sendPacket(PacketCreator.showOwnBerserk(skilllevel, berserk));
|
||||||
if (!isHidden) {
|
if (!isHidden) {
|
||||||
getMap().broadcastMessage(MapleCharacter.this, PacketCreator.showBerserk(getId(), skilllevel, berserk), false);
|
getMap().broadcastMessage(Character.this, PacketCreator.showBerserk(getId(), skilllevel, berserk), false);
|
||||||
} else {
|
} else {
|
||||||
getMap().broadcastGMMessage(MapleCharacter.this, PacketCreator.showBerserk(getId(), skilllevel, berserk), false);
|
getMap().broadcastGMMessage(Character.this, PacketCreator.showBerserk(getId(), skilllevel, berserk), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 5000, 3000);
|
}, 5000, 3000);
|
||||||
@@ -1879,13 +1873,13 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (itemid / 1000000 == 2) {
|
if (itemid / 1000000 == 2) {
|
||||||
if (ii.isConsumeOnPickup(itemid)) {
|
if (ii.isConsumeOnPickup(itemid)) {
|
||||||
if (ItemConstants.isPartyItem(itemid)) {
|
if (ItemConstants.isPartyItem(itemid)) {
|
||||||
List<MapleCharacter> pchr = this.getPartyMembersOnSameMap();
|
List<Character> pchr = this.getPartyMembersOnSameMap();
|
||||||
|
|
||||||
if (!ItemConstants.isPartyAllcure(itemid)) {
|
if (!ItemConstants.isPartyAllcure(itemid)) {
|
||||||
MapleStatEffect mse = ii.getItemEffect(itemid);
|
MapleStatEffect mse = ii.getItemEffect(itemid);
|
||||||
|
|
||||||
if (!pchr.isEmpty()) {
|
if (!pchr.isEmpty()) {
|
||||||
for (MapleCharacter mc : pchr) {
|
for (Character mc : pchr) {
|
||||||
mse.applyTo(mc);
|
mse.applyTo(mc);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1893,7 +1887,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!pchr.isEmpty()) {
|
if (!pchr.isEmpty()) {
|
||||||
for (MapleCharacter mc : pchr) {
|
for (Character mc : pchr) {
|
||||||
mc.dispelDebuffs();
|
mc.dispelDebuffs();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1929,7 +1923,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<MapleCharacter> mpcs = new LinkedList<>();
|
List<Character> mpcs = new LinkedList<>();
|
||||||
if (mapitem.getMeso() > 0 && !mapitem.isPickedUp()) {
|
if (mapitem.getMeso() > 0 && !mapitem.isPickedUp()) {
|
||||||
mpcs = getPartyMembersOnSameMap();
|
mpcs = getPartyMembersOnSameMap();
|
||||||
}
|
}
|
||||||
@@ -1956,7 +1950,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (mapitem.getMeso() > 0) {
|
if (mapitem.getMeso() > 0) {
|
||||||
if (!mpcs.isEmpty()) {
|
if (!mpcs.isEmpty()) {
|
||||||
int mesosamm = mapitem.getMeso() / mpcs.size();
|
int mesosamm = mapitem.getMeso() / mpcs.size();
|
||||||
for (MapleCharacter partymem : mpcs) {
|
for (Character partymem : mpcs) {
|
||||||
if (partymem.isLoggedinWorld()) {
|
if (partymem.isLoggedinWorld()) {
|
||||||
partymem.gainMeso(mesosamm, true, true, false);
|
partymem.gainMeso(mesosamm, true, true, false);
|
||||||
}
|
}
|
||||||
@@ -1998,7 +1992,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (mapitem.getMeso() > 0) {
|
if (mapitem.getMeso() > 0) {
|
||||||
if (!mpcs.isEmpty()) {
|
if (!mpcs.isEmpty()) {
|
||||||
int mesosamm = mapitem.getMeso() / mpcs.size();
|
int mesosamm = mapitem.getMeso() / mpcs.size();
|
||||||
for (MapleCharacter partymem : mpcs) {
|
for (Character partymem : mpcs) {
|
||||||
if (partymem.isLoggedinWorld()) {
|
if (partymem.isLoggedinWorld()) {
|
||||||
partymem.gainMeso(mesosamm, true, true, false);
|
partymem.gainMeso(mesosamm, true, true, false);
|
||||||
}
|
}
|
||||||
@@ -2086,7 +2080,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
Skill battleship = SkillFactory.getSkill(Corsair.BATTLE_SHIP);
|
Skill battleship = SkillFactory.getSkill(Corsair.BATTLE_SHIP);
|
||||||
int cooldown = battleship.getEffect(getSkillLevel(battleship)).getCooldown();
|
int cooldown = battleship.getEffect(getSkillLevel(battleship)).getCooldown();
|
||||||
sendPacket(PacketCreator.skillCooldown(Corsair.BATTLE_SHIP, cooldown));
|
sendPacket(PacketCreator.skillCooldown(Corsair.BATTLE_SHIP, cooldown));
|
||||||
addCooldown(Corsair.BATTLE_SHIP, Server.getInstance().getCurrentTime(), (long)(cooldown * 1000));
|
addCooldown(Corsair.BATTLE_SHIP, Server.getInstance().getCurrentTime(), cooldown * 1000);
|
||||||
removeCooldown(5221999);
|
removeCooldown(5221999);
|
||||||
cancelEffectFromBuffStat(BuffStat.MONSTER_RIDING);
|
cancelEffectFromBuffStat(BuffStat.MONSTER_RIDING);
|
||||||
} else {
|
} else {
|
||||||
@@ -2122,7 +2116,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void notifyRemoteChannel(MapleClient c, int remoteChannel, int otherCid, BuddyList.BuddyOperation operation) {
|
private void notifyRemoteChannel(MapleClient c, int remoteChannel, int otherCid, BuddyList.BuddyOperation operation) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (remoteChannel != -1) {
|
if (remoteChannel != -1) {
|
||||||
c.getWorldServer().buddyChanged(otherCid, player.getId(), player.getName(), c.getChannel(), operation);
|
c.getWorldServer().buddyChanged(otherCid, player.getId(), player.getName(), c.getChannel(), operation);
|
||||||
}
|
}
|
||||||
@@ -2139,7 +2133,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
nextPendingRequest(client);
|
nextPendingRequest(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean deleteCharFromDB(MapleCharacter player, int senderAccId) {
|
public static boolean deleteCharFromDB(Character player, int senderAccId) {
|
||||||
int cid = player.getId();
|
int cid = player.getId();
|
||||||
if (!Server.getInstance().haveCharacterEntry(senderAccId, cid)) { // thanks zera (EpiphanyMS) for pointing a critical exploit with non-authed character deletion request
|
if (!Server.getInstance().haveCharacterEntry(senderAccId, cid)) { // thanks zera (EpiphanyMS) for pointing a critical exploit with non-authed character deletion request
|
||||||
return false;
|
return false;
|
||||||
@@ -2164,7 +2158,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
try (ResultSet rs = ps.executeQuery()) {
|
try (ResultSet rs = ps.executeQuery()) {
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
int buddyid = rs.getInt("buddyid");
|
int buddyid = rs.getInt("buddyid");
|
||||||
MapleCharacter buddy = Server.getInstance().getWorld(world).getPlayerStorage().getCharacterById(buddyid);
|
Character buddy = Server.getInstance().getWorld(world).getPlayerStorage().getCharacterById(buddyid);
|
||||||
|
|
||||||
if (buddy != null) {
|
if (buddy != null) {
|
||||||
buddy.deleteBuddy(cid);
|
buddy.deleteBuddy(cid);
|
||||||
@@ -2317,7 +2311,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
String[] toDel = {"famelog", "inventoryitems", "keymap", "queststatus", "savedlocations", "trocklocations", "skillmacros", "skills", "eventstats", "server_queue"};
|
String[] toDel = {"famelog", "inventoryitems", "keymap", "queststatus", "savedlocations", "trocklocations", "skillmacros", "skills", "eventstats", "server_queue"};
|
||||||
for (String s : toDel) {
|
for (String s : toDel) {
|
||||||
MapleCharacter.deleteWhereCharacterId(con, "DELETE FROM `" + s + "` WHERE characterid = ?", cid);
|
Character.deleteWhereCharacterId(con, "DELETE FROM `" + s + "` WHERE characterid = ?", cid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Server.getInstance().deleteCharacterEntry(accId, cid);
|
Server.getInstance().deleteCharacterEntry(accId, cid);
|
||||||
@@ -2457,12 +2451,12 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
final int healHP = localchairhp;
|
final int healHP = localchairhp;
|
||||||
final int healMP = localchairmp;
|
final int healMP = localchairmp;
|
||||||
|
|
||||||
if(MapleCharacter.this.getHp() < localmaxhp) {
|
if (Character.this.getHp() < localmaxhp) {
|
||||||
byte recHP = (byte) (healHP / YamlConfig.config.server.CHAIR_EXTRA_HEAL_MULTIPLIER);
|
byte recHP = (byte) (healHP / YamlConfig.config.server.CHAIR_EXTRA_HEAL_MULTIPLIER);
|
||||||
|
|
||||||
sendPacket(PacketCreator.showOwnRecovery(recHP));
|
sendPacket(PacketCreator.showOwnRecovery(recHP));
|
||||||
getMap().broadcastMessage(MapleCharacter.this, PacketCreator.showRecovery(id, recHP), false);
|
getMap().broadcastMessage(Character.this, PacketCreator.showRecovery(id, recHP), false);
|
||||||
} else if (MapleCharacter.this.getMp() >= localmaxmp) {
|
} else if (Character.this.getMp() >= localmaxmp) {
|
||||||
stopChairTask(); // optimizing schedule management when player is already with full pool.
|
stopChairTask(); // optimizing schedule management when player is already with full pool.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2506,10 +2500,10 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(MapleCharacter.this.getHp() < localmaxhp) {
|
if (Character.this.getHp() < localmaxhp) {
|
||||||
if (healHP > 0) {
|
if (healHP > 0) {
|
||||||
sendPacket(PacketCreator.showOwnRecovery(healHP));
|
sendPacket(PacketCreator.showOwnRecovery(healHP));
|
||||||
getMap().broadcastMessage(MapleCharacter.this, PacketCreator.showRecovery(id, healHP), false);
|
getMap().broadcastMessage(Character.this, PacketCreator.showRecovery(id, healHP), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2624,7 +2618,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void collectDiseases() {
|
public void collectDiseases() {
|
||||||
for (MapleCharacter chr : map.getAllPlayers()) {
|
for (Character chr : map.getAllPlayers()) {
|
||||||
int cid = chr.getId();
|
int cid = chr.getId();
|
||||||
|
|
||||||
for (Entry<MapleDisease, Pair<Long, MobSkill>> di : chr.getAllDiseases().entrySet()) {
|
for (Entry<MapleDisease, Pair<Long, MobSkill>> di : chr.getAllDiseases().entrySet()) {
|
||||||
@@ -3073,7 +3067,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
int equip = (int) Math.min((long) (gain / 10) * pendantExp, Integer.MAX_VALUE);
|
int equip = (int) Math.min((long) (gain / 10) * pendantExp, Integer.MAX_VALUE);
|
||||||
|
|
||||||
gainExpInternal((long) gain, equip, party, show, inChat, white);
|
gainExpInternal(gain, equip, party, show, inChat, white);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loseExp(int loss, boolean show, boolean inChat) {
|
public void loseExp(int loss, boolean show, boolean inChat) {
|
||||||
@@ -3152,7 +3146,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
gainFame(delta, null, 0);
|
gainFame(delta, null, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean gainFame(int delta, MapleCharacter fromPlayer, int mode) {
|
public boolean gainFame(int delta, Character fromPlayer, int mode) {
|
||||||
Pair<Integer, Integer> fameRes = applyFame(delta);
|
Pair<Integer, Integer> fameRes = applyFame(delta);
|
||||||
delta = fameRes.getRight();
|
delta = fameRes.getRight();
|
||||||
if (delta != 0) {
|
if (delta != 0) {
|
||||||
@@ -3801,7 +3795,9 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isUpdatingEffect(Set<MapleStatEffect> activeEffects, MapleStatEffect mse) {
|
private boolean isUpdatingEffect(Set<MapleStatEffect> activeEffects, MapleStatEffect mse) {
|
||||||
if (mse == null) return false;
|
if (mse == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// thanks xinyifly for noticing "Speed Infusion" crashing game when updating buffs during map transition
|
// thanks xinyifly for noticing "Speed Infusion" crashing game when updating buffs during map transition
|
||||||
boolean active = mse.isActive(this);
|
boolean active = mse.isActive(this);
|
||||||
@@ -4122,7 +4118,9 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
List<MapleStatEffect> buffList = new LinkedList<>();
|
List<MapleStatEffect> buffList = new LinkedList<>();
|
||||||
while (true) {
|
while (true) {
|
||||||
Map<MapleStatEffect, Integer> leafStatCount = topologicalSortLeafStatCount(buffStack);
|
Map<MapleStatEffect, Integer> leafStatCount = topologicalSortLeafStatCount(buffStack);
|
||||||
if (leafStatCount.isEmpty()) break;
|
if (leafStatCount.isEmpty()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
List<MapleStatEffect> clearedNodes = topologicalSortRemoveLeafStats(stackedBuffStats, buffStack, leafStatCount);
|
List<MapleStatEffect> clearedNodes = topologicalSortRemoveLeafStats(stackedBuffStats, buffStack, leafStatCount);
|
||||||
if (clearedNodes.isEmpty()) {
|
if (clearedNodes.isEmpty()) {
|
||||||
@@ -4156,8 +4154,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
Comparator cmp = new Comparator<Pair<MapleStatEffect, Integer>>() {
|
Comparator cmp = new Comparator<Pair<MapleStatEffect, Integer>>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(Pair<MapleStatEffect, Integer> o1, Pair<MapleStatEffect, Integer> o2)
|
public int compare(Pair<MapleStatEffect, Integer> o1, Pair<MapleStatEffect, Integer> o2) {
|
||||||
{
|
|
||||||
return o2.getRight().compareTo(o1.getRight());
|
return o2.getRight().compareTo(o1.getRight());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -4220,7 +4217,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
retrievedEffects.put(mbsvh.effect.getBuffSourceId(), new Pair<>(mbsvh.effect, mbsvh.startTime));
|
retrievedEffects.put(mbsvh.effect.getBuffSourceId(), new Pair<>(mbsvh.effect, mbsvh.startTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
maxBuffValue.put(mbs, new Pair<>(Integer.MIN_VALUE, (MapleStatEffect) null));
|
maxBuffValue.put(mbs, new Pair<>(Integer.MIN_VALUE, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<MapleStatEffect, Integer> updateEffects = new LinkedHashMap<>();
|
Map<MapleStatEffect, Integer> updateEffects = new LinkedHashMap<>();
|
||||||
@@ -4405,8 +4402,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
addHP(healEffect.getHp());
|
addHP(healEffect.getHp());
|
||||||
sendPacket(PacketCreator.showOwnBuffEffect(beholder, 2));
|
sendPacket(PacketCreator.showOwnBuffEffect(beholder, 2));
|
||||||
getMap().broadcastMessage(MapleCharacter.this, PacketCreator.summonSkill(getId(), beholder, 5), true);
|
getMap().broadcastMessage(Character.this, PacketCreator.summonSkill(getId(), beholder, 5), true);
|
||||||
getMap().broadcastMessage(MapleCharacter.this, PacketCreator.showOwnBuffEffect(beholder, 2), false);
|
getMap().broadcastMessage(Character.this, PacketCreator.showOwnBuffEffect(beholder, 2), false);
|
||||||
}
|
}
|
||||||
}, healInterval, healInterval);
|
}, healInterval, healInterval);
|
||||||
}
|
}
|
||||||
@@ -4421,10 +4418,10 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffEffect.applyTo(MapleCharacter.this);
|
buffEffect.applyTo(Character.this);
|
||||||
sendPacket(PacketCreator.showOwnBuffEffect(beholder, 2));
|
sendPacket(PacketCreator.showOwnBuffEffect(beholder, 2));
|
||||||
getMap().broadcastMessage(MapleCharacter.this, PacketCreator.summonSkill(getId(), beholder, (int) (Math.random() * 3) + 6), true);
|
getMap().broadcastMessage(Character.this, PacketCreator.summonSkill(getId(), beholder, (int) (Math.random() * 3) + 6), true);
|
||||||
getMap().broadcastMessage(MapleCharacter.this, PacketCreator.showBuffEffect(getId(), beholder, 2), false);
|
getMap().broadcastMessage(Character.this, PacketCreator.showBuffEffect(getId(), beholder, 2), false);
|
||||||
}
|
}
|
||||||
}, buffInterval, buffInterval);
|
}, buffInterval, buffInterval);
|
||||||
}
|
}
|
||||||
@@ -4457,7 +4454,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
addHP(heal);
|
addHP(heal);
|
||||||
sendPacket(PacketCreator.showOwnRecovery(heal));
|
sendPacket(PacketCreator.showOwnRecovery(heal));
|
||||||
getMap().broadcastMessage(MapleCharacter.this, PacketCreator.showRecovery(id, heal), false);
|
getMap().broadcastMessage(Character.this, PacketCreator.showRecovery(id, heal), false);
|
||||||
}
|
}
|
||||||
}, healInterval, healInterval);
|
}, healInterval, healInterval);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -4959,8 +4956,11 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MapleFamily getFamily() {
|
public MapleFamily getFamily() {
|
||||||
if(familyEntry != null) return familyEntry.getFamily();
|
if (familyEntry != null) {
|
||||||
else return null;
|
return familyEntry.getFamily();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapleFamilyEntry getFamilyEntry() {
|
public MapleFamilyEntry getFamilyEntry() {
|
||||||
@@ -4968,7 +4968,9 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setFamilyEntry(MapleFamilyEntry entry) {
|
public void setFamilyEntry(MapleFamilyEntry entry) {
|
||||||
if(entry != null) setFamilyId(entry.getFamily().getID());
|
if (entry != null) {
|
||||||
|
setFamilyId(entry.getFamily().getID());
|
||||||
|
}
|
||||||
this.familyEntry = entry;
|
this.familyEntry = entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5114,7 +5116,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean haveWeddingRing() {
|
public boolean haveWeddingRing() {
|
||||||
int rings[] = {1112806, 1112803, 1112807, 1112809};
|
int[] rings = {1112806, 1112803, 1112807, 1112809};
|
||||||
|
|
||||||
for (int ringid : rings) {
|
for (int ringid : rings) {
|
||||||
if (haveItemWithId(ringid, true)) {
|
if (haveItemWithId(ringid, true)) {
|
||||||
@@ -5274,7 +5276,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
elapsedDays = 100;
|
elapsedDays = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
long netMeso = (long) merchantmeso; // negative mesos issues found thanks to Flash, Vcoc
|
long netMeso = merchantmeso; // negative mesos issues found thanks to Flash, Vcoc
|
||||||
netMeso = (netMeso * (100 - elapsedDays)) / 100;
|
netMeso = (netMeso * (100 - elapsedDays)) / 100;
|
||||||
return (int) netMeso;
|
return (int) netMeso;
|
||||||
}
|
}
|
||||||
@@ -5429,14 +5431,14 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MapleCharacter> getPartyMembersOnline() {
|
public List<Character> getPartyMembersOnline() {
|
||||||
List<MapleCharacter> list = new LinkedList<>();
|
List<Character> list = new LinkedList<>();
|
||||||
|
|
||||||
prtLock.lock();
|
prtLock.lock();
|
||||||
try {
|
try {
|
||||||
if (party != null) {
|
if (party != null) {
|
||||||
for (MaplePartyCharacter mpc : party.getMembers()) {
|
for (MaplePartyCharacter mpc : party.getMembers()) {
|
||||||
MapleCharacter mc = mpc.getPlayer();
|
Character mc = mpc.getPlayer();
|
||||||
if (mc != null) {
|
if (mc != null) {
|
||||||
list.add(mc);
|
list.add(mc);
|
||||||
}
|
}
|
||||||
@@ -5449,15 +5451,15 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MapleCharacter> getPartyMembersOnSameMap() {
|
public List<Character> getPartyMembersOnSameMap() {
|
||||||
List<MapleCharacter> list = new LinkedList<>();
|
List<Character> list = new LinkedList<>();
|
||||||
int thisMapHash = this.getMap().hashCode();
|
int thisMapHash = this.getMap().hashCode();
|
||||||
|
|
||||||
prtLock.lock();
|
prtLock.lock();
|
||||||
try {
|
try {
|
||||||
if (party != null) {
|
if (party != null) {
|
||||||
for (MaplePartyCharacter mpc : party.getMembers()) {
|
for (MaplePartyCharacter mpc : party.getMembers()) {
|
||||||
MapleCharacter chr = mpc.getPlayer();
|
Character chr = mpc.getPlayer();
|
||||||
if (chr != null) {
|
if (chr != null) {
|
||||||
MapleMap chrMap = chr.getMap();
|
MapleMap chrMap = chr.getMap();
|
||||||
if (chrMap != null && chrMap.hashCode() == thisMapHash && chr.isLoggedinWorld()) {
|
if (chrMap != null && chrMap.hashCode() == thisMapHash && chr.isLoggedinWorld()) {
|
||||||
@@ -5473,7 +5475,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPartyMember(MapleCharacter chr) {
|
public boolean isPartyMember(Character chr) {
|
||||||
return isPartyMember(chr.getId());
|
return isPartyMember(chr.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5704,7 +5706,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
public final void setQuestAdd(final MapleQuest quest, final byte status, final String customData) {
|
public final void setQuestAdd(final MapleQuest quest, final byte status, final String customData) {
|
||||||
synchronized (quests) {
|
synchronized (quests) {
|
||||||
if (!quests.containsKey(quest.getId())) {
|
if (!quests.containsKey(quest.getId())) {
|
||||||
final MapleQuestStatus stat = new MapleQuestStatus(quest, MapleQuestStatus.Status.getById((int)status));
|
final MapleQuestStatus stat = new MapleQuestStatus(quest, MapleQuestStatus.Status.getById(status));
|
||||||
stat.setCustomData(customData);
|
stat.setCustomData(customData);
|
||||||
quests.put(quest.getId(), stat);
|
quests.put(quest.getId(), stat);
|
||||||
}
|
}
|
||||||
@@ -5963,7 +5965,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
if (energybar >= 10000 && energybar < 11000) {
|
if (energybar >= 10000 && energybar < 11000) {
|
||||||
energybar = 15000;
|
energybar = 15000;
|
||||||
final MapleCharacter chr = this;
|
final Character chr = this;
|
||||||
tMan.schedule(new Runnable() {
|
tMan.schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -6000,7 +6002,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
return script.equals(e);
|
return script.equals(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hasGivenFame(MapleCharacter to) {
|
public void hasGivenFame(Character to) {
|
||||||
lastfametime = System.currentTimeMillis();
|
lastfametime = System.currentTimeMillis();
|
||||||
lastmonthfameids.add(Integer.valueOf(to.getId()));
|
lastmonthfameids.add(Integer.valueOf(to.getId()));
|
||||||
try (Connection con = DatabaseConnection.getConnection();
|
try (Connection con = DatabaseConnection.getConnection();
|
||||||
@@ -6408,7 +6410,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
ThreadManager.getInstance().newTask(new Runnable() {
|
ThreadManager.getInstance().newTask(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(job), MapleCharacter.this);
|
MaplePlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(job), Character.this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -6498,8 +6500,10 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
familyEntry.giveReputationToSenior(YamlConfig.config.server.FAMILY_REP_PER_LEVELUP, true);
|
familyEntry.giveReputationToSenior(YamlConfig.config.server.FAMILY_REP_PER_LEVELUP, true);
|
||||||
MapleFamilyEntry senior = familyEntry.getSenior();
|
MapleFamilyEntry senior = familyEntry.getSenior();
|
||||||
if (senior != null) { //only send the message to direct senior
|
if (senior != null) { //only send the message to direct senior
|
||||||
MapleCharacter seniorChr = senior.getChr();
|
Character seniorChr = senior.getChr();
|
||||||
if(seniorChr != null) seniorChr.sendPacket(PacketCreator.levelUpMessage(1, level, getName()));
|
if (seniorChr != null) {
|
||||||
|
seniorChr.sendPacket(PacketCreator.levelUpMessage(1, level, getName()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6517,7 +6521,9 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (party != null) {
|
if (party != null) {
|
||||||
if(partyLeader) party.assignNewLeader(client);
|
if (partyLeader) {
|
||||||
|
party.assignNewLeader(client);
|
||||||
|
}
|
||||||
MapleParty.leaveParty(party, client);
|
MapleParty.leaveParty(party, client);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -6668,7 +6674,9 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
public void updateCouponRates() {
|
public void updateCouponRates() {
|
||||||
Inventory cashInv = this.getInventory(InventoryType.CASH);
|
Inventory cashInv = this.getInventory(InventoryType.CASH);
|
||||||
if (cashInv == null) return;
|
if (cashInv == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
effLock.lock();
|
effLock.lock();
|
||||||
chrLock.lock();
|
chrLock.lock();
|
||||||
@@ -6745,8 +6753,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
maxExpCouponId = couponId;
|
maxExpCouponId = couponId;
|
||||||
maxExpRate = getCouponMultiplier(couponId);
|
maxExpRate = getCouponMultiplier(couponId);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (maxDropRate < getCouponMultiplier(couponId)) {
|
if (maxDropRate < getCouponMultiplier(couponId)) {
|
||||||
maxDropCouponId = couponId;
|
maxDropCouponId = couponId;
|
||||||
maxDropRate = getCouponMultiplier(couponId);
|
maxDropRate = getCouponMultiplier(couponId);
|
||||||
@@ -6833,8 +6840,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MapleCharacter loadCharacterEntryFromDB(ResultSet rs, List<Item> equipped) {
|
public static Character loadCharacterEntryFromDB(ResultSet rs, List<Item> equipped) {
|
||||||
MapleCharacter ret = new MapleCharacter();
|
Character ret = new Character();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ret.accountid = rs.getInt("accountid");
|
ret.accountid = rs.getInt("accountid");
|
||||||
@@ -6884,8 +6891,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapleCharacter generateCharacterEntry() {
|
public Character generateCharacterEntry() {
|
||||||
MapleCharacter ret = new MapleCharacter();
|
Character ret = new Character();
|
||||||
|
|
||||||
ret.accountid = this.getAccountID();
|
ret.accountid = this.getAccountID();
|
||||||
ret.id = this.getId();
|
ret.id = this.getId();
|
||||||
@@ -6928,7 +6935,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadCharSkillPoints(String[] skillPoints) {
|
private void loadCharSkillPoints(String[] skillPoints) {
|
||||||
int sps[] = new int[skillPoints.length];
|
int[] sps = new int[skillPoints.length];
|
||||||
for (int i = 0; i < skillPoints.length; i++) {
|
for (int i = 0; i < skillPoints.length; i++) {
|
||||||
sps[i] = Integer.parseInt(skillPoints[i]);
|
sps[i] = Integer.parseInt(skillPoints[i]);
|
||||||
}
|
}
|
||||||
@@ -6944,8 +6951,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
updateRemainingSp(remainingSp, GameConstants.getSkillBook(job.getId()));
|
updateRemainingSp(remainingSp, GameConstants.getSkillBook(job.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MapleCharacter loadCharFromDB(final int charid, MapleClient client, boolean channelserver) throws SQLException {
|
public static Character loadCharFromDB(final int charid, MapleClient client, boolean channelserver) throws SQLException {
|
||||||
MapleCharacter ret = new MapleCharacter();
|
Character ret = new Character();
|
||||||
ret.client = client;
|
ret.client = client;
|
||||||
ret.id = charid;
|
ret.id = charid;
|
||||||
|
|
||||||
@@ -7529,7 +7536,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FilePrinter.printError(FilePrinter.EXCEPTION_CAUGHT, e, "MapleCharacter.mobKilled. CID: " + this.id + " last Quest Processed: " + lastQuestProcessed);
|
FilePrinter.printError(FilePrinter.EXCEPTION_CAUGHT, e, "Character.mobKilled. CID: " + this.id + " last Quest Processed: " + lastQuestProcessed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7686,7 +7693,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
addHP(-bloodEffect.getX());
|
addHP(-bloodEffect.getX());
|
||||||
sendPacket(PacketCreator.showOwnBuffEffect(bloodEffect.getSourceId(), 5));
|
sendPacket(PacketCreator.showOwnBuffEffect(bloodEffect.getSourceId(), 5));
|
||||||
getMap().broadcastMessage(MapleCharacter.this, PacketCreator.showBuffEffect(getId(), bloodEffect.getSourceId(), 5), false);
|
getMap().broadcastMessage(Character.this, PacketCreator.showBuffEffect(getId(), bloodEffect.getSourceId(), 5), false);
|
||||||
}
|
}
|
||||||
}, 4000, 4000);
|
}, 4000, 4000);
|
||||||
}
|
}
|
||||||
@@ -7927,7 +7934,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
prtLock.lock();
|
prtLock.lock();
|
||||||
try {
|
try {
|
||||||
if (party != null) {
|
if (party != null) {
|
||||||
for (MapleCharacter partychar : this.getPartyMembersOnSameMap()) {
|
for (Character partychar : this.getPartyMembersOnSameMap()) {
|
||||||
sendPacket(PacketCreator.updatePartyMemberHP(partychar.getId(), partychar.getHp(), partychar.getCurrentMaxHp()));
|
sendPacket(PacketCreator.updatePartyMemberHP(partychar.getId(), partychar.getHp(), partychar.getCurrentMaxHp()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7964,9 +7971,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
effLock.lock();
|
effLock.lock();
|
||||||
chrLock.lock();
|
chrLock.lock();
|
||||||
try {
|
try {
|
||||||
if (this.coolDowns.containsKey(skillId)) {
|
|
||||||
this.coolDowns.remove(skillId);
|
this.coolDowns.remove(skillId);
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
chrLock.unlock();
|
chrLock.unlock();
|
||||||
effLock.unlock();
|
effLock.unlock();
|
||||||
@@ -8343,9 +8348,9 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
Calendar c = Calendar.getInstance();
|
Calendar c = Calendar.getInstance();
|
||||||
|
|
||||||
if (notAutosave) {
|
if (notAutosave) {
|
||||||
FilePrinter.print(FilePrinter.SAVING_CHARACTER, "Attempting to save " + name + " at " + c.getTime().toString());
|
FilePrinter.print(FilePrinter.SAVING_CHARACTER, "Attempting to save " + name + " at " + c.getTime());
|
||||||
} else {
|
} else {
|
||||||
FilePrinter.print(FilePrinter.AUTOSAVING_CHARACTER, "Attempting to autosave " + name + " at " + c.getTime().toString());
|
FilePrinter.print(FilePrinter.AUTOSAVING_CHARACTER, "Attempting to autosave " + name + " at " + c.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
Server.getInstance().updateCharacterEntry(this);
|
Server.getInstance().updateCharacterEntry(this);
|
||||||
@@ -9179,7 +9184,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
this.miniGame = miniGame;
|
this.miniGame = miniGame;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMiniGamePoints(MapleCharacter visitor, int winnerslot, boolean omok) {
|
public void setMiniGamePoints(Character visitor, int winnerslot, boolean omok) {
|
||||||
if (omok) {
|
if (omok) {
|
||||||
if (winnerslot == 1) {
|
if (winnerslot == 1) {
|
||||||
this.omokwins++;
|
this.omokwins++;
|
||||||
@@ -9370,7 +9375,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
Inventory inv = getInventory(type);
|
Inventory inv = getInventory(type);
|
||||||
inv.lockInventory();
|
inv.lockInventory();
|
||||||
try {
|
try {
|
||||||
Item item = inv.getItem((short) slot);
|
Item item = inv.getItem(slot);
|
||||||
if (item == null) { //Basic check
|
if (item == null) { //Basic check
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@@ -9617,7 +9622,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showMapOwnershipInfo(MapleCharacter mapOwner) {
|
public void showMapOwnershipInfo(Character mapOwner) {
|
||||||
long curTime = Server.getInstance().getCurrentTime();
|
long curTime = Server.getInstance().getCurrentTime();
|
||||||
if (nextWarningTime < curTime) {
|
if (nextWarningTime < curTime) {
|
||||||
nextWarningTime = curTime + (60 * 1000); // show underlevel info again after 1 minute
|
nextWarningTime = curTime + (60 * 1000); // show underlevel info again after 1 minute
|
||||||
@@ -9809,7 +9814,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (party != null) {
|
if (party != null) {
|
||||||
int curmaxhp = getCurrentMaxHp();
|
int curmaxhp = getCurrentMaxHp();
|
||||||
int curhp = getHp();
|
int curhp = getHp();
|
||||||
for (MapleCharacter partychar : this.getPartyMembersOnSameMap()) {
|
for (Character partychar : this.getPartyMembersOnSameMap()) {
|
||||||
partychar.sendPacket(PacketCreator.updatePartyMemberHP(getId(), curhp, curmaxhp));
|
partychar.sendPacket(PacketCreator.updatePartyMemberHP(getId(), curhp, curmaxhp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9855,7 +9860,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
UPDATE, FORFEIT, COMPLETE, INFO
|
UPDATE, FORFEIT, COMPLETE, INFO
|
||||||
}
|
}
|
||||||
|
|
||||||
private void announceUpdateQuestInternal(MapleCharacter chr, Pair<DelayedQuestUpdate, Object[]> questUpdate) {
|
private void announceUpdateQuestInternal(Character chr, Pair<DelayedQuestUpdate, Object[]> questUpdate) {
|
||||||
Object[] objs = questUpdate.getRight();
|
Object[] objs = questUpdate.getRight();
|
||||||
|
|
||||||
switch (questUpdate.getLeft()) {
|
switch (questUpdate.getLeft()) {
|
||||||
@@ -10199,7 +10204,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
Server.getInstance().broadcastGMMessage(this.getWorld(), PacketCreator.serverNotice(6, MapleCharacter.makeMapleReadable(this.name) + " was autobanned for " + reason));
|
Server.getInstance().broadcastGMMessage(this.getWorld(), PacketCreator.serverNotice(6, Character.makeMapleReadable(this.name) + " was autobanned for " + reason));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void block(int reason, int days, String desc) {
|
public void block(int reason, int days, String desc) {
|
||||||
@@ -10256,11 +10261,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
public boolean isTrockMap(int id) {
|
public boolean isTrockMap(int id) {
|
||||||
int index = trockmaps.indexOf(id);
|
int index = trockmaps.indexOf(id);
|
||||||
if (index != -1) {
|
return index != -1;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getVipTrockSize() {
|
public int getVipTrockSize() {
|
||||||
@@ -10289,11 +10290,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
public boolean isVipTrockMap(int id) {
|
public boolean isVipTrockMap(int id) {
|
||||||
int index = viptrockmaps.indexOf(id);
|
int index = viptrockmaps.indexOf(id);
|
||||||
if (index != -1) {
|
return index != -1;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AutobanManager getAutobanManager() {
|
public AutobanManager getAutobanManager() {
|
||||||
@@ -10445,24 +10442,36 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clearCpqTimer() {
|
public void clearCpqTimer() {
|
||||||
if (cpqSchedule != null) { cpqSchedule.cancel(true); }
|
if (cpqSchedule != null) {
|
||||||
|
cpqSchedule.cancel(true);
|
||||||
|
}
|
||||||
cpqSchedule = null;
|
cpqSchedule = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void empty(final boolean remove) {
|
public final void empty(final boolean remove) {
|
||||||
if (dragonBloodSchedule != null) { dragonBloodSchedule.cancel(true); }
|
if (dragonBloodSchedule != null) {
|
||||||
|
dragonBloodSchedule.cancel(true);
|
||||||
|
}
|
||||||
dragonBloodSchedule = null;
|
dragonBloodSchedule = null;
|
||||||
|
|
||||||
if (hpDecreaseTask != null) { hpDecreaseTask.cancel(true); }
|
if (hpDecreaseTask != null) {
|
||||||
|
hpDecreaseTask.cancel(true);
|
||||||
|
}
|
||||||
hpDecreaseTask = null;
|
hpDecreaseTask = null;
|
||||||
|
|
||||||
if (beholderHealingSchedule != null) { beholderHealingSchedule.cancel(true); }
|
if (beholderHealingSchedule != null) {
|
||||||
|
beholderHealingSchedule.cancel(true);
|
||||||
|
}
|
||||||
beholderHealingSchedule = null;
|
beholderHealingSchedule = null;
|
||||||
|
|
||||||
if (beholderBuffSchedule != null) { beholderBuffSchedule.cancel(true); }
|
if (beholderBuffSchedule != null) {
|
||||||
|
beholderBuffSchedule.cancel(true);
|
||||||
|
}
|
||||||
beholderBuffSchedule = null;
|
beholderBuffSchedule = null;
|
||||||
|
|
||||||
if (berserkSchedule != null) { berserkSchedule.cancel(true); }
|
if (berserkSchedule != null) {
|
||||||
|
berserkSchedule.cancel(true);
|
||||||
|
}
|
||||||
berserkSchedule = null;
|
berserkSchedule = null;
|
||||||
|
|
||||||
unregisterChairBuff();
|
unregisterChairBuff();
|
||||||
@@ -10471,20 +10480,28 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
cancelSkillCooldownTask();
|
cancelSkillCooldownTask();
|
||||||
cancelExpirationTask();
|
cancelExpirationTask();
|
||||||
|
|
||||||
if (questExpireTask != null) { questExpireTask.cancel(true); }
|
if (questExpireTask != null) {
|
||||||
|
questExpireTask.cancel(true);
|
||||||
|
}
|
||||||
questExpireTask = null;
|
questExpireTask = null;
|
||||||
|
|
||||||
if (recoveryTask != null) { recoveryTask.cancel(true); }
|
if (recoveryTask != null) {
|
||||||
|
recoveryTask.cancel(true);
|
||||||
|
}
|
||||||
recoveryTask = null;
|
recoveryTask = null;
|
||||||
|
|
||||||
if (extraRecoveryTask != null) { extraRecoveryTask.cancel(true); }
|
if (extraRecoveryTask != null) {
|
||||||
|
extraRecoveryTask.cancel(true);
|
||||||
|
}
|
||||||
extraRecoveryTask = null;
|
extraRecoveryTask = null;
|
||||||
|
|
||||||
// already done on unregisterChairBuff
|
// already done on unregisterChairBuff
|
||||||
/* if (chairRecoveryTask != null) { chairRecoveryTask.cancel(true); }
|
/* if (chairRecoveryTask != null) { chairRecoveryTask.cancel(true); }
|
||||||
chairRecoveryTask = null; */
|
chairRecoveryTask = null; */
|
||||||
|
|
||||||
if (pendantOfSpirit != null) { pendantOfSpirit.cancel(true); }
|
if (pendantOfSpirit != null) {
|
||||||
|
pendantOfSpirit.cancel(true);
|
||||||
|
}
|
||||||
pendantOfSpirit = null;
|
pendantOfSpirit = null;
|
||||||
|
|
||||||
clearCpqTimer();
|
clearCpqTimer();
|
||||||
@@ -10569,7 +10586,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean getWhiteChat() {
|
public boolean getWhiteChat() {
|
||||||
return !isGM() ? false : whiteChat;
|
return isGM() && whiteChat;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void toggleWhiteChat() {
|
public void toggleWhiteChat() {
|
||||||
@@ -10731,7 +10748,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
if (!success) {
|
if (!success) {
|
||||||
con.rollback();
|
con.rollback();
|
||||||
} else {
|
} else {
|
||||||
FilePrinter.print(FilePrinter.CHANGE_CHARACTER_NAME, "Name change applied : from \"" + getName() + "\" to \"" + newName + "\" at " + Calendar.getInstance().getTime().toString());
|
FilePrinter.print(FilePrinter.CHANGE_CHARACTER_NAME, "Name change applied : from \"" + getName() + "\" to \"" + newName + "\" at " + Calendar.getInstance().getTime());
|
||||||
}
|
}
|
||||||
con.setAutoCommit(true);
|
con.setAutoCommit(true);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
@@ -10915,17 +10932,29 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String checkWorldTransferEligibility(Connection con, int characterId, int oldWorld, int newWorld) {
|
public static String checkWorldTransferEligibility(Connection con, int characterId, int oldWorld, int newWorld) {
|
||||||
if(!YamlConfig.config.server.ALLOW_CASHSHOP_WORLD_TRANSFER) return "World transfers disabled.";
|
if (!YamlConfig.config.server.ALLOW_CASHSHOP_WORLD_TRANSFER) {
|
||||||
|
return "World transfers disabled.";
|
||||||
|
}
|
||||||
int accountId = -1;
|
int accountId = -1;
|
||||||
try (PreparedStatement ps = con.prepareStatement("SELECT accountid, level, guildid, guildrank, partnerId, familyId FROM characters WHERE id = ?")) {
|
try (PreparedStatement ps = con.prepareStatement("SELECT accountid, level, guildid, guildrank, partnerId, familyId FROM characters WHERE id = ?")) {
|
||||||
ps.setInt(1, characterId);
|
ps.setInt(1, characterId);
|
||||||
ResultSet rs = ps.executeQuery();
|
ResultSet rs = ps.executeQuery();
|
||||||
if(!rs.next()) return "Character does not exist.";
|
if (!rs.next()) {
|
||||||
|
return "Character does not exist.";
|
||||||
|
}
|
||||||
accountId = rs.getInt("accountid");
|
accountId = rs.getInt("accountid");
|
||||||
if(rs.getInt("level") < 20) return "Character is under level 20.";
|
if (rs.getInt("level") < 20) {
|
||||||
if(rs.getInt("familyId") != -1) return "Character is in family.";
|
return "Character is under level 20.";
|
||||||
if(rs.getInt("partnerId") != 0) return "Character is married.";
|
}
|
||||||
if(rs.getInt("guildid") != 0 && rs.getInt("guildrank") < 2) return "Character is the leader of a guild.";
|
if (rs.getInt("familyId") != -1) {
|
||||||
|
return "Character is in family.";
|
||||||
|
}
|
||||||
|
if (rs.getInt("partnerId") != 0) {
|
||||||
|
return "Character is married.";
|
||||||
|
}
|
||||||
|
if (rs.getInt("guildid") != 0 && rs.getInt("guildrank") < 2) {
|
||||||
|
return "Character is the leader of a guild.";
|
||||||
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
FilePrinter.printError(FilePrinter.CHANGE_CHARACTER_NAME, e);
|
FilePrinter.printError(FilePrinter.CHANGE_CHARACTER_NAME, e);
|
||||||
@@ -10950,8 +10979,12 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
ps.setInt(1, accountId);
|
ps.setInt(1, accountId);
|
||||||
ps.setInt(2, newWorld);
|
ps.setInt(2, newWorld);
|
||||||
ResultSet rs = ps.executeQuery();
|
ResultSet rs = ps.executeQuery();
|
||||||
if(!rs.next()) return "SQL Error";
|
if (!rs.next()) {
|
||||||
if(rs.getInt("rowcount") >= 3) return "Too many characters on destination world.";
|
return "SQL Error";
|
||||||
|
}
|
||||||
|
if (rs.getInt("rowcount") >= 3) {
|
||||||
|
return "Too many characters on destination world.";
|
||||||
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
FilePrinter.printError(FilePrinter.CHANGE_CHARACTER_NAME, e);
|
FilePrinter.printError(FilePrinter.CHANGE_CHARACTER_NAME, e);
|
||||||
@@ -94,7 +94,7 @@ public class MapleClient extends ChannelInboundHandlerAdapter {
|
|||||||
private volatile boolean inTransition;
|
private volatile boolean inTransition;
|
||||||
|
|
||||||
private io.netty.channel.Channel ioChannel;
|
private io.netty.channel.Channel ioChannel;
|
||||||
private MapleCharacter player;
|
private Character player;
|
||||||
private int channel = 1;
|
private int channel = 1;
|
||||||
private int accId = -4;
|
private int accId = -4;
|
||||||
private boolean loggedIn = false;
|
private boolean loggedIn = false;
|
||||||
@@ -288,11 +288,11 @@ public class MapleClient extends ChannelInboundHandlerAdapter {
|
|||||||
return getChannelServer().getEventSM().getEventManager(event);
|
return getChannelServer().getEventSM().getEventManager(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapleCharacter getPlayer() {
|
public Character getPlayer() {
|
||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlayer(MapleCharacter player) {
|
public void setPlayer(Character player) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,11 +304,11 @@ public class MapleClient extends ChannelInboundHandlerAdapter {
|
|||||||
this.sendPacket(PacketCreator.getCharList(this, server, 0));
|
this.sendPacket(PacketCreator.getCharList(this, server, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MapleCharacter> loadCharacters(int serverId) {
|
public List<Character> loadCharacters(int serverId) {
|
||||||
List<MapleCharacter> chars = new ArrayList<>(15);
|
List<Character> chars = new ArrayList<>(15);
|
||||||
try {
|
try {
|
||||||
for (CharNameAndId cni : loadCharactersInternal(serverId)) {
|
for (CharNameAndId cni : loadCharactersInternal(serverId)) {
|
||||||
chars.add(MapleCharacter.loadCharFromDB(cni.id, this, false));
|
chars.add(Character.loadCharFromDB(cni.id, this, false));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -1091,7 +1091,7 @@ public class MapleClient extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
public boolean deleteCharacter(int cid, int senderAccId) {
|
public boolean deleteCharacter(int cid, int senderAccId) {
|
||||||
try {
|
try {
|
||||||
MapleCharacter chr = MapleCharacter.loadCharFromDB(cid, this, false);
|
Character chr = Character.loadCharFromDB(cid, this, false);
|
||||||
|
|
||||||
Integer partyid = chr.getWorldServer().getCharacterPartyid(cid);
|
Integer partyid = chr.getWorldServer().getCharacterPartyid(cid);
|
||||||
if (partyid != null) {
|
if (partyid != null) {
|
||||||
@@ -1105,7 +1105,7 @@ public class MapleClient extends ChannelInboundHandlerAdapter {
|
|||||||
this.setPlayer(null);
|
this.setPlayer(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return MapleCharacter.deleteCharFromDB(chr, senderAccId);
|
return Character.deleteCharFromDB(chr, senderAccId);
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
return false;
|
return false;
|
||||||
@@ -1221,7 +1221,7 @@ public class MapleClient extends ChannelInboundHandlerAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (World w : Server.getInstance().getWorlds()) {
|
for (World w : Server.getInstance().getWorlds()) {
|
||||||
for (MapleCharacter chr : w.getPlayerStorage().getAllCharacters()) {
|
for (Character chr : w.getPlayerStorage().getAllCharacters()) {
|
||||||
if (accid == chr.getAccountID()) {
|
if (accid == chr.getAccountID()) {
|
||||||
FilePrinter.print(FilePrinter.EXPLOITS, "Player: " + chr.getName() + " has been removed from " + GameConstants.WORLD_NAMES[w.getId()] + ". Possible Dupe attempt.");
|
FilePrinter.print(FilePrinter.EXPLOITS, "Player: " + chr.getName() + " has been removed from " + GameConstants.WORLD_NAMES[w.getId()] + ". Possible Dupe attempt.");
|
||||||
chr.getClient().forceDisconnect();
|
chr.getClient().forceDisconnect();
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ public class MapleFamily {
|
|||||||
|
|
||||||
public void broadcast(Packet packet, int ignoreID) {
|
public void broadcast(Packet packet, int ignoreID) {
|
||||||
for(MapleFamilyEntry entry : members.values()) {
|
for(MapleFamilyEntry entry : members.values()) {
|
||||||
MapleCharacter chr = entry.getChr();
|
Character chr = entry.getChr();
|
||||||
if(chr != null) {
|
if(chr != null) {
|
||||||
if(chr.getId() == ignoreID) continue;
|
if(chr.getId() == ignoreID) continue;
|
||||||
chr.sendPacket(packet);
|
chr.sendPacket(packet);
|
||||||
@@ -168,7 +168,7 @@ public class MapleFamily {
|
|||||||
|
|
||||||
public void broadcastFamilyInfoUpdate() {
|
public void broadcastFamilyInfoUpdate() {
|
||||||
for(MapleFamilyEntry entry : members.values()) {
|
for(MapleFamilyEntry entry : members.values()) {
|
||||||
MapleCharacter chr = entry.getChr();
|
Character chr = entry.getChr();
|
||||||
if(chr != null) {
|
if(chr != null) {
|
||||||
chr.sendPacket(PacketCreator.getFamilyInfo(entry));
|
chr.sendPacket(PacketCreator.getFamilyInfo(entry));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import java.util.List;
|
|||||||
public class MapleFamilyEntry {
|
public class MapleFamilyEntry {
|
||||||
private final int characterID;
|
private final int characterID;
|
||||||
private volatile MapleFamily family;
|
private volatile MapleFamily family;
|
||||||
private volatile MapleCharacter character;
|
private volatile Character character;
|
||||||
|
|
||||||
private volatile MapleFamilyEntry senior;
|
private volatile MapleFamilyEntry senior;
|
||||||
private final MapleFamilyEntry[] juniors = new MapleFamilyEntry[2];
|
private final MapleFamilyEntry[] juniors = new MapleFamilyEntry[2];
|
||||||
@@ -66,17 +66,17 @@ public class MapleFamilyEntry {
|
|||||||
this.job = job;
|
this.job = job;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapleCharacter getChr() {
|
public Character getChr() {
|
||||||
return character;
|
return character;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCharacter(MapleCharacter newCharacter) {
|
public void setCharacter(Character newCharacter) {
|
||||||
if(newCharacter == null) cacheOffline(newCharacter);
|
if(newCharacter == null) cacheOffline(newCharacter);
|
||||||
else newCharacter.setFamilyEntry(this);
|
else newCharacter.setFamilyEntry(this);
|
||||||
this.character = newCharacter;
|
this.character = newCharacter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cacheOffline(MapleCharacter chr) {
|
private void cacheOffline(Character chr) {
|
||||||
if(chr != null) {
|
if(chr != null) {
|
||||||
charName = chr.getName();
|
charName = chr.getName();
|
||||||
level = chr.getLevel();
|
level = chr.getLevel();
|
||||||
@@ -209,19 +209,19 @@ public class MapleFamilyEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
MapleCharacter chr = character;
|
Character chr = character;
|
||||||
if(chr != null) return chr.getName();
|
if(chr != null) return chr.getName();
|
||||||
else return charName;
|
else return charName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
MapleCharacter chr = character;
|
Character chr = character;
|
||||||
if(chr != null) return chr.getLevel();
|
if(chr != null) return chr.getLevel();
|
||||||
else return level;
|
else return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapleJob getJob() {
|
public MapleJob getJob() {
|
||||||
MapleCharacter chr = character;
|
Character chr = character;
|
||||||
if(chr != null) return chr.getJob();
|
if(chr != null) return chr.getJob();
|
||||||
else return job;
|
else return job;
|
||||||
}
|
}
|
||||||
@@ -264,7 +264,7 @@ public class MapleFamilyEntry {
|
|||||||
if(gain > 0 && countTowardsTotal) {
|
if(gain > 0 && countTowardsTotal) {
|
||||||
this.totalReputation += gain;
|
this.totalReputation += gain;
|
||||||
}
|
}
|
||||||
MapleCharacter chr = getChr();
|
Character chr = getChr();
|
||||||
if(chr != null) chr.sendPacket(PacketCreator.sendGainRep(gain, from != null ? from.getName() : ""));
|
if(chr != null) chr.sendPacket(PacketCreator.sendGainRep(gain, from != null ? from.getName() : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,7 +424,7 @@ public class MapleFamilyEntry {
|
|||||||
public void announceToSenior(Packet packet, boolean includeSuperSenior) {
|
public void announceToSenior(Packet packet, boolean includeSuperSenior) {
|
||||||
MapleFamilyEntry senior = getSenior();
|
MapleFamilyEntry senior = getSenior();
|
||||||
if(senior != null) {
|
if(senior != null) {
|
||||||
MapleCharacter seniorChr = senior.getChr();
|
Character seniorChr = senior.getChr();
|
||||||
if(seniorChr != null) seniorChr.sendPacket(packet);
|
if(seniorChr != null) seniorChr.sendPacket(packet);
|
||||||
senior = senior.getSenior();
|
senior = senior.getSenior();
|
||||||
if(includeSuperSenior && senior != null) {
|
if(includeSuperSenior && senior != null) {
|
||||||
@@ -437,7 +437,7 @@ public class MapleFamilyEntry {
|
|||||||
public void updateSeniorFamilyInfo(boolean includeSuperSenior) {
|
public void updateSeniorFamilyInfo(boolean includeSuperSenior) {
|
||||||
MapleFamilyEntry senior = getSenior();
|
MapleFamilyEntry senior = getSenior();
|
||||||
if(senior != null) {
|
if(senior != null) {
|
||||||
MapleCharacter seniorChr = senior.getChr();
|
Character seniorChr = senior.getChr();
|
||||||
if(seniorChr != null) seniorChr.sendPacket(PacketCreator.getFamilyInfo(senior));
|
if(seniorChr != null) seniorChr.sendPacket(PacketCreator.getFamilyInfo(senior));
|
||||||
senior = senior.getSenior();
|
senior = senior.getSenior();
|
||||||
if(includeSuperSenior && senior != null) {
|
if(includeSuperSenior && senior != null) {
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ public class MapleMount {
|
|||||||
private int tiredness;
|
private int tiredness;
|
||||||
private int exp;
|
private int exp;
|
||||||
private int level;
|
private int level;
|
||||||
private MapleCharacter owner;
|
private Character owner;
|
||||||
private boolean active;
|
private boolean active;
|
||||||
|
|
||||||
public MapleMount(MapleCharacter owner, int id, int skillid) {
|
public MapleMount(Character owner, int id, int skillid) {
|
||||||
this.itemid = id;
|
this.itemid = id;
|
||||||
this.skillid = skillid;
|
this.skillid = skillid;
|
||||||
this.tiredness = 0;
|
this.tiredness = 0;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class MapleRing implements Comparable<MapleRing> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Pair<Integer, Integer> createRing(int itemid, final MapleCharacter partner1, final MapleCharacter partner2) {
|
public static Pair<Integer, Integer> createRing(int itemid, final Character partner1, final Character partner2) {
|
||||||
try {
|
try {
|
||||||
if (partner1 == null) {
|
if (partner1 == null) {
|
||||||
return new Pair<>(-3, -3);
|
return new Pair<>(-3, -3);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
package client.autoban;
|
package client.autoban;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
import net.packet.logging.MapleLogger;
|
import net.packet.logging.MapleLogger;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -83,19 +83,19 @@ public enum AutobanFactory {
|
|||||||
ban.addPoint(this, reason);
|
ban.addPoint(this, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void alert(MapleCharacter chr, String reason) {
|
public void alert(Character chr, String reason) {
|
||||||
if(YamlConfig.config.server.USE_AUTOBAN == true) {
|
if(YamlConfig.config.server.USE_AUTOBAN == true) {
|
||||||
if (chr != null && MapleLogger.ignored.contains(chr.getId())){
|
if (chr != null && MapleLogger.ignored.contains(chr.getId())){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Server.getInstance().broadcastGMMessage((chr != null ? chr.getWorld() : 0), PacketCreator.sendYellowTip((chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason));
|
Server.getInstance().broadcastGMMessage((chr != null ? chr.getWorld() : 0), PacketCreator.sendYellowTip((chr != null ? Character.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason));
|
||||||
}
|
}
|
||||||
if (YamlConfig.config.server.USE_AUTOBAN_LOG) {
|
if (YamlConfig.config.server.USE_AUTOBAN_LOG) {
|
||||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, (chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason);
|
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, (chr != null ? Character.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void autoban(MapleCharacter chr, String value) {
|
public void autoban(Character chr, String value) {
|
||||||
if(YamlConfig.config.server.USE_AUTOBAN == true) {
|
if(YamlConfig.config.server.USE_AUTOBAN == true) {
|
||||||
chr.autoban("Autobanned for (" + this.name() + ": " + value + ")");
|
chr.autoban("Autobanned for (" + this.name() + ": " + value + ")");
|
||||||
//chr.sendPolice("You will be disconnected for (" + this.name() + ": " + value + ")");
|
//chr.sendPolice("You will be disconnected for (" + this.name() + ": " + value + ")");
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
package client.autoban;
|
package client.autoban;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
import tools.FilePrinter;
|
import tools.FilePrinter;
|
||||||
@@ -18,7 +18,7 @@ import java.util.Map;
|
|||||||
* @author kevintjuh93
|
* @author kevintjuh93
|
||||||
*/
|
*/
|
||||||
public class AutobanManager {
|
public class AutobanManager {
|
||||||
private MapleCharacter chr;
|
private Character chr;
|
||||||
private Map<AutobanFactory, Integer> points = new HashMap<>();
|
private Map<AutobanFactory, Integer> points = new HashMap<>();
|
||||||
private Map<AutobanFactory, Long> lastTime = new HashMap<>();
|
private Map<AutobanFactory, Long> lastTime = new HashMap<>();
|
||||||
private int misses = 0;
|
private int misses = 0;
|
||||||
@@ -29,7 +29,7 @@ public class AutobanManager {
|
|||||||
private byte[] timestampcounter = new byte[20];
|
private byte[] timestampcounter = new byte[20];
|
||||||
|
|
||||||
|
|
||||||
public AutobanManager(MapleCharacter chr) {
|
public AutobanManager(Character chr) {
|
||||||
this.chr = chr;
|
this.chr = chr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public class AutobanManager {
|
|||||||
}
|
}
|
||||||
if (YamlConfig.config.server.USE_AUTOBAN_LOG) {
|
if (YamlConfig.config.server.USE_AUTOBAN_LOG) {
|
||||||
// Lets log every single point too.
|
// Lets log every single point too.
|
||||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, MapleCharacter.makeMapleReadable(chr.getName()) + " caused " + fac.name() + " " + reason);
|
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, Character.makeMapleReadable(chr.getName()) + " caused " + fac.name() + " " + reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -45,15 +45,15 @@ public class GmCommand extends Command {
|
|||||||
"Do not ask if you can receive help, just state your issue.",
|
"Do not ask if you can receive help, just state your issue.",
|
||||||
"Do not say 'I have a bug to report', just state it.",
|
"Do not say 'I have a bug to report', just state it.",
|
||||||
};
|
};
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1 || params[0].length() < 3) { // #goodbye 'hi'
|
if (params.length < 1 || params[0].length() < 3) { // #goodbye 'hi'
|
||||||
player.dropMessage(5, "Your message was too short. Please provide as much detail as possible.");
|
player.dropMessage(5, "Your message was too short. Please provide as much detail as possible.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String message = player.getLastCommandMessage();
|
String message = player.getLastCommandMessage();
|
||||||
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.sendYellowTip("[GM Message]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.sendYellowTip("[GM Message]:" + Character.makeMapleReadable(player.getName()) + ": " + message));
|
||||||
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(1, message));
|
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(1, message));
|
||||||
FilePrinter.printError(FilePrinter.COMMAND_GM, MapleCharacter.makeMapleReadable(player.getName()) + ": " + message);
|
FilePrinter.printError(FilePrinter.COMMAND_GM, Character.makeMapleReadable(player.getName()) + ": " + message);
|
||||||
player.dropMessage(5, "Your message '" + message + "' was sent to GMs.");
|
player.dropMessage(5, "Your message '" + message + "' was sent to GMs.");
|
||||||
player.dropMessage(5, tips[Randomizer.nextInt(tips.length)]);
|
player.dropMessage(5, tips[Randomizer.nextInt(tips.length)]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.events.gm.MapleEvent;
|
import server.events.gm.MapleEvent;
|
||||||
@@ -36,7 +36,7 @@ public class JoinEventCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if(!FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit())) {
|
if(!FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit())) {
|
||||||
MapleEvent event = c.getChannelServer().getEvent();
|
MapleEvent event = c.getChannelServer().getEvent();
|
||||||
if(event != null) {
|
if(event != null) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class LeaveEventCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
int returnMap = player.getSavedLocation("EVENT");
|
int returnMap = player.getSavedLocation("EVENT");
|
||||||
if(returnMap != -1) {
|
if(returnMap != -1) {
|
||||||
if(player.getOla() != null) {
|
if(player.getOla() != null) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -38,7 +38,7 @@ public class MapOwnerClaimCommand extends Command {
|
|||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
if (c.tryacquireClient()) {
|
if (c.tryacquireClient()) {
|
||||||
try {
|
try {
|
||||||
MapleCharacter chr = c.getPlayer();
|
Character chr = c.getPlayer();
|
||||||
|
|
||||||
if (YamlConfig.config.server.USE_MAP_OWNERSHIP_SYSTEM) {
|
if (YamlConfig.config.server.USE_MAP_OWNERSHIP_SYSTEM) {
|
||||||
if (chr.getEventInstance() == null) {
|
if (chr.getEventInstance() == null) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -36,12 +36,12 @@ public class OnlineCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for (Channel ch : Server.getInstance().getChannelsFromWorld(player.getWorld())) {
|
for (Channel ch : Server.getInstance().getChannelsFromWorld(player.getWorld())) {
|
||||||
player.yellowMessage("Players in Channel " + ch.getId() + ":");
|
player.yellowMessage("Players in Channel " + ch.getId() + ":");
|
||||||
for (MapleCharacter chr : ch.getPlayerStorage().getAllCharacters()) {
|
for (Character chr : ch.getPlayerStorage().getAllCharacters()) {
|
||||||
if (!chr.isGM()) {
|
if (!chr.isGM()) {
|
||||||
player.message(" >> " + MapleCharacter.makeMapleReadable(chr.getName()) + " is at " + chr.getMap().getMapName() + ".");
|
player.message(" >> " + Character.makeMapleReadable(chr.getName()) + " is at " + chr.getMap().getMapName() + ".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -39,7 +39,7 @@ public class RanksCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
|
|
||||||
List<Pair<String, Integer>> worldRanking = Server.getInstance().getWorldPlayerRanking(player.getWorld());
|
List<Pair<String, Integer>> worldRanking = Server.getInstance().getWorldPlayerRanking(player.getWorld());
|
||||||
player.sendPacket(GuildPackets.showPlayerRanks(9010000, worldRanking));
|
player.sendPacket(GuildPackets.showPlayerRanks(9010000, worldRanking));
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -35,7 +35,7 @@ public class RatesCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
|
|
||||||
// travel rates not applicable since it's intrinsically a server/environment rate rather than a character rate
|
// travel rates not applicable since it's intrinsically a server/environment rate rather than a character rate
|
||||||
String showMsg_ = "#eCHARACTER RATES#n" + "\r\n\r\n";
|
String showMsg_ = "#eCHARACTER RATES#n" + "\r\n\r\n";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ public class ReadPointsCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient client, String[] params) {
|
public void execute(MapleClient client, String[] params) {
|
||||||
|
|
||||||
MapleCharacter player = client.getPlayer();
|
Character player = client.getPlayer();
|
||||||
if (params.length > 2) {
|
if (params.length > 2) {
|
||||||
player.yellowMessage("Syntax: @points (rp|vp|all)");
|
player.yellowMessage("Syntax: @points (rp|vp|all)");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -37,16 +37,16 @@ public class ReportBugCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
|
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.dropMessage(5, "Message too short and not sent. Please do @bug <bug>");
|
player.dropMessage(5, "Message too short and not sent. Please do @bug <bug>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String message = player.getLastCommandMessage();
|
String message = player.getLastCommandMessage();
|
||||||
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.sendYellowTip("[Bug]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.sendYellowTip("[Bug]:" + Character.makeMapleReadable(player.getName()) + ": " + message));
|
||||||
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(1, message));
|
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(1, message));
|
||||||
FilePrinter.printError(FilePrinter.COMMAND_BUG, MapleCharacter.makeMapleReadable(player.getName()) + ": " + message);
|
FilePrinter.printError(FilePrinter.COMMAND_BUG, Character.makeMapleReadable(player.getName()) + ": " + message);
|
||||||
player.dropMessage(5, "Your bug '" + message + "' was submitted successfully to our developers. Thank you!");
|
player.dropMessage(5, "Your bug '" + message + "' was submitted successfully to our developers. Thank you!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -35,7 +35,7 @@ public class ShowRatesCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
String showMsg = "#eEXP RATE#n" + "\r\n";
|
String showMsg = "#eEXP RATE#n" + "\r\n";
|
||||||
showMsg += "World EXP Rate: #k" + c.getWorldServer().getExpRate() + "x#k" + "\r\n";
|
showMsg += "World EXP Rate: #k" + c.getWorldServer().getExpRate() + "x#k" + "\r\n";
|
||||||
showMsg += "Player EXP Rate: #k" + player.getRawExpRate() + "x#k" + "\r\n";
|
showMsg += "Player EXP Rate: #k" + player.getRawExpRate() + "x#k" + "\r\n";
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -35,7 +35,7 @@ public class StatDexCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
int remainingAp = player.getRemainingAp();
|
int remainingAp = player.getRemainingAp();
|
||||||
|
|
||||||
int amount;
|
int amount;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -35,7 +35,7 @@ public class StatIntCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
int remainingAp = player.getRemainingAp();
|
int remainingAp = player.getRemainingAp();
|
||||||
|
|
||||||
int amount;
|
int amount;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -35,7 +35,7 @@ public class StatLukCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
int remainingAp = player.getRemainingAp();
|
int remainingAp = player.getRemainingAp();
|
||||||
|
|
||||||
int amount;
|
int amount;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm0;
|
package client.command.commands.gm0;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -35,7 +35,7 @@ public class StatStrCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
int remainingAp = player.getRemainingAp();
|
int remainingAp = player.getRemainingAp();
|
||||||
int amount;
|
int amount;
|
||||||
if (params.length > 0) {
|
if (params.length > 0) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm1;
|
package client.command.commands.gm1;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.life.MapleMonster;
|
import server.life.MapleMonster;
|
||||||
@@ -35,7 +35,7 @@ public class BossHpCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for(MapleMonster monster : player.getMap().getAllMonsters()) {
|
for(MapleMonster monster : player.getMap().getAllMonsters()) {
|
||||||
if(monster != null && monster.isBoss() && monster.getHp() > 0) {
|
if(monster != null && monster.isBoss() && monster.getHp() > 0) {
|
||||||
long percent = monster.getHp() * 100L / monster.getMaxHp();
|
long percent = monster.getHp() * 100L / monster.getMaxHp();
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm1;
|
package client.command.commands.gm1;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -35,7 +35,7 @@ public class BuffMeCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
SkillFactory.getSkill(4101004).getEffect(SkillFactory.getSkill(4101004).getMaxLevel()).applyTo(player);
|
SkillFactory.getSkill(4101004).getEffect(SkillFactory.getSkill(4101004).getMaxLevel()).applyTo(player);
|
||||||
SkillFactory.getSkill(2311003).getEffect(SkillFactory.getSkill(2311003).getMaxLevel()).applyTo(player);
|
SkillFactory.getSkill(2311003).getEffect(SkillFactory.getSkill(2311003).getMaxLevel()).applyTo(player);
|
||||||
SkillFactory.getSkill(1301007).getEffect(SkillFactory.getSkill(1301007).getMaxLevel()).applyTo(player);
|
SkillFactory.getSkill(1301007).getEffect(SkillFactory.getSkill(1301007).getMaxLevel()).applyTo(player);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm1;
|
package client.command.commands.gm1;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import constants.game.GameConstants;
|
import constants.game.GameConstants;
|
||||||
@@ -73,7 +73,7 @@ public class GotoCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1){
|
if (params.length < 1){
|
||||||
String sendStr = "Syntax: #b@goto <map name>#k. Available areas:\r\n\r\n#rTowns:#k\r\n" + GOTO_TOWNS_INFO;
|
String sendStr = "Syntax: #b@goto <map name>#k. Available areas:\r\n\r\n#rTowns:#k\r\n" + GOTO_TOWNS_INFO;
|
||||||
if (player.isGM()) {
|
if (player.isGM()) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm1;
|
package client.command.commands.gm1;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.life.MapleMonster;
|
import server.life.MapleMonster;
|
||||||
@@ -35,7 +35,7 @@ public class MobHpCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for(MapleMonster monster : player.getMap().getAllMonsters()) {
|
for(MapleMonster monster : player.getMap().getAllMonsters()) {
|
||||||
if (monster != null && monster.getHp() > 0) {
|
if (monster != null && monster.getHp() > 0) {
|
||||||
player.yellowMessage(monster.getName() + " (" + monster.getId() + ") has " + monster.getHp() + " / " + monster.getMaxHp() + " HP.");
|
player.yellowMessage(monster.getName() + " (" + monster.getId() + ") has " + monster.getHp() + " / " + monster.getMaxHp() + " HP.");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm1;
|
package client.command.commands.gm1;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.MapleItemInformationProvider;
|
import server.MapleItemInformationProvider;
|
||||||
@@ -40,7 +40,7 @@ public class WhatDropsFromCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.dropMessage(5, "Please do @whatdropsfrom <monster name>");
|
player.dropMessage(5, "Please do @whatdropsfrom <monster name>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm1;
|
package client.command.commands.gm1;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.MapleItemInformationProvider;
|
import server.MapleItemInformationProvider;
|
||||||
@@ -43,7 +43,7 @@ public class WhoDropsCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.dropMessage(5, "Please do @whodrops <item name>");
|
player.dropMessage(5, "Please do @whodrops <item name>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -35,7 +35,7 @@ public class ApCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !ap [<playername>] <newap>");
|
player.yellowMessage("Syntax: !ap [<playername>] <newap>");
|
||||||
return;
|
return;
|
||||||
@@ -48,7 +48,7 @@ public class ApCommand extends Command {
|
|||||||
|
|
||||||
player.changeRemainingAp(newAp, false);
|
player.changeRemainingAp(newAp, false);
|
||||||
} else {
|
} else {
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
int newAp = Integer.parseInt(params[1]);
|
int newAp = Integer.parseInt(params[1]);
|
||||||
if (newAp < 0) newAp = 0;
|
if (newAp < 0) newAp = 0;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -37,9 +37,9 @@ public class BombCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length > 0) {
|
if (params.length > 0) {
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), victim.getPosition());
|
victim.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), victim.getPosition());
|
||||||
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, player.getName() + " used !bomb on " + victim.getName()));
|
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, player.getName() + " used !bomb on " + victim.getName()));
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.Skill;
|
import client.Skill;
|
||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
@@ -36,7 +36,7 @@ public class BuffCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !buff <buffid>");
|
player.yellowMessage("Syntax: !buff <buffid>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -35,7 +35,7 @@ public class BuffMapCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
SkillFactory.getSkill(9101001).getEffect(SkillFactory.getSkill(9101001).getMaxLevel()).applyTo(player, true);
|
SkillFactory.getSkill(9101001).getEffect(SkillFactory.getSkill(9101001).getMaxLevel()).applyTo(player, true);
|
||||||
SkillFactory.getSkill(9101002).getEffect(SkillFactory.getSkill(9101002).getMaxLevel()).applyTo(player, true);
|
SkillFactory.getSkill(9101002).getEffect(SkillFactory.getSkill(9101002).getMaxLevel()).applyTo(player, true);
|
||||||
SkillFactory.getSkill(9101003).getEffect(SkillFactory.getSkill(9101003).getMaxLevel()).applyTo(player, true);
|
SkillFactory.getSkill(9101003).getEffect(SkillFactory.getSkill(9101003).getMaxLevel()).applyTo(player, true);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class ClearDropsCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
player.getMap().clearDrops(player);
|
player.getMap().clearDrops(player);
|
||||||
player.dropMessage(5, "Cleared dropped items");
|
player.dropMessage(5, "Cleared dropped items");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.maps.SavedLocationType;
|
import server.maps.SavedLocationType;
|
||||||
@@ -35,7 +35,7 @@ public class ClearSavedLocationsCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer(), victim;
|
Character player = c.getPlayer(), victim;
|
||||||
|
|
||||||
if (params.length > 0) {
|
if (params.length > 0) {
|
||||||
victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import client.inventory.InventoryType;
|
import client.inventory.InventoryType;
|
||||||
@@ -37,7 +37,7 @@ public class ClearSlotCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !clearslot <all, equip, use, setup, etc or cash.>");
|
player.yellowMessage("Syntax: !clearslot <all, equip, use, setup, etc or cash.>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,13 +34,13 @@ public class DcCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !dc <playername>");
|
player.yellowMessage("Syntax: !dc <playername>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim == null) {
|
if (victim == null) {
|
||||||
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim == null) {
|
if (victim == null) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -35,7 +35,7 @@ public class EmpowerMeCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
final int[] array = {2311003, 2301004, 1301007, 4101004, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002};
|
final int[] array = {2311003, 2301004, 1301007, 4101004, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002};
|
||||||
for (int i : array) {
|
for (int i : array) {
|
||||||
SkillFactory.getSkill(i).getEffect(SkillFactory.getSkill(i).getMaxLevel()).applyTo(player);
|
SkillFactory.getSkill(i).getEffect(SkillFactory.getSkill(i).getMaxLevel()).applyTo(player);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class HealCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
player.healHpMp();
|
player.healHpMp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -35,7 +35,7 @@ public class HideCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player);
|
SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.ThreadManager;
|
import server.ThreadManager;
|
||||||
@@ -31,7 +31,7 @@ public class IdCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient client, final String[] params) {
|
public void execute(MapleClient client, final String[] params) {
|
||||||
final MapleCharacter player = client.getPlayer();
|
final Character player = client.getPlayer();
|
||||||
if (params.length < 2) {
|
if (params.length < 2) {
|
||||||
player.yellowMessage("Syntax: !id <type> <query>");
|
player.yellowMessage("Syntax: !id <type> <query>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import client.inventory.Pet;
|
import client.inventory.Pet;
|
||||||
@@ -39,7 +39,7 @@ public class ItemCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
|
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !item <itemid> <quantity>");
|
player.yellowMessage("Syntax: !item <itemid> <quantity>");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import client.inventory.InventoryType;
|
import client.inventory.InventoryType;
|
||||||
@@ -40,7 +40,7 @@ public class ItemDropCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
|
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !drop <itemid> <quantity>");
|
player.yellowMessage("Syntax: !drop <itemid> <quantity>");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.maps.MapleMap;
|
import server.maps.MapleMap;
|
||||||
@@ -36,7 +36,7 @@ public class JailCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !jail <playername> [<minutes>]");
|
player.yellowMessage("Syntax: !jail <playername> [<minutes>]");
|
||||||
return;
|
return;
|
||||||
@@ -51,7 +51,7 @@ public class JailCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.addJailExpirationTime(minutesJailed * 60 * 1000);
|
victim.addJailExpirationTime(minutesJailed * 60 * 1000);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.MapleJob;
|
import client.MapleJob;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -35,7 +35,7 @@ public class JobCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length == 1) {
|
if (params.length == 1) {
|
||||||
int jobid = Integer.parseInt(params[0]);
|
int jobid = Integer.parseInt(params[0]);
|
||||||
if (jobid < 0 || jobid >= 2200) {
|
if (jobid < 0 || jobid >= 2200) {
|
||||||
@@ -46,7 +46,7 @@ public class JobCommand extends Command {
|
|||||||
player.changeJob(MapleJob.getById(jobid));
|
player.changeJob(MapleJob.getById(jobid));
|
||||||
player.equipChanged();
|
player.equipChanged();
|
||||||
} else if (params.length == 2) {
|
} else if (params.length == 2) {
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
|
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
int jobid = Integer.parseInt(params[1]);
|
int jobid = Integer.parseInt(params[1]);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -35,7 +35,7 @@ public class LevelCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !level <newlevel>");
|
player.yellowMessage("Syntax: !level <newlevel>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class LevelProCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !levelpro <newlevel>");
|
player.yellowMessage("Syntax: !levelpro <newlevel>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
|
import client.Character;
|
||||||
import client.*;
|
import client.*;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import provider.MapleData;
|
import provider.MapleData;
|
||||||
@@ -36,7 +37,7 @@ public class MaxSkillCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
||||||
try {
|
try {
|
||||||
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
|
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.MapleStat;
|
import client.MapleStat;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -36,7 +36,7 @@ public class MaxStatCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
player.loseExp(player.getExp(), false, false);
|
player.loseExp(player.getExp(), false, false);
|
||||||
player.setLevel(255);
|
player.setLevel(255);
|
||||||
player.resetPlayerRates();
|
player.resetPlayerRates();
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.maps.MapleMap;
|
import server.maps.MapleMap;
|
||||||
@@ -35,13 +35,13 @@ public class ReachCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !reach <playername>");
|
player.yellowMessage("Syntax: !reach <playername>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null && victim.isLoggedin()) {
|
if (victim != null && victim.isLoggedin()) {
|
||||||
if (player.getClient().getChannel() != victim.getClient().getChannel()) {
|
if (player.getClient().getChannel() != victim.getClient().getChannel()) {
|
||||||
player.dropMessage(5, "Player '" + victim.getName() + "' is at channel " + victim.getClient().getChannel() + ".");
|
player.dropMessage(5, "Player '" + victim.getName() + "' is at channel " + victim.getClient().getChannel() + ".");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import client.inventory.InventoryType;
|
import client.inventory.InventoryType;
|
||||||
@@ -38,7 +38,7 @@ public class RechargeCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||||
for (Item torecharge : c.getPlayer().getInventory(InventoryType.USE).list()) {
|
for (Item torecharge : c.getPlayer().getInventory(InventoryType.USE).list()) {
|
||||||
if (ItemConstants.isThrowingStar(torecharge.getItemId())){
|
if (ItemConstants.isThrowingStar(torecharge.getItemId())){
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
|
import client.Character;
|
||||||
import client.*;
|
import client.*;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import provider.MapleData;
|
import provider.MapleData;
|
||||||
@@ -36,7 +37,7 @@ public class ResetSkillCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
|
||||||
try {
|
try {
|
||||||
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
|
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import provider.MapleData;
|
import provider.MapleData;
|
||||||
@@ -53,7 +53,7 @@ public class SearchCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 2) {
|
if (params.length < 2) {
|
||||||
player.yellowMessage("Syntax: !search <type> <name>");
|
player.yellowMessage("Syntax: !search <type> <name>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class SetSlotCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !setslot <newlevel>");
|
player.yellowMessage("Syntax: !setslot <newlevel>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class SetStatCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !setstat <newstat>");
|
player.yellowMessage("Syntax: !setstat <newstat>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import config.YamlConfig;
|
import config.YamlConfig;
|
||||||
@@ -35,7 +35,7 @@ public class SpCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !sp [<playername>] <newsp>");
|
player.yellowMessage("Syntax: !sp [<playername>] <newsp>");
|
||||||
return;
|
return;
|
||||||
@@ -48,7 +48,7 @@ public class SpCommand extends Command {
|
|||||||
|
|
||||||
player.updateRemainingSp(newSp);
|
player.updateRemainingSp(newSp);
|
||||||
} else {
|
} else {
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
int newSp = Integer.parseInt(params[1]);
|
int newSp = Integer.parseInt(params[1]);
|
||||||
if (newSp < 0) newSp = 0;
|
if (newSp < 0) newSp = 0;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -37,13 +37,13 @@ public class SummonCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !warphere <playername>");
|
player.yellowMessage("Syntax: !warphere <playername>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim == null) {
|
if (victim == null) {
|
||||||
//If victim isn't on current channel, loop all channels on current world.
|
//If victim isn't on current channel, loop all channels on current world.
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.SkillFactory;
|
import client.SkillFactory;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -35,7 +35,7 @@ public class UnHideCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player);
|
SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,13 +34,13 @@ public class UnJailCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !unjail <playername>");
|
player.yellowMessage("Syntax: !unjail <playername>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
if (victim.getJailExpirationTimeLeft() <= 0) {
|
if (victim.getJailExpirationTimeLeft() <= 0) {
|
||||||
player.message("This player is already free.");
|
player.message("This player is already free.");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.maps.MapleMap;
|
import server.maps.MapleMap;
|
||||||
@@ -38,7 +38,7 @@ public class WarpAreaCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !warparea <mapid>");
|
player.yellowMessage("Syntax: !warparea <mapid>");
|
||||||
return;
|
return;
|
||||||
@@ -53,9 +53,9 @@ public class WarpAreaCommand extends Command {
|
|||||||
|
|
||||||
Point pos = player.getPosition();
|
Point pos = player.getPosition();
|
||||||
|
|
||||||
Collection<MapleCharacter> characters = player.getMap().getAllPlayers();
|
Collection<Character> characters = player.getMap().getAllPlayers();
|
||||||
|
|
||||||
for (MapleCharacter victim : characters) {
|
for (Character victim : characters) {
|
||||||
if (victim.getPosition().distanceSq(pos) <= 50000) {
|
if (victim.getPosition().distanceSq(pos) <= 50000) {
|
||||||
victim.saveLocationOnWarp();
|
victim.saveLocationOnWarp();
|
||||||
victim.changeMap(target, target.getRandomPlayerSpawnpoint());
|
victim.changeMap(target, target.getRandomPlayerSpawnpoint());
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.maps.FieldLimit;
|
import server.maps.FieldLimit;
|
||||||
@@ -37,7 +37,7 @@ public class WarpCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !warp <mapid>");
|
player.yellowMessage("Syntax: !warp <mapid>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.maps.MapleMap;
|
import server.maps.MapleMap;
|
||||||
@@ -37,7 +37,7 @@ public class WarpMapCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !warpmap <mapid>");
|
player.yellowMessage("Syntax: !warpmap <mapid>");
|
||||||
return;
|
return;
|
||||||
@@ -50,9 +50,9 @@ public class WarpMapCommand extends Command {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Collection<MapleCharacter> characters = player.getMap().getAllPlayers();
|
Collection<Character> characters = player.getMap().getAllPlayers();
|
||||||
|
|
||||||
for (MapleCharacter victim : characters) {
|
for (Character victim : characters) {
|
||||||
victim.saveLocationOnWarp();
|
victim.saveLocationOnWarp();
|
||||||
victim.changeMap(target, target.getRandomPlayerSpawnpoint());
|
victim.changeMap(target, target.getRandomPlayerSpawnpoint());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm2;
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.life.MapleMonster;
|
import server.life.MapleMonster;
|
||||||
@@ -40,9 +40,9 @@ public class WhereaMiCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
|
|
||||||
HashSet<MapleCharacter> chars = new HashSet<>();
|
HashSet<Character> chars = new HashSet<>();
|
||||||
HashSet<MapleNPC> npcs = new HashSet<>();
|
HashSet<MapleNPC> npcs = new HashSet<>();
|
||||||
HashSet<MaplePlayerNPC> playernpcs = new HashSet<>();
|
HashSet<MaplePlayerNPC> playernpcs = new HashSet<>();
|
||||||
HashSet<MapleMonster> mobs = new HashSet<>();
|
HashSet<MapleMonster> mobs = new HashSet<>();
|
||||||
@@ -51,8 +51,8 @@ public class WhereaMiCommand extends Command {
|
|||||||
if (mmo instanceof MapleNPC) {
|
if (mmo instanceof MapleNPC) {
|
||||||
MapleNPC npc = (MapleNPC) mmo;
|
MapleNPC npc = (MapleNPC) mmo;
|
||||||
npcs.add(npc);
|
npcs.add(npc);
|
||||||
} else if (mmo instanceof MapleCharacter) {
|
} else if (mmo instanceof Character) {
|
||||||
MapleCharacter mc = (MapleCharacter) mmo;
|
Character mc = (Character) mmo;
|
||||||
chars.add(mc);
|
chars.add(mc);
|
||||||
} else if (mmo instanceof MapleMonster) {
|
} else if (mmo instanceof MapleMonster) {
|
||||||
MapleMonster mob = (MapleMonster) mmo;
|
MapleMonster mob = (MapleMonster) mmo;
|
||||||
@@ -68,7 +68,7 @@ public class WhereaMiCommand extends Command {
|
|||||||
player.yellowMessage("Map ID: " + player.getMap().getId());
|
player.yellowMessage("Map ID: " + player.getMap().getId());
|
||||||
|
|
||||||
player.yellowMessage("Players on this map:");
|
player.yellowMessage("Players on this map:");
|
||||||
for (MapleCharacter chr : chars) {
|
for (Character chr : chars) {
|
||||||
player.dropMessage(5, ">> " + chr.getName() + " - " + chr.getId() + " - Oid: " + chr.getObjectId());
|
player.dropMessage(5, ">> " + chr.getName() + " - " + chr.getId() + " - Oid: " + chr.getObjectId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -42,16 +42,16 @@ public class BanCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 2) {
|
if (params.length < 2) {
|
||||||
player.yellowMessage("Syntax: !ban <IGN> <Reason> (Please be descriptive)");
|
player.yellowMessage("Syntax: !ban <IGN> <Reason> (Please be descriptive)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String ign = params[0];
|
String ign = params[0];
|
||||||
String reason = joinStringFrom(params, 1);
|
String reason = joinStringFrom(params, 1);
|
||||||
MapleCharacter target = c.getChannelServer().getPlayerStorage().getCharacterByName(ign);
|
Character target = c.getChannelServer().getPlayerStorage().getCharacterByName(ign);
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
String readableTargetName = MapleCharacter.makeMapleReadable(target.getName());
|
String readableTargetName = Character.makeMapleReadable(target.getName());
|
||||||
String ip = target.getClient().getRemoteAddress();
|
String ip = target.getClient().getRemoteAddress();
|
||||||
//Ban ip
|
//Ban ip
|
||||||
try (Connection con = DatabaseConnection.getConnection()) {
|
try (Connection con = DatabaseConnection.getConnection()) {
|
||||||
@@ -74,10 +74,10 @@ public class BanCommand extends Command {
|
|||||||
target.yellowMessage("You have been banned by #b" + c.getPlayer().getName() + " #k.");
|
target.yellowMessage("You have been banned by #b" + c.getPlayer().getName() + " #k.");
|
||||||
target.yellowMessage("Reason: " + reason);
|
target.yellowMessage("Reason: " + reason);
|
||||||
c.sendPacket(PacketCreator.getGMEffect(4, (byte) 0));
|
c.sendPacket(PacketCreator.getGMEffect(4, (byte) 0));
|
||||||
final MapleCharacter rip = target;
|
final Character rip = target;
|
||||||
TimerManager.getInstance().schedule(() -> rip.getClient().disconnect(false, false), 5000); //5 Seconds
|
TimerManager.getInstance().schedule(() -> rip.getClient().disconnect(false, false), 5000); //5 Seconds
|
||||||
Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[RIP]: " + ign + " has been banned."));
|
Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[RIP]: " + ign + " has been banned."));
|
||||||
} else if (MapleCharacter.ban(ign, reason, false)) {
|
} else if (Character.ban(ign, reason, false)) {
|
||||||
c.sendPacket(PacketCreator.getGMEffect(4, (byte) 0));
|
c.sendPacket(PacketCreator.getGMEffect(4, (byte) 0));
|
||||||
Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[RIP]: " + ign + " has been banned."));
|
Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[RIP]: " + ign + " has been banned."));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class ChatCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
player.toggleWhiteChat();
|
player.toggleWhiteChat();
|
||||||
player.message("Your chat is now " + (player.getWhiteChat() ? " white" : "normal") + ".");
|
player.message("Your chat is now " + (player.getWhiteChat() ? " white" : "normal") + ".");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.BuffStat;
|
import client.BuffStat;
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ public class CheckDmgCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
int maxBase = victim.calculateMaxBaseDamage(victim.getTotalWatk());
|
int maxBase = victim.calculateMaxBaseDamage(victim.getTotalWatk());
|
||||||
Integer watkBuff = victim.getBuffedValue(BuffStat.WATK);
|
Integer watkBuff = victim.getBuffedValue(BuffStat.WATK);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class ClosePortalCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !closeportal <portalid>");
|
player.yellowMessage("Syntax: !closeportal <portalid>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.MapleDisease;
|
import client.MapleDisease;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -41,7 +41,7 @@ public class DebuffCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !debuff SLOW|SEDUCE|ZOMBIFY|CONFUSE|STUN|POISON|SEAL|DARKNESS|WEAKEN|CURSE");
|
player.yellowMessage("Syntax: !debuff SLOW|SEDUCE|ZOMBIFY|CONFUSE|STUN|POISON|SEAL|DARKNESS|WEAKEN|CURSE");
|
||||||
return;
|
return;
|
||||||
@@ -108,7 +108,7 @@ public class DebuffCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (MapleMapObject mmo : player.getMap().getMapObjectsInRange(player.getPosition(), 777777.7, Arrays.asList(MapleMapObjectType.PLAYER))) {
|
for (MapleMapObject mmo : player.getMap().getMapObjectsInRange(player.getPosition(), 777777.7, Arrays.asList(MapleMapObjectType.PLAYER))) {
|
||||||
MapleCharacter chr = (MapleCharacter) mmo;
|
Character chr = (Character) mmo;
|
||||||
|
|
||||||
if (chr.getId() != player.getId()) {
|
if (chr.getId() != player.getId()) {
|
||||||
chr.giveDebuff(disease, skill);
|
chr.giveDebuff(disease, skill);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class EndEventCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
c.getChannelServer().setEvent(null);
|
c.getChannelServer().setEvent(null);
|
||||||
player.dropMessage(5, "You have ended the event. No more players may join.");
|
player.dropMessage(5, "You have ended the event. No more players may join.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -40,7 +40,7 @@ public class ExpedsCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for (Channel ch : Server.getInstance().getChannelsFromWorld(c.getWorld())) {
|
for (Channel ch : Server.getInstance().getChannelsFromWorld(c.getWorld())) {
|
||||||
List<MapleExpedition> expeds = ch.getExpeditions();
|
List<MapleExpedition> expeds = ch.getExpeditions();
|
||||||
if (expeds.isEmpty()) {
|
if (expeds.isEmpty()) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.MapleStat;
|
import client.MapleStat;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -37,7 +37,7 @@ public class FaceCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !face [<playername>] <faceid>");
|
player.yellowMessage("Syntax: !face [<playername>] <faceid>");
|
||||||
return;
|
return;
|
||||||
@@ -60,7 +60,7 @@ public class FaceCommand extends Command {
|
|||||||
player.yellowMessage("Face id '" + params[1] + "' does not exist.");
|
player.yellowMessage("Face id '" + params[1] + "' does not exist.");
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim == null) {
|
if (victim == null) {
|
||||||
victim.setFace(itemId);
|
victim.setFace(itemId);
|
||||||
victim.updateSingleStat(MapleStat.FACE, itemId);
|
victim.updateSingleStat(MapleStat.FACE, itemId);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.MapleStat;
|
import client.MapleStat;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -35,13 +35,13 @@ public class FameCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 2) {
|
if (params.length < 2) {
|
||||||
player.yellowMessage("Syntax: !fame <playername> <gainfame>");
|
player.yellowMessage("Syntax: !fame <playername> <gainfame>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.setFame(Integer.parseInt(params[1]));
|
victim.setFame(Integer.parseInt(params[1]));
|
||||||
victim.updateSingleStat(MapleStat.FAME, victim.getFame());
|
victim.updateSingleStat(MapleStat.FAME, victim.getFame());
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -35,7 +35,7 @@ public class FlyCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) { // fly option will become available for any character of that account
|
public void execute(MapleClient c, String[] params) { // fly option will become available for any character of that account
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !fly <on/off>");
|
player.yellowMessage("Syntax: !fly <on/off>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class GiveMesosCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !givems [<playername>] <gainmeso>");
|
player.yellowMessage("Syntax: !givems [<playername>] <gainmeso>");
|
||||||
return;
|
return;
|
||||||
@@ -66,7 +66,7 @@ public class GiveMesosCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(recv_);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(recv_);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.gainMeso((int) mesos_, true);
|
victim.gainMeso((int) mesos_, true);
|
||||||
player.message("MESO given.");
|
player.message("MESO given.");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class GiveNxCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !givenx [nx, mp, np] [<playername>] <gainnx>");
|
player.yellowMessage("Syntax: !givenx [nx, mp, np] [<playername>] <gainnx>");
|
||||||
return;
|
return;
|
||||||
@@ -72,7 +72,7 @@ public class GiveNxCommand extends Command {
|
|||||||
value = Integer.parseInt(params[0]);
|
value = Integer.parseInt(params[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(recv);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(recv);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.getCashShop().gainCash(type, value);
|
victim.getCashShop().gainCash(type, value);
|
||||||
player.message(typeStr.toUpperCase() + " given.");
|
player.message(typeStr.toUpperCase() + " given.");
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -11,13 +11,13 @@ public class GiveRpCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient client, String[] params) {
|
public void execute(MapleClient client, String[] params) {
|
||||||
MapleCharacter player = client.getPlayer();
|
Character player = client.getPlayer();
|
||||||
if (params.length < 2) {
|
if (params.length < 2) {
|
||||||
player.yellowMessage("Syntax: !giverp <playername> <gainrewardpoint>");
|
player.yellowMessage("Syntax: !giverp <playername> <gainrewardpoint>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = client.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = client.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.setRewardPoints(victim.getRewardPoints() + Integer.parseInt(params[1]));
|
victim.setRewardPoints(victim.getRewardPoints() + Integer.parseInt(params[1]));
|
||||||
player.message("RP given. Player " + params[0] + " now has " + victim.getRewardPoints()
|
player.message("RP given. Player " + params[0] + " now has " + victim.getRewardPoints()
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,13 +34,13 @@ public class GiveVpCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 2) {
|
if (params.length < 2) {
|
||||||
player.yellowMessage("Syntax: !givevp <playername> <gainvotepoint>");
|
player.yellowMessage("Syntax: !givevp <playername> <gainvotepoint>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.getClient().addVotePoints(Integer.parseInt(params[1]));
|
victim.getClient().addVotePoints(Integer.parseInt(params[1]));
|
||||||
player.message("VP given.");
|
player.message("VP given.");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.MapleStat;
|
import client.MapleStat;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
@@ -37,7 +37,7 @@ public class HairCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !hair [<playername>] <hairid>");
|
player.yellowMessage("Syntax: !hair [<playername>] <hairid>");
|
||||||
return;
|
return;
|
||||||
@@ -61,7 +61,7 @@ public class HairCommand extends Command {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.setHair(itemId);
|
victim.setHair(itemId);
|
||||||
victim.updateSingleStat(MapleStat.HAIR, itemId);
|
victim.updateSingleStat(MapleStat.HAIR, itemId);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,8 +34,8 @@ public class HealMapCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for (MapleCharacter mch : player.getMap().getCharacters()) {
|
for (Character mch : player.getMap().getCharacters()) {
|
||||||
if (mch != null) {
|
if (mch != null) {
|
||||||
mch.healHpMp();
|
mch.healHpMp();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,8 +34,8 @@ public class HealPersonCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.healHpMp();
|
victim.healHpMp();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,8 +34,8 @@ public class HpMpCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
MapleCharacter victim = player;
|
Character victim = player;
|
||||||
int statUpdate = 1;
|
int statUpdate = 1;
|
||||||
|
|
||||||
if (params.length == 2) {
|
if (params.length == 2) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,8 +34,8 @@ public class HurtCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.updateHp(1);
|
victim.updateHp(1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.packet.logging.MapleLogger;
|
import net.packet.logging.MapleLogger;
|
||||||
@@ -37,12 +37,12 @@ public class IgnoreCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !ignore <ign>");
|
player.yellowMessage("Syntax: !ignore <ign>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim == null) {
|
if (victim == null) {
|
||||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.packet.logging.MapleLogger;
|
import net.packet.logging.MapleLogger;
|
||||||
@@ -35,9 +35,9 @@ public class IgnoredCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for (Integer cid : MapleLogger.ignored) {
|
for (Integer cid : MapleLogger.ignored) {
|
||||||
player.yellowMessage(MapleCharacter.getNameById(cid) + " is being ignored.");
|
player.yellowMessage(Character.getNameById(cid) + " is being ignored.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,9 +34,9 @@ public class InMapCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
String st = "";
|
String st = "";
|
||||||
for (MapleCharacter chr : player.getMap().getCharacters()) {
|
for (Character chr : player.getMap().getCharacters()) {
|
||||||
st += chr.getName() + " ";
|
st += chr.getName() + " ";
|
||||||
}
|
}
|
||||||
player.message(st);
|
player.message(st);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.life.MapleMonster;
|
import server.life.MapleMonster;
|
||||||
@@ -41,7 +41,7 @@ public class KillAllCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
MapleMap map = player.getMap();
|
MapleMap map = player.getMap();
|
||||||
List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -36,13 +36,13 @@ public class KillCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !kill <playername>");
|
player.yellowMessage("Syntax: !kill <playername>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim != null) {
|
if (victim != null) {
|
||||||
victim.updateHpMp(0);
|
victim.updateHpMp(0);
|
||||||
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, player.getName() + " used !kill on " + victim.getName()));
|
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, player.getName() + " used !kill on " + victim.getName()));
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,8 +34,8 @@ public class KillMapCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for (MapleCharacter mch : player.getMap().getCharacters()) {
|
for (Character mch : player.getMap().getCharacters()) {
|
||||||
mch.updateHp(0);
|
mch.updateHp(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import tools.PacketCreator;
|
import tools.PacketCreator;
|
||||||
@@ -35,7 +35,7 @@ public class MaxEnergyCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
c.getPlayer().setDojoEnergy(10000);
|
c.getPlayer().setDojoEnergy(10000);
|
||||||
c.sendPacket(PacketCreator.getEnergy("energy", 10000));
|
c.sendPacket(PacketCreator.getEnergy("energy", 10000));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,8 +34,8 @@ public class MaxHpMpCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
MapleCharacter victim = player;
|
Character victim = player;
|
||||||
|
|
||||||
int statUpdate = 1;
|
int statUpdate = 1;
|
||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.packet.logging.MapleLogger;
|
import net.packet.logging.MapleLogger;
|
||||||
@@ -37,12 +37,12 @@ public class MonitorCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !monitor <ign>");
|
player.yellowMessage("Syntax: !monitor <ign>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
if (victim == null) {
|
if (victim == null) {
|
||||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.packet.logging.MapleLogger;
|
import net.packet.logging.MapleLogger;
|
||||||
@@ -35,9 +35,9 @@ public class MonitorsCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
for (Integer cid : MapleLogger.monitored) {
|
for (Integer cid : MapleLogger.monitored) {
|
||||||
player.yellowMessage(MapleCharacter.getNameById(cid) + " is being monitored.");
|
player.yellowMessage(Character.getNameById(cid) + " is being monitored.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import constants.game.GameConstants;
|
import constants.game.GameConstants;
|
||||||
@@ -46,7 +46,7 @@ public class MusicCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
|
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
String sendMsg = "";
|
String sendMsg = "";
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class MuteMapCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (player.getMap().isMuted()) {
|
if (player.getMap().isMuted()) {
|
||||||
player.getMap().setMuted(false);
|
player.getMap().setMuted(false);
|
||||||
player.dropMessage(5, "The map you are in has been un-muted.");
|
player.dropMessage(5, "The map you are in has been un-muted.");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class NightCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
player.getMap().broadcastNightEffect();
|
player.getMap().broadcastNightEffect();
|
||||||
player.yellowMessage("Done.");
|
player.yellowMessage("Done.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -36,7 +36,7 @@ public class NoticeCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[Notice] " + player.getLastCommandMessage()));
|
Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[Notice] " + player.getLastCommandMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import server.life.MapleLifeFactory;
|
import server.life.MapleLifeFactory;
|
||||||
@@ -37,7 +37,7 @@ public class NpcCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !npc <npcid>");
|
player.yellowMessage("Syntax: !npc <npcid>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
@@ -36,15 +36,15 @@ public class OnlineTwoCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
int total = 0;
|
int total = 0;
|
||||||
for (Channel ch : Server.getInstance().getChannelsFromWorld(player.getWorld())) {
|
for (Channel ch : Server.getInstance().getChannelsFromWorld(player.getWorld())) {
|
||||||
int size = ch.getPlayerStorage().getAllCharacters().size();
|
int size = ch.getPlayerStorage().getAllCharacters().size();
|
||||||
total += size;
|
total += size;
|
||||||
String s = "(Channel " + ch.getId() + " Online: " + size + ") : ";
|
String s = "(Channel " + ch.getId() + " Online: " + size + ") : ";
|
||||||
if (ch.getPlayerStorage().getAllCharacters().size() < 50) {
|
if (ch.getPlayerStorage().getAllCharacters().size() < 50) {
|
||||||
for (MapleCharacter chr : ch.getPlayerStorage().getAllCharacters()) {
|
for (Character chr : ch.getPlayerStorage().getAllCharacters()) {
|
||||||
s += MapleCharacter.makeMapleReadable(chr.getName()) + ", ";
|
s += Character.makeMapleReadable(chr.getName()) + ", ";
|
||||||
}
|
}
|
||||||
player.dropMessage(6, s.substring(0, s.length() - 2));
|
player.dropMessage(6, s.substring(0, s.length() - 2));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
package client.command.commands.gm3;
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
import client.MapleCharacter;
|
import client.Character;
|
||||||
import client.MapleClient;
|
import client.MapleClient;
|
||||||
import client.command.Command;
|
import client.command.Command;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class OpenPortalCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(MapleClient c, String[] params) {
|
public void execute(MapleClient c, String[] params) {
|
||||||
MapleCharacter player = c.getPlayer();
|
Character player = c.getPlayer();
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
player.yellowMessage("Syntax: !openportal <portalid>");
|
player.yellowMessage("Syntax: !openportal <portalid>");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user