Mob banish on touch + GMS-like cosmetics + Clear missing names

Fixed erroneous clean slate scroll block on equipments having certain properties.
Implemented a log for bought cash items from Cash Shop.
Implemented mob's player banish by touch (e. g. used by mobs from the Hypnotize quest).
Thoroughly revised stylist/surgeon NPCs, adding several missing GMS-like cosmetic contents.
Thoroughly revised String.wz names having missing item content throughout the WZ files.
Revised missing name info for several faces throughout the WZ files.
Solved a possible deadlock case related with a player vision's spawn object method.
Fixed an issue with "Movement allowed only within account" items being given as "Untradeable" by NPCs.

Happy Holidays and Great New Year everyone!!!
This commit is contained in:
ronancpl
2018-12-22 00:12:13 -02:00
parent a2b8f22e66
commit dc73cb00de
184 changed files with 12897 additions and 3647 deletions

View File

@@ -97,7 +97,7 @@ public enum MapleBuffStat {
PICKPOCKET(0x800000000000000L),
PUPPET(0x800000000000000L),
MESOGUARD(0x1000000000000000L),
//0x2000000000000000L
EXP_INCREASE(0x2000000000000000L),
WEAKEN(0x4000000000000000L),
//THAT GAP

View File

@@ -1243,9 +1243,11 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
int banSp = this.getMap().findClosestPlayerSpawnpoint(this.getPosition()).getId();
long banTime = System.currentTimeMillis();
dropMessage(5, msg);
if (msg != null) dropMessage(5, msg);
MapleMap map_ = getWarpMap(mapid);
changeMap(map_, map_.getPortal(portal));
MaplePortal portal_ = map_.getPortal(portal);
changeMap(map_, portal_ != null ? portal_ : map_.getRandomPlayerSpawnpoint());
setBanishPlayerData(banMap, banSp, banTime);
}
@@ -2123,7 +2125,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
}
}
try (PreparedStatement ps2 = con.prepareStatement("DELETE FROM inventoryequipment WHERE inventoryitemid = ?")) {
ps2.setInt(1, inventoryitemid);
ps2.executeUpdate();
@@ -2897,7 +2899,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
gainExpInternal(-loss, 0, 0, show, inChat, white);
}
private void gainExpInternal(long gain, int equip, int party, boolean show, boolean inChat, boolean white) {
private synchronized void gainExpInternal(long gain, int equip, int party, boolean show, boolean inChat, boolean white) { // need of method synchonization here detected thanks to MedicOP
long total = Math.max(gain, -exp.get());
if (level < getMaxLevel()) {
@@ -5161,7 +5163,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
return rankMove;
}
private void clearSavedLocation(SavedLocationType type) {
public void clearSavedLocation(SavedLocationType type) {
savedLocations[type.ordinal()] = null;
}
@@ -7441,6 +7443,17 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
}
public void saveLocationOnWarp() { // suggestion to remember the map before warp command thanks to Lei
MaplePortal closest = map.findClosestPortal(getPosition());
int curMapid = getMapId();
for (int i = 0; i < savedLocations.length; i++) {
if (savedLocations[i] == null) {
savedLocations[i] = new SavedLocation(curMapid, closest != null ? closest.getId() : 0);
}
}
}
public void saveLocation(String type) {
MaplePortal closest = map.findClosestPortal(getPosition());
savedLocations[SavedLocationType.fromString(type).ordinal()] = new SavedLocation(getMapId(), closest != null ? closest.getId() : 0);
@@ -8612,8 +8625,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
/*
for (Entry<StatUpgrade, Float> e : statups.entrySet()) {
System.out.println(e);
for (Entry<StatUpgrade, Float> es : statups.entrySet()) {
System.out.println(es);
}
*/

View File

@@ -216,6 +216,7 @@ public class CommandsExecutor {
addCommand("dc", 2, DcCommand.class);
addCommand("cleardrops", 2, ClearDropsCommand.class);
addCommand("clearslot", 2, ClearSlotCommand.class);
addCommand("clearsavelocs", 2, ClearSavedLocationsCommand.class);
addCommand("warp", 2, WarpCommand.class);
addCommand(new String[]{"warphere", "summon"}, 2, SummonCommand.class);
addCommand(new String[]{"warpto", "reach", "follow"}, 2, ReachCommand.class);
@@ -229,7 +230,6 @@ public class CommandsExecutor {
addCommand("maxstat", 2, MaxStatCommand.class);
addCommand("maxskill", 2, MaxSkillCommand.class);
addCommand("resetskill", 2, ResetSkillCommand.class);
addCommand("mesos", 2, MesosCommand.class);
addCommand("search", 2, SearchCommand.class);
addCommand("jail", 2, JailCommand.class);
addCommand("unjail", 2, UnJailCommand.class);

View File

@@ -49,6 +49,7 @@ public class JoinEventCommand extends Command {
event.minusLimit();
player.saveLocationOnWarp();
player.changeMap(event.getMapId());
} else {
player.dropMessage(5, "The limit of players for the event has already been reached.");

View File

@@ -46,6 +46,7 @@ public class LeaveEventCommand extends Command {
player.setFitness(null);
}
player.saveLocationOnWarp();
player.changeMap(returnMap);
if(c.getChannelServer().getEvent() != null) {
c.getChannelServer().getEvent().addLimit();

View File

@@ -51,6 +51,7 @@ public class GotoCommand extends Command {
// expedition issue with this command detected thanks to Masterrulax
MaplePortal targetPortal = target.getRandomPlayerSpawnpoint();
player.saveLocationOnWarp();
player.changeMap(target, targetPortal);
} else {
player.dropMessage(5, "Area '" + params[0] + "' is not registered.");

View File

@@ -26,17 +26,31 @@ package client.command.commands.gm2;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import server.maps.SavedLocationType;
public class MesosCommand extends Command {
public class ClearSavedLocationsCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
if (params.length >= 1) {
player.gainMeso(Integer.parseInt(params[0]), true);
MapleCharacter player = c.getPlayer(), victim;
if (params.length > 0) {
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim == null) {
player.message("Player '" + params[0] + "' could not be found on this channel.");
return;
}
} else {
victim = c.getPlayer();
}
for (SavedLocationType type : SavedLocationType.values()) {
victim.clearSavedLocation(type);
}
player.message("Cleared " + params[0] + "'s saved locations.");
}
}

View File

@@ -60,6 +60,7 @@ public class JailCommand extends Command {
if (victim.getMapId() != mapid) { // those gone to jail won't be changing map anyway
MapleMap target = c.getChannelServer().getMapFactory().getMap(mapid);
MaplePortal targetPortal = target.getPortal(0);
victim.saveLocationOnWarp();
victim.changeMap(target, targetPortal);
player.message(victim.getName() + " was jailed for " + minutesJailed + " minutes.");
} else {

View File

@@ -47,6 +47,7 @@ public class ReachCommand extends Command {
player.dropMessage(5, "Player '" + victim.getName() + "' is at channel " + victim.getClient().getChannel() + ".");
} else {
MapleMap map = victim.getMap();
player.saveLocationOnWarp();
player.forceChangeMap(map, map.findClosestPortal(victim.getPosition()));
}
} else {

View File

@@ -23,7 +23,6 @@
*/
package client.command.commands.gm2;
import client.MapleStat;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
@@ -45,7 +44,7 @@ public class SetStatCommand extends Command {
int x = Integer.parseInt(params[0]);
if (x > Short.MAX_VALUE) x = Short.MAX_VALUE;
else if (x < 0) x = 0;
else if (x < 4) x = 4; // thanks Vcoc for pointing the minimal allowed stat value here
player.updateStrDexIntLuk(x);
} catch (NumberFormatException nfe) {}

View File

@@ -68,11 +68,13 @@ public class SummonCommand extends Command {
if (player.getEventInstance() != null && changingEvent) {
if (player.getClient().getChannel() == victim.getClient().getChannel()) {
player.getEventInstance().registerPlayer(victim);
victim.saveLocationOnWarp();
victim.changeMap(player.getEventInstance().getMapInstance(player.getMapId()), player.getMap().findClosestPortal(player.getPosition()));
} else {
player.dropMessage("Target isn't on your channel, not able to warp into event instance.");
}
} else {//If victim isn't in an event instance or is in the same event instance as the one the caller is, just warp them.
victim.saveLocationOnWarp();
victim.changeMap(player.getMapId(), player.getMap().findClosestPortal(player.getPosition()));
}
if (player.getClient().getChannel() != victim.getClient().getChannel()) {//And then change channel if needed.

View File

@@ -49,6 +49,7 @@ public class WarpCommand extends Command {
}
// expedition issue with this command detected thanks to Masterrulax
player.saveLocationOnWarp();
player.changeMap(target, target.getRandomPlayerSpawnpoint());
} catch (Exception ex) {
player.yellowMessage("Map ID " + params[0] + " is invalid.");

View File

@@ -41,6 +41,7 @@ public class ReloadMapCommand extends Command {
int callerid = c.getPlayer().getId();
for (MapleCharacter chr : oldMap.getCharacters()) {
chr.saveLocationOnWarp();
chr.changeMap(newMap);
if (chr.getId() != callerid)
chr.dropMessage("You have been relocated due to map reloading. Sorry for the inconvenience.");

View File

@@ -40,6 +40,7 @@ public class WarpSnowBallCommand extends Command {
MapleCharacter player = c.getPlayer();
List<MapleCharacter> chars = new ArrayList<>(player.getMap().getCharacters());
for (MapleCharacter chr : chars) {
chr.saveLocationOnWarp();
chr.changeMap(109060000, chr.getTeam());
}
}