Maplers' Well-known Battlegrounds
Fulfilled merge of Drago's AriantPQ PR #438 into the source! Adjusted MCPQ map limits predicted within battlefield's map info node. Added max number-of-players option when creating a AriantPQ lobby. Added party creation check when trying to create one inside the AriantPQ rooms. Adjusted several AriantPQ mechanics, in order to either improve the existent features or make those that was still unavailable work seamlessly (score update, ariant batlle points).
This commit is contained in:
@@ -47,6 +47,7 @@ public enum MapleBuffStat {
|
||||
GHOST_MORPH(0x20000L),
|
||||
AURA(0x40000L),
|
||||
CONFUSE(0x80000L),
|
||||
ARIANT_PQ_SHIELD(0x40000L),
|
||||
|
||||
// ------ COUPON feature ------
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ import server.life.MaplePlayerNPC;
|
||||
import server.life.MonsterDropEntry;
|
||||
import server.maps.SavedLocation;
|
||||
import server.maps.SavedLocationType;
|
||||
import server.partyquest.AriantColiseum;
|
||||
import server.partyquest.MonsterCarnival;
|
||||
import server.partyquest.MonsterCarnivalParty;
|
||||
import server.partyquest.PartyQuest;
|
||||
@@ -131,7 +132,6 @@ import client.processor.FredrickProcessor;
|
||||
import constants.ExpTable;
|
||||
import constants.GameConstants;
|
||||
import constants.ItemConstants;
|
||||
import constants.LanguageConstants;
|
||||
import constants.ServerConstants;
|
||||
import constants.skills.Aran;
|
||||
import constants.skills.Beginner;
|
||||
@@ -166,7 +166,6 @@ import server.life.MobSkillFactory;
|
||||
import server.maps.MapleMapItem;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||
import scripting.AbstractPlayerInteraction;
|
||||
|
||||
public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
private static final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
@@ -196,7 +195,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
private int battleshipHp = 0;
|
||||
private int mesosTraded = 0;
|
||||
private int possibleReports = 10;
|
||||
private int dojoPoints, vanquisherStage, dojoStage, dojoEnergy, vanquisherKills;
|
||||
private int ariantPoints, dojoPoints, vanquisherStage, dojoStage, dojoEnergy, vanquisherKills;
|
||||
private int expRate = 1, mesoRate = 1, dropRate = 1, expCoupon = 1, mesoCoupon = 1, dropCoupon = 1;
|
||||
private int omokwins, omokties, omoklosses, matchcardwins, matchcardties, matchcardlosses;
|
||||
private int owlSearch;
|
||||
@@ -1979,13 +1978,14 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
showHint("You have earned #e#b" + nxGain + " NX#k#n. (" + this.getCashShop().getCash(1) + " NX)", 300);
|
||||
} else if (applyConsumeOnPickup(mItem.getItemId())) {
|
||||
} else if (MapleInventoryManipulator.addFromDrop(client, mItem, true)) {
|
||||
} else if (mItem.getItemId() == 4031868) {
|
||||
this.getMap().broadcastMessage(MaplePacketCreator.updateAriantPQRanking(this.getName(), this.getItemQuantity(4031868, false), false));
|
||||
if (mItem.getItemId() == 4031868) {
|
||||
updateAriantScore();
|
||||
}
|
||||
} else {
|
||||
client.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.getMap().pickItemDrop(pickupPacket, mapitem);
|
||||
} else if(!hasSpaceInventory) {
|
||||
client.announce(MaplePacketCreator.getInventoryFull());
|
||||
@@ -3175,6 +3175,21 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
public static int getAriantSlotsRoom(int room) {
|
||||
return ariantroomslot[room];
|
||||
}
|
||||
|
||||
public void updateAriantScore() {
|
||||
updateAriantScore(0);
|
||||
}
|
||||
|
||||
public void updateAriantScore(int dropQty) {
|
||||
AriantColiseum arena = this.getAriantColiseum();
|
||||
if (arena != null) {
|
||||
arena.updateAriantScore(this, countItem(4031868));
|
||||
|
||||
if (dropQty > 0) {
|
||||
arena.addLostShards(dropQty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getBattleshipHp() {
|
||||
return battleshipHp;
|
||||
@@ -5894,6 +5909,11 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
if (map.unclaimOwnership(this)) {
|
||||
map.dropMessage(5, "This lawn is now free real estate.");
|
||||
}
|
||||
|
||||
AriantColiseum arena = this.getAriantColiseum();
|
||||
if (arena != null) {
|
||||
arena.leaveArena(this);
|
||||
}
|
||||
}
|
||||
|
||||
private int getChangedJobSp(MapleJob newJob) {
|
||||
@@ -6685,6 +6705,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
ret.monsterbook = new MonsterBook();
|
||||
ret.monsterbook.loadCards(charid);
|
||||
ret.vanquisherStage = rs.getInt("vanquisherStage");
|
||||
ret.ariantPoints = rs.getInt("ariantPoints");
|
||||
ret.dojoPoints = rs.getInt("dojoPoints");
|
||||
ret.dojoStage = rs.getInt("lastDojoStage");
|
||||
ret.dataString = rs.getString("dataString");
|
||||
@@ -7137,12 +7158,12 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
|
||||
private void playerDead() {
|
||||
if (this.getMap().isCPQMap()) {
|
||||
int lost = getCP();
|
||||
if (lost > 6) {
|
||||
lost = 6;
|
||||
int losing = getMap().getDeathCP();
|
||||
if (getCP() < losing) {
|
||||
losing = getCP();
|
||||
}
|
||||
getMap().broadcastMessage(MaplePacketCreator.playerDiedMessage(getName(), lost, getTeam()));
|
||||
gainCP(-lost);
|
||||
getMap().broadcastMessage(MaplePacketCreator.playerDiedMessage(getName(), losing, getTeam()));
|
||||
gainCP(-losing);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7952,7 +7973,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
|
||||
con.setAutoCommit(false);
|
||||
PreparedStatement ps;
|
||||
ps = con.prepareStatement("UPDATE characters SET level = ?, fame = ?, str = ?, dex = ?, luk = ?, `int` = ?, exp = ?, gachaexp = ?, hp = ?, mp = ?, maxhp = ?, maxmp = ?, sp = ?, ap = ?, gm = ?, skincolor = ?, gender = ?, job = ?, hair = ?, face = ?, map = ?, meso = ?, hpMpUsed = ?, spawnpoint = ?, party = ?, buddyCapacity = ?, messengerid = ?, messengerposition = ?, mountlevel = ?, mountexp = ?, mounttiredness= ?, equipslots = ?, useslots = ?, setupslots = ?, etcslots = ?, monsterbookcover = ?, vanquisherStage = ?, dojoPoints = ?, lastDojoStage = ?, finishedDojoTutorial = ?, vanquisherKills = ?, matchcardwins = ?, matchcardlosses = ?, matchcardties = ?, omokwins = ?, omoklosses = ?, omokties = ?, dataString = ?, fquest = ?, jailexpire = ?, partnerId = ?, marriageItemId = ?, lastExpGainTime = ? WHERE id = ?", Statement.RETURN_GENERATED_KEYS);
|
||||
ps = con.prepareStatement("UPDATE characters SET level = ?, fame = ?, str = ?, dex = ?, luk = ?, `int` = ?, exp = ?, gachaexp = ?, hp = ?, mp = ?, maxhp = ?, maxmp = ?, sp = ?, ap = ?, gm = ?, skincolor = ?, gender = ?, job = ?, hair = ?, face = ?, map = ?, meso = ?, hpMpUsed = ?, spawnpoint = ?, party = ?, buddyCapacity = ?, messengerid = ?, messengerposition = ?, mountlevel = ?, mountexp = ?, mounttiredness= ?, equipslots = ?, useslots = ?, setupslots = ?, etcslots = ?, monsterbookcover = ?, vanquisherStage = ?, dojoPoints = ?, lastDojoStage = ?, finishedDojoTutorial = ?, vanquisherKills = ?, matchcardwins = ?, matchcardlosses = ?, matchcardties = ?, omokwins = ?, omoklosses = ?, omokties = ?, dataString = ?, fquest = ?, jailexpire = ?, partnerId = ?, marriageItemId = ?, lastExpGainTime = ?, ariantPoints = ? WHERE id = ?", Statement.RETURN_GENERATED_KEYS);
|
||||
if (gmLevel < 1 && level > 199) {
|
||||
ps.setInt(1, isCygnus() ? 120 : 200);
|
||||
} else {
|
||||
@@ -8066,7 +8087,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
ps.setInt(51, partnerId);
|
||||
ps.setInt(52, marriageItemid);
|
||||
ps.setTimestamp(53, new Timestamp(lastExpGainTime));
|
||||
ps.setInt(54, id);
|
||||
ps.setInt(54, ariantPoints);
|
||||
ps.setInt(55, id);
|
||||
|
||||
int updateRows = ps.executeUpdate();
|
||||
ps.close();
|
||||
@@ -10231,13 +10253,16 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
|
||||
// MCPQ
|
||||
|
||||
private int cp = 0;
|
||||
private int totCP = 0;
|
||||
public AriantColiseum ariantColiseum;
|
||||
private MonsterCarnival monsterCarnival;
|
||||
private MonsterCarnivalParty monsterCarnivalParty = null;
|
||||
|
||||
private int cp = 0;
|
||||
private int totCP = 0;
|
||||
private int FestivalPoints;
|
||||
private boolean challenged = false;
|
||||
|
||||
public short totalCP, availableCP;
|
||||
|
||||
public void gainFestivalPoints(int gain) {
|
||||
this.FestivalPoints += gain;
|
||||
}
|
||||
@@ -10254,8 +10279,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
return cp;
|
||||
}
|
||||
|
||||
public short totalCP, availableCP;
|
||||
|
||||
public void addCP(int ammount) {
|
||||
totalCP += ammount;
|
||||
availableCP += ammount;
|
||||
@@ -10318,6 +10341,14 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
this.monsterCarnival = monsterCarnival;
|
||||
}
|
||||
|
||||
public AriantColiseum getAriantColiseum() {
|
||||
return ariantColiseum;
|
||||
}
|
||||
|
||||
public void setAriantColiseum(AriantColiseum ariantColiseum) {
|
||||
this.ariantColiseum = ariantColiseum;
|
||||
}
|
||||
|
||||
public MonsterCarnivalParty getMonsterCarnivalParty() {
|
||||
return this.monsterCarnivalParty;
|
||||
}
|
||||
@@ -10333,6 +10364,14 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
public void setChallenged(boolean challenged) {
|
||||
this.challenged = challenged;
|
||||
}
|
||||
|
||||
public void gainAriantPoints(int points) {
|
||||
this.ariantPoints += points;
|
||||
}
|
||||
|
||||
public int getAriantPoints() {
|
||||
return this.ariantPoints;
|
||||
}
|
||||
|
||||
public void setLanguage(int num) {
|
||||
getClient().setLanguage(num);
|
||||
@@ -10354,4 +10393,4 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
return getClient().getLanguage();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -901,6 +901,10 @@ public class MapleClient {
|
||||
if (player.getMonsterCarnival() != null) {
|
||||
player.getMonsterCarnival().playerDisconnected(getPlayer().getId());
|
||||
}
|
||||
|
||||
if (player.getAriantColiseum() != null) {
|
||||
player.getAriantColiseum().playerDisconnected(getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getMap() != null) {
|
||||
|
||||
@@ -29,7 +29,7 @@ public enum MapleDisease {
|
||||
SEDUCE(0x80, 128),
|
||||
FISHABLE(0x100),
|
||||
ZOMBIFY(0x4000),
|
||||
CONFUSE(0x80000),
|
||||
CONFUSE(0x80000, 132),
|
||||
STUN(0x2000000000000L, 123),
|
||||
POISON(0x4000000000000L, 125),
|
||||
SEAL(0x8000000000000L, 120),
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BossHpCommand extends Command {
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for(MapleMonster monster : player.getMap().getMonsters()) {
|
||||
for(MapleMonster monster : player.getMap().getAllMonsters()) {
|
||||
if(monster != null && monster.isBoss() && monster.getHp() > 0) {
|
||||
long percent = monster.getHp() * 100L / monster.getMaxHp();
|
||||
String bar = "[";
|
||||
|
||||
@@ -36,7 +36,7 @@ public class MobHpCommand extends Command {
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for(MapleMonster monster : player.getMap().getMonsters()) {
|
||||
for(MapleMonster monster : player.getMap().getAllMonsters()) {
|
||||
if (monster != null && monster.getHp() > 0) {
|
||||
player.yellowMessage(monster.getName() + " (" + monster.getId() + ") has " + monster.getHp() + " / " + monster.getMaxHp() + " HP.");
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import net.server.Server;
|
||||
import net.server.channel.Channel;
|
||||
import server.expeditions.MapleExpedition;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class ExpedsCommand extends Command {
|
||||
@@ -41,13 +42,14 @@ public class ExpedsCommand extends Command {
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (Channel ch : Server.getInstance().getChannelsFromWorld(c.getWorld())) {
|
||||
if (ch.getExpeditions().isEmpty()) {
|
||||
List<MapleExpedition> expeds = ch.getExpeditions();
|
||||
if (expeds.isEmpty()) {
|
||||
player.yellowMessage("No Expeditions in Channel " + ch.getId());
|
||||
continue;
|
||||
}
|
||||
player.yellowMessage("Expeditions in Channel " + ch.getId());
|
||||
int id = 0;
|
||||
for (MapleExpedition exped : ch.getExpeditions()) {
|
||||
for (MapleExpedition exped : expeds) {
|
||||
id++;
|
||||
player.yellowMessage("> Expedition " + id);
|
||||
player.yellowMessage(">> Type: " + exped.getType().toString());
|
||||
|
||||
@@ -64,8 +64,10 @@ public class ForceVacCommand extends Command {
|
||||
continue;
|
||||
}
|
||||
MapleInventoryManipulator.addById(c, mapItem.getItem().getItemId(), mapItem.getItem().getQuantity(), null, petId);
|
||||
} else {
|
||||
MapleInventoryManipulator.addFromDrop(c, mapItem.getItem(), true);
|
||||
} else if (MapleInventoryManipulator.addFromDrop(c, mapItem.getItem(), true)) {
|
||||
if (mapItem.getItemId() == 4031868) {
|
||||
player.updateAriantScore();
|
||||
}
|
||||
}
|
||||
|
||||
player.getMap().pickItemDrop(MaplePacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem);
|
||||
|
||||
@@ -658,14 +658,6 @@ public class MapleInventoryManipulator {
|
||||
}
|
||||
|
||||
MapleMap map = chr.getMap();
|
||||
if (chr.getItemEffect() == itemId && source.getQuantity() == 1) {
|
||||
chr.setItemEffect(0);
|
||||
map.broadcastMessage(MaplePacketCreator.itemEffect(chr.getId(), 0));
|
||||
} else if (itemId == 5370000 || itemId == 5370001) {
|
||||
if (chr.getItemQuantity(itemId, false) == 1) {
|
||||
chr.setChalkboard(null);
|
||||
}
|
||||
}
|
||||
if ((!ItemConstants.isRechargeable(itemId) && source.getQuantity() < quantity) || quantity < 0) {
|
||||
return;
|
||||
}
|
||||
@@ -735,6 +727,20 @@ public class MapleInventoryManipulator {
|
||||
map.spawnItemDrop(chr, chr, source, dropPos, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
int quantityNow = chr.getItemQuantity(itemId, false);
|
||||
if (itemId == chr.getItemEffect()) {
|
||||
if (quantityNow <= 0) {
|
||||
chr.setItemEffect(0);
|
||||
map.broadcastMessage(MaplePacketCreator.itemEffect(chr.getId(), 0));
|
||||
}
|
||||
} else if (itemId == 5370000 || itemId == 5370001) {
|
||||
if (source.getQuantity() <= 0) {
|
||||
chr.setChalkboard(null);
|
||||
}
|
||||
} else if (itemId == 4031868) {
|
||||
chr.updateAriantScore(quantityNow);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isDroppedItemRestricted(Item it) {
|
||||
|
||||
Reference in New Issue
Block a user