CPQ tidyup patch + Guild Creation matcher + Solution to Login Accid=0
Adjusted AP gains, to get it to work following the AP Reset check method. Fixed usage of inexistent itemids on CPQ and fishing. Fixed one-of-a-kind items being lost in player trades due to missing inventory checks. Implemented matching system for the guild creation phase. All players intending to join the new guild must be on the Guild Headquartes and accept the creation of the guild. Fixed changing jobs not properly updating info on the party tab. Fixed double tooltip information on CPQ actions UI. Fixed CPQ not disbanding after a player leaves the party/instance. Fixed checks for "in-progress" CPQ instances. Fixed changing maps on CPQ not leading players back to the starting battlefield. Reviewed login system, now preventing non-local IP connecting on local server and local IP on non-local server. Reviewed login system, now cherrypicking sessions in transition state when trying to disconnect them due to a failed login (avoiding possible mishaps due to duplicate sessions of a same account). Adjusted PiratePQ stage 2, now mobs respawn rather than making party leader request for new waves. Adjusted Prime Minister, its spawn is no longer related to starting the quest. It should also allow party fights. Fixed "forcevac" command not properly applying, rather sending to inventory, "consume-on-pickup" items. Fixed (probably) accId = 0 issue on login, that was occurring due to client accountid's being set to 0 a while before being checked once again on finishLogin(). Fixed an issue with extended time on CPQ not properly showing the end-match's visual effect.
This commit is contained in:
@@ -21,7 +21,9 @@
|
||||
*/
|
||||
package net.server.world;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import constants.ServerConstants;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
@@ -34,7 +36,13 @@ import net.server.audit.LockCollector;
|
||||
import net.server.audit.locks.MonitoredReentrantLock;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||
import net.server.coordinator.MapleMatchCheckerCoordinator;
|
||||
import net.server.coordinator.matchchecker.MatchCheckerListenerFactory.MatchCheckerType;
|
||||
import scripting.event.EventInstanceManager;
|
||||
import server.maps.MapleDoor;
|
||||
import server.maps.MapleMap;
|
||||
import server.partyquest.MonsterCarnival;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class MapleParty {
|
||||
|
||||
@@ -315,4 +323,152 @@ public class MapleParty {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean createParty(MapleCharacter player, boolean silentCheck) {
|
||||
MapleParty party = player.getParty();
|
||||
if (party == null) {
|
||||
if(player.getLevel() < 10 && !ServerConstants.USE_PARTY_FOR_STARTERS) {
|
||||
player.announce(MaplePacketCreator.partyStatusMessage(10));
|
||||
return false;
|
||||
}
|
||||
|
||||
MaplePartyCharacter partyplayer = new MaplePartyCharacter(player);
|
||||
party = player.getWorldServer().createParty(partyplayer);
|
||||
player.setParty(party);
|
||||
player.setMPC(partyplayer);
|
||||
player.getMap().addPartyMember(player);
|
||||
player.silentPartyUpdate();
|
||||
|
||||
player.partyOperationUpdate(party, null);
|
||||
player.announce(MaplePacketCreator.partyCreated(party, partyplayer.getId()));
|
||||
|
||||
return true;
|
||||
} else {
|
||||
if (!silentCheck) {
|
||||
player.announce(MaplePacketCreator.partyStatusMessage(16));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean joinParty(MapleCharacter player, int partyid, boolean silentCheck) {
|
||||
MapleParty party = player.getParty();
|
||||
World world = player.getWorldServer();
|
||||
|
||||
if (party == null) {
|
||||
party = world.getParty(partyid);
|
||||
if (party != null) {
|
||||
if (party.getMembers().size() < 6) {
|
||||
MaplePartyCharacter partyplayer = new MaplePartyCharacter(player);
|
||||
player.getMap().addPartyMember(player);
|
||||
|
||||
world.updateParty(party.getId(), PartyOperation.JOIN, partyplayer);
|
||||
player.receivePartyMemberHP();
|
||||
player.updatePartyMemberHP();
|
||||
|
||||
player.partyOperationUpdate(party, null);
|
||||
return true;
|
||||
} else {
|
||||
if (!silentCheck) {
|
||||
player.announce(MaplePacketCreator.partyStatusMessage(17));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
player.announce(MaplePacketCreator.serverNotice(5, "You couldn't join the party since it had already been disbanded."));
|
||||
}
|
||||
} else {
|
||||
if (!silentCheck) {
|
||||
player.announce(MaplePacketCreator.serverNotice(5, "You can't join the party as you are already in one."));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void leaveParty(MapleParty party, MapleClient c) {
|
||||
World world = c.getWorldServer();
|
||||
MapleCharacter player = c.getPlayer();
|
||||
MaplePartyCharacter partyplayer = player.getMPC();
|
||||
|
||||
if (party != null && partyplayer != null) {
|
||||
if (partyplayer.getId() == party.getLeaderId()) {
|
||||
c.getWorldServer().removeMapPartyMembers(party.getId());
|
||||
|
||||
MonsterCarnival mcpq = player.getMonsterCarnival();
|
||||
if (mcpq != null) {
|
||||
mcpq.leftParty(player.getId());
|
||||
}
|
||||
|
||||
world.updateParty(party.getId(), PartyOperation.DISBAND, partyplayer);
|
||||
|
||||
EventInstanceManager eim = player.getEventInstance();
|
||||
if(eim != null) {
|
||||
eim.disbandParty();
|
||||
}
|
||||
} else {
|
||||
MapleMap map = player.getMap();
|
||||
if (map != null) {
|
||||
map.removePartyMember(player);
|
||||
}
|
||||
|
||||
MonsterCarnival mcpq = player.getMonsterCarnival();
|
||||
if (mcpq != null) {
|
||||
mcpq.leftParty(player.getId());
|
||||
}
|
||||
|
||||
world.updateParty(party.getId(), PartyOperation.LEAVE, partyplayer);
|
||||
|
||||
EventInstanceManager eim = player.getEventInstance();
|
||||
if(eim != null) {
|
||||
eim.leftParty(player);
|
||||
}
|
||||
}
|
||||
|
||||
player.setParty(null);
|
||||
|
||||
MapleMatchCheckerCoordinator mmce = c.getWorldServer().getMatchCheckerCoordinator();
|
||||
if (mmce.getMatchConfirmationLeaderid(player.getId()) == player.getId() && mmce.getMatchConfirmationType(player.getId()) == MatchCheckerType.GUILD_CREATION) {
|
||||
mmce.dismissMatchConfirmation(player.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void expelFromParty(MapleParty party, MapleClient c, int expelCid) {
|
||||
World world = c.getWorldServer();
|
||||
MapleCharacter player = c.getPlayer();
|
||||
MaplePartyCharacter partyplayer = player.getMPC();
|
||||
|
||||
if (party != null && partyplayer != null) {
|
||||
if (partyplayer.equals(party.getLeader())) {
|
||||
MaplePartyCharacter expelled = party.getMemberById(expelCid);
|
||||
if (expelled != null) {
|
||||
MapleCharacter emc = expelled.getPlayer();
|
||||
if(emc != null) {
|
||||
List<MapleCharacter> partyMembers = emc.getPartyMembers();
|
||||
|
||||
MapleMap map = emc.getMap();
|
||||
if(map != null) map.removePartyMember(emc);
|
||||
|
||||
MonsterCarnival mcpq = player.getMonsterCarnival();
|
||||
if (mcpq != null) {
|
||||
mcpq.leftParty(emc.getId());
|
||||
}
|
||||
|
||||
EventInstanceManager eim = emc.getEventInstance();
|
||||
if(eim != null) {
|
||||
eim.leftParty(emc);
|
||||
}
|
||||
|
||||
emc.setParty(null);
|
||||
world.updateParty(party.getId(), PartyOperation.EXPEL, expelled);
|
||||
|
||||
emc.partyOperationUpdate(party, partyMembers);
|
||||
} else {
|
||||
world.updateParty(party.getId(), PartyOperation.EXPEL, expelled);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user