Horntail PQ & Exped + Equip levelup fix
Added Horntail PQ and boss fight. Fixed short integer overflow of equipment stats on client messing up player stats.
This commit is contained in:
@@ -699,14 +699,19 @@ public class MapleStatEffect {
|
||||
}
|
||||
|
||||
public boolean applyTo(MapleCharacter chr) {
|
||||
return applyTo(chr, chr, true, null);
|
||||
return applyTo(chr, chr, true, null, false);
|
||||
}
|
||||
|
||||
public boolean applyTo(MapleCharacter chr, boolean useMaxRange) {
|
||||
return applyTo(chr, chr, true, null, useMaxRange);
|
||||
}
|
||||
|
||||
public boolean applyTo(MapleCharacter chr, Point pos) {
|
||||
return applyTo(chr, chr, true, pos);
|
||||
return applyTo(chr, chr, true, pos, false);
|
||||
}
|
||||
|
||||
private boolean applyTo(MapleCharacter applyfrom, MapleCharacter applyto, boolean primary, Point pos) {
|
||||
// primary: the player caster of the buff
|
||||
private boolean applyTo(MapleCharacter applyfrom, MapleCharacter applyto, boolean primary, Point pos, boolean useMaxRange) {
|
||||
if (skill && (sourceid == GM.HIDE || sourceid == SuperGM.HIDE)) {
|
||||
applyto.toggleHide(false);
|
||||
return true;
|
||||
@@ -724,11 +729,14 @@ public class MapleStatEffect {
|
||||
}
|
||||
}
|
||||
List<Pair<MapleStat, Integer>> hpmpupdate = new ArrayList<>(2);
|
||||
if (!primary && isResurrection()) {
|
||||
hpchange = applyto.getMaxHp();
|
||||
applyto.setStance(0);
|
||||
applyto.getMap().broadcastMessage(applyto, MaplePacketCreator.removePlayerFromMap(applyto.getId()), false);
|
||||
applyto.getMap().broadcastMessage(applyto, MaplePacketCreator.spawnPlayerMapobject(applyto), false);
|
||||
if (!primary) {
|
||||
if(isResurrection()) {
|
||||
hpchange = applyto.getMaxHp();
|
||||
applyto.setStance(0);
|
||||
|
||||
applyto.getMap().broadcastMessage(applyto, MaplePacketCreator.removePlayerFromMap(applyto.getId()), false);
|
||||
applyto.getMap().broadcastMessage(applyto, MaplePacketCreator.spawnPlayerMapobject(applyto), false);
|
||||
}
|
||||
}
|
||||
if (isDispel() && makeChanceResult()) {
|
||||
applyto.dispelDebuffs();
|
||||
@@ -818,7 +826,7 @@ public class MapleStatEffect {
|
||||
}
|
||||
|
||||
if (primary && (overTime || isHeal())) {
|
||||
applyBuff(applyfrom);
|
||||
applyBuff(applyfrom, useMaxRange);
|
||||
}
|
||||
|
||||
if (primary && isMonsterBuff()) {
|
||||
@@ -872,13 +880,17 @@ public class MapleStatEffect {
|
||||
applyfrom.getMap().spawnMist(mist, getDuration(), mist.isPoisonMist(), false, mist.isRecoveryMist());
|
||||
} else if(isTimeLeap()) {
|
||||
applyto.removeAllCooldownsExcept(Buccaneer.TIME_LEAP, true);
|
||||
} else if(isHyperBody() && !primary) {
|
||||
applyto.getMap().broadcastMessage(applyto, MaplePacketCreator.removePlayerFromMap(applyto.getId()), false);
|
||||
applyto.getMap().broadcastMessage(applyto, MaplePacketCreator.spawnPlayerMapobject(applyto), false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void applyBuff(MapleCharacter applyfrom) {
|
||||
private void applyBuff(MapleCharacter applyfrom, boolean useMaxRange) {
|
||||
if (isPartyBuff() && (applyfrom.getParty() != null || isGmBuff())) {
|
||||
Rectangle bounds = calculateBoundingBox(applyfrom.getPosition(), applyfrom.isFacingLeft());
|
||||
Rectangle bounds = (!useMaxRange) ? calculateBoundingBox(applyfrom.getPosition(), applyfrom.isFacingLeft()) : new Rectangle(Integer.MIN_VALUE / 2, Integer.MIN_VALUE / 2, Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
List<MapleMapObject> affecteds = applyfrom.getMap().getMapObjectsInRect(bounds, Arrays.asList(MapleMapObjectType.PLAYER));
|
||||
List<MapleCharacter> affectedp = new ArrayList<>(affecteds.size());
|
||||
for (MapleMapObject affectedmo : affecteds) {
|
||||
@@ -890,7 +902,7 @@ public class MapleStatEffect {
|
||||
}
|
||||
}
|
||||
for (MapleCharacter affected : affectedp) {
|
||||
applyTo(applyfrom, affected, false, null);
|
||||
applyTo(applyfrom, affected, false, null, useMaxRange);
|
||||
affected.getClient().announce(MaplePacketCreator.showOwnBuffEffect(sourceid, 2));
|
||||
affected.getMap().broadcastMessage(affected, MaplePacketCreator.showBuffeffect(affected.getId(), sourceid, 2), false);
|
||||
}
|
||||
@@ -1379,6 +1391,10 @@ public class MapleStatEffect {
|
||||
private boolean isCygnusFA() {
|
||||
return skill && (sourceid == DawnWarrior.FINAL_ATTACK || sourceid == WindArcher.FINAL_ATTACK);
|
||||
}
|
||||
|
||||
private boolean isHyperBody() {
|
||||
return skill && (sourceid == Spearman.HYPER_BODY || sourceid == GM.HYPER_BODY || sourceid == SuperGM.HYPER_BODY);
|
||||
}
|
||||
|
||||
private boolean isComboReset() {
|
||||
return sourceid == Aran.COMBO_BARRIER || sourceid == Aran.COMBO_DRAIN;
|
||||
|
||||
@@ -38,7 +38,8 @@ import constants.ServerConstants;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Matze, Ronan (concurrency safety)
|
||||
* @author Matze
|
||||
* @author Ronan (concurrency safety)
|
||||
*/
|
||||
public class MapleTrade {
|
||||
private MapleTrade partner = null;
|
||||
|
||||
@@ -54,6 +54,7 @@ public class MapleNPC extends AbstractLoadedMapleLife {
|
||||
|
||||
@Override
|
||||
public void sendDestroyData(MapleClient client) {
|
||||
client.announce(MaplePacketCreator.removeNPCController(getObjectId()));
|
||||
client.announce(MaplePacketCreator.removeNPC(getObjectId()));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@ import client.MapleCharacter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Matze, Ronan
|
||||
* @author Matze
|
||||
* @author Ronan
|
||||
*/
|
||||
public class MapleDoor {
|
||||
private int ownerId;
|
||||
|
||||
@@ -722,6 +722,14 @@ public class MapleMap {
|
||||
}
|
||||
return mobs;
|
||||
}
|
||||
|
||||
public void broadcastHorntailVictory() {
|
||||
for (Channel cserv : Server.getInstance().getWorld(world).getChannels()) {
|
||||
for (MapleCharacter player : cserv.getPlayerStorage().getAllCharacters()) {
|
||||
player.dropMessage("To the crew that have finally conquered Horned Tail after numerous attempts, I salute thee! You are the true heroes of Leafre!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void killMonster(final MapleMonster monster, final MapleCharacter chr, final boolean withDrops) {
|
||||
killMonster(monster, chr, withDrops, 1);
|
||||
@@ -760,13 +768,7 @@ public class MapleMap {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (monster.getId() == 8810018 && chr.getMapId() == 240060200) {
|
||||
for (Channel cserv : Server.getInstance().getWorld(world).getChannels()) {
|
||||
for (MapleCharacter player : cserv.getPlayerStorage().getAllCharacters()) {
|
||||
player.dropMessage("To the crew that have finally conquered Horned Tail after numerous attempts, I salute thee! You are the true heroes of Leafre!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spawnedMonstersOnMap.decrementAndGet();
|
||||
monster.setHp(0);
|
||||
//if (monster.getStats().selfDestruction() == null) {//FUU BOMBS D:
|
||||
@@ -1084,6 +1086,24 @@ public class MapleMap {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void destroyNPC(int npcid) {
|
||||
List<MapleMapObject> npcs = getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.NPC));
|
||||
|
||||
objectWLock.lock();
|
||||
try {
|
||||
for (MapleMapObject obj : npcs) {
|
||||
if (((MapleNPC) obj).getId() == npcid) {
|
||||
broadcastMessage(MaplePacketCreator.removeNPCController(obj.getObjectId()));
|
||||
broadcastMessage(MaplePacketCreator.removeNPC(obj.getObjectId()));
|
||||
|
||||
this.mapobjects.remove(Integer.valueOf(obj.getObjectId()));
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
objectWLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public MapleMapObject getMapObject(int oid) {
|
||||
objectRLock.lock();
|
||||
@@ -1905,8 +1925,12 @@ public class MapleMap {
|
||||
}
|
||||
}
|
||||
|
||||
public void dropMessage(int type, String message) {
|
||||
broadcastStringMessage(type, message);
|
||||
}
|
||||
|
||||
public void broadcastStringMessage(int type, String message) {
|
||||
broadcastMessage(MaplePacketCreator.serverNotice(type, message));
|
||||
broadcastMessage(MaplePacketCreator.serverNotice(type, message));
|
||||
}
|
||||
|
||||
public void broadcastMessage(final byte[] packet) {
|
||||
@@ -2888,7 +2912,7 @@ public class MapleMap {
|
||||
objectRLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setMobInterval(short interval) {
|
||||
this.mobInterval = interval;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@ import tools.Randomizer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Tyler (Twdtwd), Ronan
|
||||
* @author Tyler (Twdtwd)
|
||||
* @author Ronan
|
||||
*/
|
||||
public class ItemAction extends MapleQuestAction {
|
||||
List<ItemData> items = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user