Guild & Alliances Patches
As reported by J0k3r613, patched guild system not recognizing properly the guild leader just after creation. Patched many more issues related to guilds and alliances.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#Mon, 19 Jun 2017 14:48:35 -0300
|
#Wed, 21 Jun 2017 00:41:12 -0300
|
||||||
|
|
||||||
|
|
||||||
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=
|
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
dist/MapleSolaxia.jar
vendored
BIN
dist/MapleSolaxia.jar
vendored
Binary file not shown.
@@ -329,4 +329,12 @@ Consertado bugs referentes ao comando "level", n
|
|||||||
19 Junho 2017,
|
19 Junho 2017,
|
||||||
Consertado cupons não aparecendo apropriadamente na região de buffs.
|
Consertado cupons não aparecendo apropriadamente na região de buffs.
|
||||||
Consertado alguns problemas de concorrência com cupons.
|
Consertado alguns problemas de concorrência com cupons.
|
||||||
Consertado alguns problemas de concorrência com character buffs.
|
Consertado alguns problemas de concorrência com character buffs.
|
||||||
|
|
||||||
|
20 Junho 2017,
|
||||||
|
Definido um suporte para o esquema de expedições, tal como pode ser visto na CWKPQ.
|
||||||
|
|
||||||
|
21 Junho 2017,
|
||||||
|
Corrigido vários aspectos de guilds e alliances, que operavam irregularmente no cliente.
|
||||||
|
Corrigido "player logged in" aparecendo sempre que jogador troca de canal.
|
||||||
|
MGC do jogador agora está sincronizado com o MGC da guild, não o contrário.
|
||||||
@@ -1,29 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1">
|
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1"/>
|
||||||
<file>
|
|
||||||
<url>src/tools/MaplePacketCreator.java</url>
|
|
||||||
<bookmark id="1">
|
|
||||||
<name/>
|
|
||||||
<line>5937</line>
|
|
||||||
<key/>
|
|
||||||
</bookmark>
|
|
||||||
</file>
|
|
||||||
</editor-bookmarks>
|
|
||||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||||
<group>
|
<group>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/TimerManager.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AllianceOperationHandler.java</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerLoggedinHandler.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerLoggedinHandler.java</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleStatEffect.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/world/World.java</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/Server.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/CouponWorker.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleBuffStat.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleItemInformationProvider.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/MapleInventory.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010009.js</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/GuildOperationHandler.java</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuild.java</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleAlliance.java</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuildCharacter.java</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/Server.java</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/npc/NPCConversationManager.java</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010008.js</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
|
||||||
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java</file>
|
||||||
</group>
|
</group>
|
||||||
</open-files>
|
</open-files>
|
||||||
</project-private>
|
</project-private>
|
||||||
|
|||||||
@@ -17,84 +17,85 @@ var pos_y = Array(-204,-384,-504,-384,-204);
|
|||||||
var pos_y2 = Array(-144, -444, -744, -1044, -1344, -1644);
|
var pos_y2 = Array(-144, -444, -744, -1044, -1344, -1644);
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
em.setProperty("state", "0");
|
em.setProperty("state", "0");
|
||||||
em.setProperty("leader", "true");
|
em.setProperty("leader", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
function afterSetup(eim) {}
|
function afterSetup(eim) {}
|
||||||
|
|
||||||
function setup(eim, leaderid) {
|
function setup(leaderid) {
|
||||||
em.setProperty("state", "1");
|
em.setProperty("state", "1");
|
||||||
em.setProperty("leader", "true");
|
em.setProperty("leader", "true");
|
||||||
em.setProperty("current_instance", "0");
|
em.setProperty("current_instance", "0");
|
||||||
em.setProperty("glpq1", "0");
|
em.setProperty("glpq1", "0");
|
||||||
em.setProperty("glpq2", "0");
|
em.setProperty("glpq2", "0");
|
||||||
em.setProperty("glpq3", "0");
|
em.setProperty("glpq3", "0");
|
||||||
em.setProperty("glpq4", "0");
|
em.setProperty("glpq4", "0");
|
||||||
em.setProperty("glpq5", "0");
|
em.setProperty("glpq5", "0");
|
||||||
em.setProperty("glpq6", "0");
|
em.setProperty("glpq6", "0");
|
||||||
var eim = em.newInstance("CWKPQ" + leaderid);
|
|
||||||
for (var i = 0; i < mapz.length; i++) {
|
|
||||||
var map = eim.getInstanceMap(610030000 + mapz[i]);
|
|
||||||
if (map != null) {
|
|
||||||
map.resetFully();
|
|
||||||
if (map.getId() == 610030400) {
|
|
||||||
map.setReactorState(); //because everything is at 0 =[
|
|
||||||
map.limitReactor(6109016, 1);
|
|
||||||
map.limitReactor(6109017, 1);
|
|
||||||
map.limitReactor(6109018, 1);
|
|
||||||
map.limitReactor(6109019, 1);
|
|
||||||
map.limitReactor(6109020, 1);
|
|
||||||
map.shuffleReactors(6109016, 6109020);
|
|
||||||
map.destroyReactors(6108000, 6108005); //destroy the fake ones, non-GMS like or is this necessary
|
|
||||||
|
|
||||||
//add environments
|
var eim = em.newInstance("CWKPQ" + leaderid);
|
||||||
for (var x = 0; x < a.length; x++) {
|
for (var i = 0; i < mapz.length; i++) {
|
||||||
for (var y = 1; y <= 7; y++) {
|
var map = eim.getInstanceMap(610030000 + mapz[i]);
|
||||||
if (x == 1 || x == 3 || x == 4 || x == 6 || x == 8) {
|
if (map != null) {
|
||||||
if (y != 2 && y != 4 && y != 5 && y != 7) {
|
map.resetFully();
|
||||||
map.moveEnvironment(a[x] + "" + y, 1);
|
if (map.getId() == 610030400) {
|
||||||
}
|
map.setReactorState(); //because everything is at 0 =[
|
||||||
} else {
|
map.limitReactor(6109016, 1);
|
||||||
map.moveEnvironment(a[x] + "" + y, 1);
|
map.limitReactor(6109017, 1);
|
||||||
}
|
map.limitReactor(6109018, 1);
|
||||||
}
|
map.limitReactor(6109019, 1);
|
||||||
}
|
map.limitReactor(6109020, 1);
|
||||||
} else if (map.getId() == 610030510) { //warrior room, crimson guardians
|
map.shuffleReactors(6109016, 6109020);
|
||||||
for (var z = 0; z < pos_y2.length; z++) {
|
map.destroyReactors(6108000, 6108005); //destroy the fake ones, non-GMS like or is this necessary
|
||||||
var mob = em.getMonster(9400582);
|
|
||||||
eim.registerMonster(mob);
|
//add environments
|
||||||
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(0, pos_y2[z]));
|
for (var x = 0; x < a.length; x++) {
|
||||||
}
|
for (var y = 1; y <= 7; y++) {
|
||||||
//skipping mage room, ehh
|
if (x == 1 || x == 3 || x == 4 || x == 6 || x == 8) {
|
||||||
} else if (map.getId() == 610030540) { //bowman room, spawn master guardians
|
if (y != 2 && y != 4 && y != 5 && y != 7) {
|
||||||
for (var z = 0; z < pos_x.length; z++) {
|
map.moveEnvironment(a[x] + "" + y, 1);
|
||||||
var mob = em.getMonster(9400594);
|
}
|
||||||
eim.registerMonster(mob);
|
} else {
|
||||||
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(pos_x[z], pos_y[z]));
|
map.moveEnvironment(a[x] + "" + y, 1);
|
||||||
}
|
}
|
||||||
} else if (map.getId() == 610030550) {
|
}
|
||||||
map.shuffleReactors(); //pirate room
|
}
|
||||||
}
|
} else if (map.getId() == 610030510) { //warrior room, crimson guardians
|
||||||
}
|
for (var z = 0; z < pos_y2.length; z++) {
|
||||||
}
|
var mob = em.getMonster(9400582);
|
||||||
|
eim.registerMonster(mob);
|
||||||
|
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(0, pos_y2[z]));
|
||||||
|
}
|
||||||
|
//skipping mage room, ehh
|
||||||
|
} else if (map.getId() == 610030540) { //bowman room, spawn master guardians
|
||||||
|
for (var z = 0; z < pos_x.length; z++) {
|
||||||
|
var mob = em.getMonster(9400594);
|
||||||
|
eim.registerMonster(mob);
|
||||||
|
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(pos_x[z], pos_y[z]));
|
||||||
|
}
|
||||||
|
} else if (map.getId() == 610030550) {
|
||||||
|
map.shuffleReactors(); //pirate room
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
eim.startEventTimer(120000); //2 MIN for first stg
|
eim.startEventTimer(120000); //2 MIN for first stg
|
||||||
eim.schedule("spawnGuardians", 60000);
|
eim.schedule("spawnGuardians", 60000);
|
||||||
return eim;
|
return eim;
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerEntry(eim, player) {
|
function playerEntry(eim, player) {
|
||||||
eim.broadcastPlayerMsg(5, "[Expedition] " + player.getName() + " has entered the map.");
|
eim.dropMessage(5, "[Expedition] " + player.getName() + " has entered the map.");
|
||||||
var map = eim.getMapInstance(610030100 + (parseInt(em.getProperty("current_instance")) * 100));
|
var map = eim.getMapInstance(610030100 + (parseInt(em.getProperty("current_instance")) * 100));
|
||||||
player.changeMap(map, map.getPortal(0));
|
player.changeMap(map, map.getPortal(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
function spawnGuardians(eim) {
|
function spawnGuardians(eim) {
|
||||||
var map = eim.getMapInstance(0);
|
var map = eim.getMapInstance(0);
|
||||||
if (map.getCharactersSize() <= 0) {
|
if (map.countPlayers() <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
eim.broadcastPlayerMsg(5, "The Master Guardians have detected you.");
|
eim.dropMessage(5, "The Master Guardians have detected you.");
|
||||||
for (var i = 0; i < 20; i++) { //spawn 20 guardians
|
for (var i = 0; i < 20; i++) { //spawn 20 guardians
|
||||||
var mob = em.getMonster(9400594);
|
var mob = em.getMonster(9400594);
|
||||||
eim.registerMonster(mob);
|
eim.registerMonster(mob);
|
||||||
@@ -102,8 +103,7 @@ function spawnGuardians(eim) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerRevive(eim, player) {
|
function playerRevive(eim, player) {}
|
||||||
}
|
|
||||||
|
|
||||||
function scheduledTimeout(eim) {
|
function scheduledTimeout(eim) {
|
||||||
end(eim);
|
end(eim);
|
||||||
@@ -165,33 +165,30 @@ function monsterValue(eim, mobId) {
|
|||||||
function playerUnregistered(eim, player) {}
|
function playerUnregistered(eim, player) {}
|
||||||
|
|
||||||
function playerExit(eim, player) {
|
function playerExit(eim, player) {
|
||||||
eim.broadcastPlayerMsg(5, "[Expedition] " + player.getName() + " has left the map.");
|
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
|
||||||
eim.unregisterPlayer(player);
|
eim.unregisterPlayer(player);
|
||||||
|
|
||||||
if (eim.disposeIfPlayerBelow(minPlayers, 610030010)) {
|
if (eim.disposeIfPlayerBelow(minPlayers, 610030010)) {
|
||||||
em.setProperty("state", "0");
|
em.setProperty("state", "0");
|
||||||
em.setProperty("leader", "true");
|
em.setProperty("leader", "true");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function end(eim) {
|
function end(eim) {
|
||||||
eim.disposeIfPlayerBelow(100, 610030010);
|
eim.disposeIfPlayerBelow(100, 610030010);
|
||||||
em.setProperty("state", "0");
|
em.setProperty("state", "0");
|
||||||
em.setProperty("leader", "true");
|
em.setProperty("leader", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearPQ(eim) {
|
function clearPQ(eim) {
|
||||||
|
eim.setEventCleared();
|
||||||
end(eim);
|
end(eim);
|
||||||
}
|
}
|
||||||
|
|
||||||
function monsterKilled(mob, eim) {}
|
function monsterKilled(mob, eim) {}
|
||||||
|
function allMonstersDead(eim) {}
|
||||||
|
|
||||||
function allMonstersDead(eim) {
|
function leftParty (eim, player) {}
|
||||||
}
|
function disbandParty (eim) {}
|
||||||
|
|
||||||
function leftParty (eim, player) {
|
|
||||||
}
|
|
||||||
function disbandParty (eim) {
|
|
||||||
}
|
|
||||||
function playerDead(eim, player) {}
|
function playerDead(eim, player) {}
|
||||||
function cancelSchedule() {}
|
function cancelSchedule() {}
|
||||||
@@ -48,10 +48,7 @@ function action(mode, type, selection) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
if (player.getClient().getChannel() != 1) { //Only channel 1
|
if (player.getLevel() < cwkpq.getMinLevel() && player.getLevel() > cwkpq.getMaxLevel()) { //Don't fit requirement
|
||||||
cm.sendOk("Sorry, Crimsonwood Keep Party Quest may only be attempted on #bChannel 1#k.");
|
|
||||||
cm.dispose();
|
|
||||||
} else if (player.getLevel() < cwkpq.getMinLevel() && player.getLevel() > cwkpq.getMaxLevel()) { //Don't fit requirement
|
|
||||||
cm.sendOk("You do not meet the criteria to take attempt Crimsonwood Keep Party Quest!");
|
cm.sendOk("You do not meet the criteria to take attempt Crimsonwood Keep Party Quest!");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else if (expedition == null) { //Start an expedition
|
} else if (expedition == null) { //Start an expedition
|
||||||
@@ -109,14 +106,14 @@ function action(mode, type, selection) {
|
|||||||
cm.sendSimple(text);
|
cm.sendSimple(text);
|
||||||
status = 6;
|
status = 6;
|
||||||
} else if (selection == 2) {
|
} else if (selection == 2) {
|
||||||
cm.sendOk("The expedition will begin and you will now be escorted to the #bEntrance to cwkpq Altar#k.");
|
cm.sendOk("The expedition will begin and you will now be escorted to the #bEntrance to CWKPQ Altar#k.");
|
||||||
status = 4;
|
status = 4;
|
||||||
} else if (selection == 3) {
|
} else if (selection == 3) {
|
||||||
player.getMap().broadcastMessage(MaplePacketCreator.removeClock());
|
player.getMap().broadcastMessage(MaplePacketCreator.removeClock());
|
||||||
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
|
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
|
||||||
cm.endExpedition(expedition);
|
cm.endExpedition(expedition);
|
||||||
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
|
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (status == 4) {
|
} else if (status == 4) {
|
||||||
@@ -132,15 +129,15 @@ function action(mode, type, selection) {
|
|||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cm.sendOk("Good luck! Crimsonwood Keep Party Quest is a worthy challenge!");
|
|
||||||
em.setProperty("leader", player.getName());
|
em.setProperty("leader", player.getName());
|
||||||
em.setProperty("channel", player.getClient().getChannel());
|
em.setProperty("channel", player.getClient().getChannel());
|
||||||
em.startInstance(expedition);
|
em.startInstance(expedition);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
} else if (status == 6) {
|
} else if (status == 6) {
|
||||||
if (selection > 0) {
|
if (selection > 0) {
|
||||||
var banned = expedition.getMembers().get(selection);
|
var banned = expedition.getMembers().get(selection - 1);
|
||||||
expedition.ban(banned);
|
expedition.ban(banned);
|
||||||
cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
|
cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
|
|||||||
@@ -26,5 +26,5 @@
|
|||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
cm.warp(610030020);
|
cm.warp(610030020);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
@@ -3922,7 +3922,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
ret.dojoPoints = rs.getInt("dojoPoints");
|
ret.dojoPoints = rs.getInt("dojoPoints");
|
||||||
ret.dojoStage = rs.getInt("lastDojoStage");
|
ret.dojoStage = rs.getInt("lastDojoStage");
|
||||||
ret.dataString = rs.getString("dataString");
|
ret.dataString = rs.getString("dataString");
|
||||||
if (ret.guildid > 0) ret.mgc = new MapleGuildCharacter(ret);
|
ret.mgc = new MapleGuildCharacter(ret);
|
||||||
int buddyCapacity = rs.getInt("buddyCapacity");
|
int buddyCapacity = rs.getInt("buddyCapacity");
|
||||||
ret.buddylist = new BuddyList(buddyCapacity);
|
ret.buddylist = new BuddyList(buddyCapacity);
|
||||||
ret.getInventory(MapleInventoryType.EQUIP).setSlotLimit(rs.getByte("equipslots"));
|
ret.getInventory(MapleInventoryType.EQUIP).setSlotLimit(rs.getByte("equipslots"));
|
||||||
@@ -5295,17 +5295,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
|
|
||||||
public void setGuildId(int _id) {
|
public void setGuildId(int _id) {
|
||||||
guildid = _id;
|
guildid = _id;
|
||||||
if (guildid > 0) {
|
|
||||||
if (mgc == null) {
|
|
||||||
mgc = new MapleGuildCharacter(this);
|
|
||||||
} else {
|
|
||||||
mgc.setGuildId(guildid);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mgc = null;
|
|
||||||
guildRank = 5;
|
|
||||||
allianceRank = 5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGuildRank(int _rank) {
|
public void setGuildRank(int _rank) {
|
||||||
|
|||||||
@@ -498,7 +498,9 @@ public class Server implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(mc != null) {
|
if(mc != null) {
|
||||||
g.addGuildMember(mc.getMGC()); // i really REALLY must make player MGC the same as the guild MGC
|
mc.setMGC(g.getMGC(mc.getId()));
|
||||||
|
if(g.getMGC(mc.getId()) == null) System.out.println("null for " + mc.getName() + " when loading " + id);
|
||||||
|
g.getMGC(mc.getId()).setCharacter(mc);
|
||||||
g.setOnline(mc.getId(), true, mc.getClient().getChannel());
|
g.setOnline(mc.getId(), true, mc.getClient().getChannel());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,10 +522,10 @@ public class Server implements Runnable {
|
|||||||
g.setOnline(mc.getId(), bOnline, channel);
|
g.setOnline(mc.getId(), bOnline, channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int addGuildMember(MapleGuildCharacter mgc) {
|
public int addGuildMember(MapleGuildCharacter mgc, MapleCharacter chr) {
|
||||||
MapleGuild g = guilds.get(mgc.getGuildId());
|
MapleGuild g = guilds.get(mgc.getGuildId());
|
||||||
if (g != null) {
|
if (g != null) {
|
||||||
return g.addGuildMember(mgc);
|
return g.addGuildMember(mgc, chr);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public final class AllianceOperationHandler extends AbstractMaplePacketHandler {
|
|||||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.addGuildToAlliance(alliance, guildid, c), -1, -1);
|
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.addGuildToAlliance(alliance, guildid, c), -1, -1);
|
||||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.updateAllianceInfo(alliance, c), -1, -1);
|
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.updateAllianceInfo(alliance, c), -1, -1);
|
||||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1);
|
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1);
|
||||||
victim.getGuild().dropMessage("Your guild has joined in the [" + alliance.getName() + "] union.");
|
victim.getGuild().dropMessage("Your guild has joined the [" + alliance.getName() + "] union.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,6 +164,8 @@ public final class AllianceOperationHandler extends AbstractMaplePacketHandler {
|
|||||||
String notice = slea.readMapleAsciiString();
|
String notice = slea.readMapleAsciiString();
|
||||||
Server.getInstance().setAllianceNotice(alliance.getId(), notice);
|
Server.getInstance().setAllianceNotice(alliance.getId(), notice);
|
||||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), notice), -1, -1);
|
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), notice), -1, -1);
|
||||||
|
|
||||||
|
alliance.dropMessage(5, "* Alliance Notice : " + notice);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
c.getPlayer().dropMessage("Feature not available");
|
c.getPlayer().dropMessage("Feature not available");
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import java.util.Iterator;
|
|||||||
import tools.MaplePacketCreator;
|
import tools.MaplePacketCreator;
|
||||||
import client.MapleCharacter;
|
import client.MapleCharacter;
|
||||||
import net.server.Server;
|
import net.server.Server;
|
||||||
|
import net.server.guild.MapleAlliance;
|
||||||
|
|
||||||
public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
||||||
private boolean isGuildNameAcceptable(String name) {
|
private boolean isGuildNameAcceptable(String name) {
|
||||||
@@ -115,21 +116,22 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
|||||||
c.getPlayer().dropMessage(1, "The Guild name you have chosen is not accepted.");
|
c.getPlayer().dropMessage(1, "The Guild name you have chosen is not accepted.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int gid;
|
|
||||||
|
|
||||||
gid = Server.getInstance().createGuild(mc.getId(), guildName);
|
int gid = Server.getInstance().createGuild(mc.getId(), guildName);
|
||||||
if (gid == 0) {
|
if (gid == 0) {
|
||||||
c.announce(MaplePacketCreator.genericGuildMessage((byte) 0x1c));
|
c.announce(MaplePacketCreator.genericGuildMessage((byte) 0x1c));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mc.gainMeso(-MapleGuild.CREATE_GUILD_COST, true, false, true);
|
mc.gainMeso(-MapleGuild.CREATE_GUILD_COST, true, false, true);
|
||||||
|
|
||||||
Server.getInstance().getWorld(mc.getWorld()).setGuildAndRank(mc.getId(), gid, 1);
|
mc.getMGC().setGuildId(gid);
|
||||||
Server.getInstance().setGuildMemberOnline(mc, true, mc.getClient().getChannel());
|
Server.getInstance().getGuild(mc.getGuildId(), mc.getWorld(), mc); // initialize guild structure
|
||||||
|
Server.getInstance().changeRank(gid, mc.getId(), 1);
|
||||||
|
|
||||||
c.announce(MaplePacketCreator.showGuildInfo(mc));
|
c.announce(MaplePacketCreator.showGuildInfo(mc));
|
||||||
|
|
||||||
c.getPlayer().dropMessage(1, "You have successfully created a Guild.");
|
c.getPlayer().dropMessage(1, "You have successfully created a Guild.");
|
||||||
|
respawnPlayer(mc);
|
||||||
break;
|
break;
|
||||||
case 0x05:
|
case 0x05:
|
||||||
if (mc.getGuildId() <= 0 || mc.getGuildRank() > 2) {
|
if (mc.getGuildId() <= 0 || mc.getGuildRank() > 2) {
|
||||||
@@ -172,15 +174,14 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
|||||||
System.out.println("[hax] " + mc.getName() + " is trying to join a guild that never invited him/her (or that the invitation has expired)");
|
System.out.println("[hax] " + mc.getName() + " is trying to join a guild that never invited him/her (or that the invitation has expired)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mc.setGuildId(gid); // joins the guild
|
mc.getMGC().setGuildId(gid); // joins the guild
|
||||||
mc.setGuildRank(5); // start at lowest rank
|
mc.getMGC().setGuildRank(5); // start at lowest rank
|
||||||
mc.setAllianceRank(5);
|
mc.getMGC().setAllianceRank(5);
|
||||||
int s;
|
|
||||||
|
|
||||||
s = Server.getInstance().addGuildMember(mc.getMGC());
|
int s = Server.getInstance().addGuildMember(mc.getMGC(), mc);
|
||||||
if (s == 0) {
|
if (s == 0) {
|
||||||
c.getPlayer().dropMessage(1, "The Guild you are trying to join is already full.");
|
c.getPlayer().dropMessage(1, "The Guild you are trying to join is already full.");
|
||||||
mc.setGuildId(0);
|
mc.getMGC().setGuildId(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +208,7 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
|||||||
c.announce(MaplePacketCreator.showGuildInfo(null));
|
c.announce(MaplePacketCreator.showGuildInfo(null));
|
||||||
if(allianceId > 0) Server.getInstance().getAlliance(allianceId).updateAlliancePackets(mc);
|
if(allianceId > 0) Server.getInstance().getAlliance(allianceId).updateAlliancePackets(mc);
|
||||||
|
|
||||||
mc.setGuildId(0);
|
mc.getMGC().setGuildId(0);
|
||||||
mc.saveGuildStatus();
|
mc.saveGuildStatus();
|
||||||
respawnPlayer(mc);
|
respawnPlayer(mc);
|
||||||
break;
|
break;
|
||||||
@@ -262,12 +263,18 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
|||||||
short logo = slea.readShort();
|
short logo = slea.readShort();
|
||||||
byte logocolor = slea.readByte();
|
byte logocolor = slea.readByte();
|
||||||
Server.getInstance().setGuildEmblem(mc.getGuildId(), bg, bgcolor, logo, logocolor);
|
Server.getInstance().setGuildEmblem(mc.getGuildId(), bg, bgcolor, logo, logocolor);
|
||||||
|
|
||||||
|
if (mc.getGuild() != null && mc.getGuild().getAllianceId() > 0) {
|
||||||
|
MapleAlliance alliance = mc.getAlliance();
|
||||||
|
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.getGuildAlliances(alliance, c.getWorld()), -1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
mc.gainMeso(-MapleGuild.CHANGE_EMBLEM_COST, true, false, true);
|
mc.gainMeso(-MapleGuild.CHANGE_EMBLEM_COST, true, false, true);
|
||||||
respawnPlayer(mc);
|
respawnPlayer(mc);
|
||||||
break;
|
break;
|
||||||
case 0x10:
|
case 0x10:
|
||||||
if (mc.getGuildId() <= 0 || mc.getGuildRank() > 2) {
|
if (mc.getGuildId() <= 0 || mc.getGuildRank() > 2) {
|
||||||
System.out.println("[hax] " + mc.getName() + " tried to change guild notice while not in a guild.");
|
if(mc.getGuildId() <= 0) System.out.println("[hax] " + mc.getName() + " tried to change guild notice while not in a guild.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String notice = slea.readMapleAsciiString();
|
String notice = slea.readMapleAsciiString();
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import client.inventory.MaplePet;
|
|||||||
import client.inventory.PetDataFactory;
|
import client.inventory.PetDataFactory;
|
||||||
import constants.GameConstants;
|
import constants.GameConstants;
|
||||||
import constants.ServerConstants;
|
import constants.ServerConstants;
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import server.TimerManager;
|
import server.TimerManager;
|
||||||
|
|
||||||
@@ -187,12 +188,10 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
|
|||||||
MapleGuild playerGuild = server.getGuild(player.getGuildId(), player.getWorld(), player);
|
MapleGuild playerGuild = server.getGuild(player.getGuildId(), player.getWorld(), player);
|
||||||
if (playerGuild == null) {
|
if (playerGuild == null) {
|
||||||
player.deleteGuild(player.getGuildId());
|
player.deleteGuild(player.getGuildId());
|
||||||
player.setMGC(null);
|
player.getMGC().setGuildId(0);
|
||||||
player.setGuildId(0);
|
|
||||||
} else {
|
} else {
|
||||||
playerGuild.getMGC(player.getId()).setCharacter(player);
|
playerGuild.getMGC(player.getId()).setCharacter(player);
|
||||||
player.setMGC(playerGuild.getMGC(player.getId()));
|
player.setMGC(playerGuild.getMGC(player.getId()));
|
||||||
|
|
||||||
server.setGuildMemberOnline(player, true, c.getChannel());
|
server.setGuildMemberOnline(player, true, c.getChannel());
|
||||||
c.announce(MaplePacketCreator.showGuildInfo(player));
|
c.announce(MaplePacketCreator.showGuildInfo(player));
|
||||||
int allianceId = player.getGuild().getAllianceId();
|
int allianceId = player.getGuild().getAllianceId();
|
||||||
@@ -206,12 +205,13 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
|
|||||||
player.getGuild().setAllianceId(0);
|
player.getGuild().setAllianceId(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newAlliance != null) {
|
if (newAlliance != null) {
|
||||||
c.announce(MaplePacketCreator.updateAllianceInfo(newAlliance, c));
|
c.announce(MaplePacketCreator.updateAllianceInfo(newAlliance, c));
|
||||||
c.announce(MaplePacketCreator.allianceNotice(newAlliance.getId(), newAlliance.getNotice()));
|
c.announce(MaplePacketCreator.allianceNotice(newAlliance.getId(), newAlliance.getNotice()));
|
||||||
|
|
||||||
server.allianceMessage(allianceId, MaplePacketCreator.allianceMemberOnline(player, true), player.getId(), -1);
|
if (newcomer) {
|
||||||
|
server.allianceMessage(allianceId, MaplePacketCreator.allianceMemberOnline(player, true), player.getId(), -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,10 +121,13 @@ public class MapleAlliance {
|
|||||||
|
|
||||||
MapleCharacter chr = guildMasters.get(i);
|
MapleCharacter chr = guildMasters.get(i);
|
||||||
chr.getMGC().setAllianceRank((i == 0) ? 1 : 2);
|
chr.getMGC().setAllianceRank((i == 0) ? 1 : 2);
|
||||||
|
Server.getInstance().getGuild(chr.getGuildId()).getMGC(chr.getId()).setAllianceRank((i == 0) ? 1 : 2);
|
||||||
chr.saveGuildStatus();
|
chr.saveGuildStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
Server.getInstance().addAlliance(id, alliance);
|
Server.getInstance().addAlliance(id, alliance);
|
||||||
|
|
||||||
|
System.out.println("\n\n\n\n----");
|
||||||
Server.getInstance().allianceMessage(id, MaplePacketCreator.updateAllianceInfo(alliance, guildMasters.get(0).getClient()), -1, -1);
|
Server.getInstance().allianceMessage(id, MaplePacketCreator.updateAllianceInfo(alliance, guildMasters.get(0).getClient()), -1, -1);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -304,7 +307,7 @@ public class MapleAlliance {
|
|||||||
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1);
|
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1);
|
||||||
Server.getInstance().guildMessage(guildId, MaplePacketCreator.disbandAlliance(alliance.getId()));
|
Server.getInstance().guildMessage(guildId, MaplePacketCreator.disbandAlliance(alliance.getId()));
|
||||||
|
|
||||||
alliance.dropMessage("[" + Server.getInstance().getGuild(guildId, worldId) + "] guild has left the union.");
|
alliance.dropMessage("[" + Server.getInstance().getGuild(guildId, worldId).getName() + "] guild has left the union.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateAlliancePackets(MapleCharacter chr) {
|
public void updateAlliancePackets(MapleCharacter chr) {
|
||||||
|
|||||||
@@ -372,13 +372,14 @@ public class MapleGuild {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int addGuildMember(MapleGuildCharacter mgc) {
|
public int addGuildMember(MapleGuildCharacter mgc, MapleCharacter chr) {
|
||||||
synchronized (members) {
|
synchronized (members) {
|
||||||
if (members.size() >= capacity) {
|
if (members.size() >= capacity) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
for (int i = members.size() - 1; i >= 0; i--) {
|
for (int i = members.size() - 1; i >= 0; i--) {
|
||||||
if (members.get(i).getGuildRank() < 5 || members.get(i).getName().compareTo(mgc.getName()) < 0) {
|
if (members.get(i).getGuildRank() < 5 || members.get(i).getName().compareTo(mgc.getName()) < 0) {
|
||||||
|
mgc.setCharacter(chr);
|
||||||
members.add(i + 1, mgc);
|
members.add(i + 1, mgc);
|
||||||
bDirty = true;
|
bDirty = true;
|
||||||
break;
|
break;
|
||||||
@@ -439,23 +440,30 @@ public class MapleGuild {
|
|||||||
public void changeRank(int cid, int newRank) {
|
public void changeRank(int cid, int newRank) {
|
||||||
for (MapleGuildCharacter mgc : members) {
|
for (MapleGuildCharacter mgc : members) {
|
||||||
if (cid == mgc.getId()) {
|
if (cid == mgc.getId()) {
|
||||||
try {
|
changeRank(mgc, newRank);
|
||||||
if (mgc.isOnline()) {
|
|
||||||
Server.getInstance().getWorld(mgc.getWorld()).setGuildAndRank(cid, this.id, newRank);
|
|
||||||
} else {
|
|
||||||
Server.getInstance().getWorld(mgc.getWorld()).setOfflineGuildStatus((short) this.id, (byte) newRank, cid);
|
|
||||||
}
|
|
||||||
} catch (Exception re) {
|
|
||||||
re.printStackTrace();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mgc.setGuildRank(newRank);
|
|
||||||
this.broadcast(MaplePacketCreator.changeRank(mgc));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void changeRank(MapleGuildCharacter mgc, int newRank) {
|
||||||
|
try {
|
||||||
|
if (mgc.isOnline()) {
|
||||||
|
Server.getInstance().getWorld(mgc.getWorld()).setGuildAndRank(mgc.getId(), this.id, newRank);
|
||||||
|
mgc.setGuildRank(newRank);
|
||||||
|
} else {
|
||||||
|
Server.getInstance().getWorld(mgc.getWorld()).setOfflineGuildStatus((short) this.id, (byte) newRank, mgc.getId());
|
||||||
|
mgc.setOfflineGuildRank(newRank);
|
||||||
|
}
|
||||||
|
} catch (Exception re) {
|
||||||
|
re.printStackTrace();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.broadcast(MaplePacketCreator.changeRank(mgc));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public void setGuildNotice(String notice) {
|
public void setGuildNotice(String notice) {
|
||||||
this.notice = notice;
|
this.notice = notice;
|
||||||
writeToDB(false);
|
writeToDB(false);
|
||||||
@@ -594,7 +602,11 @@ public class MapleGuild {
|
|||||||
|
|
||||||
public void resetAllianceGuildPlayersRank() {
|
public void resetAllianceGuildPlayersRank() {
|
||||||
try {
|
try {
|
||||||
for(MapleGuildCharacter mgc: members) mgc.setAllianceRank(5);
|
for(MapleGuildCharacter mgc: members) {
|
||||||
|
if(mgc.isOnline()) {
|
||||||
|
mgc.setAllianceRank(5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try (PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement("UPDATE characters SET allianceRank = ? WHERE guildid = ?")) {
|
try (PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement("UPDATE characters SET allianceRank = ? WHERE guildid = ?")) {
|
||||||
ps.setInt(1, 5);
|
ps.setInt(1, 5);
|
||||||
|
|||||||
@@ -111,15 +111,20 @@ public class MapleGuildCharacter {
|
|||||||
|
|
||||||
public void setGuildId(int gid) {
|
public void setGuildId(int gid) {
|
||||||
guildid = gid;
|
guildid = gid;
|
||||||
|
character.setGuildId(gid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getGuildRank() {
|
public int getGuildRank() {
|
||||||
return guildrank;
|
return guildrank;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOfflineGuildRank(int rank) {
|
||||||
|
guildrank = rank;
|
||||||
|
}
|
||||||
|
|
||||||
public void setGuildRank(int rank) {
|
public void setGuildRank(int rank) {
|
||||||
guildrank = rank;
|
guildrank = rank;
|
||||||
if(character != null) character.setGuildRank(rank);
|
character.setGuildRank(rank);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAllianceRank() {
|
public int getAllianceRank() {
|
||||||
@@ -128,7 +133,7 @@ public class MapleGuildCharacter {
|
|||||||
|
|
||||||
public void setAllianceRank(int rank) {
|
public void setAllianceRank(int rank) {
|
||||||
allianceRank = rank;
|
allianceRank = rank;
|
||||||
if(character != null) character.setAllianceRank(rank);
|
character.setAllianceRank(rank);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOnline() {
|
public boolean isOnline() {
|
||||||
|
|||||||
@@ -206,8 +206,7 @@ public class World {
|
|||||||
if(mgc == null) return null;
|
if(mgc == null) return null;
|
||||||
|
|
||||||
int gid = mgc.getGuildId();
|
int gid = mgc.getGuildId();
|
||||||
MapleGuild g;
|
MapleGuild g = Server.getInstance().getGuild(gid, mgc.getWorld(), mgc.getCharacter());
|
||||||
g = Server.getInstance().getGuild(gid, mgc.getWorld(), mgc.getCharacter());
|
|
||||||
if (gsStore.get(gid) == null) {
|
if (gsStore.get(gid) == null) {
|
||||||
gsStore.put(gid, new MapleGuildSummary(g));
|
gsStore.put(gid, new MapleGuildSummary(g));
|
||||||
}
|
}
|
||||||
@@ -274,13 +273,10 @@ public class World {
|
|||||||
bDifferentGuild = true;
|
bDifferentGuild = true;
|
||||||
} else {
|
} else {
|
||||||
bDifferentGuild = guildid != mc.getGuildId();
|
bDifferentGuild = guildid != mc.getGuildId();
|
||||||
mc.setGuildId(guildid);
|
mc.getMGC().setGuildId(guildid);
|
||||||
|
mc.getMGC().setGuildRank(rank);
|
||||||
|
|
||||||
MapleGuildCharacter mgc = mc.getMGC();
|
if(bDifferentGuild) mc.getMGC().setAllianceRank(5);
|
||||||
if(mgc != null) {
|
|
||||||
mgc.setGuildRank(rank);
|
|
||||||
if(bDifferentGuild) mgc.setAllianceRank(5);
|
|
||||||
}
|
|
||||||
|
|
||||||
mc.saveGuildStatus();
|
mc.saveGuildStatus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -235,7 +235,18 @@ public class EventInstanceManager {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dropMessage(int type, String message) {
|
||||||
|
for (MapleCharacter chr : getPlayers()) {
|
||||||
|
chr.dropMessage(type, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void restartEventTimer(long time) {
|
||||||
|
stopEventTimer();
|
||||||
|
startEventTimer(time);
|
||||||
|
}
|
||||||
|
|
||||||
public void startEventTimer(long time) {
|
public void startEventTimer(long time) {
|
||||||
timeStarted = System.currentTimeMillis();
|
timeStarted = System.currentTimeMillis();
|
||||||
eventTime = time;
|
eventTime = time;
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ public class EventManager {
|
|||||||
startLobbyInstance(lobbyId);
|
startLobbyInstance(lobbyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", leader.getId()));
|
||||||
if(eim == null) {
|
if(eim == null) {
|
||||||
if(lobbyId > -1) setLockLobby(lobbyId, false);
|
if(lobbyId > -1) setLockLobby(lobbyId, false);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -352,7 +352,9 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
public void upgradeAlliance() {
|
public void upgradeAlliance() {
|
||||||
MapleAlliance alliance = Server.getInstance().getAlliance(c.getPlayer().getGuild().getAllianceId());
|
MapleAlliance alliance = Server.getInstance().getAlliance(c.getPlayer().getGuild().getAllianceId());
|
||||||
alliance.increaseCapacity(1);
|
alliance.increaseCapacity(1);
|
||||||
c.announce(MaplePacketCreator.updateAllianceInfo(alliance, c));
|
|
||||||
|
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.getGuildAlliances(alliance, c.getWorld()), -1, -1);
|
||||||
|
Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disbandAlliance(MapleClient c, int allianceId) {
|
public void disbandAlliance(MapleClient c, int allianceId) {
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ public class MapleExpedition {
|
|||||||
private MapleMap startMap;
|
private MapleMap startMap;
|
||||||
private ArrayList<String> bossLogs;
|
private ArrayList<String> bossLogs;
|
||||||
private ScheduledFuture<?> schedule;
|
private ScheduledFuture<?> schedule;
|
||||||
private List<MapleCharacter> members = new ArrayList<MapleCharacter>();
|
private List<MapleCharacter> members = new ArrayList<>();
|
||||||
private List<MapleCharacter> banned = new ArrayList<MapleCharacter>();
|
private List<Integer> banned = new ArrayList<>();
|
||||||
private long startTime;
|
private long startTime;
|
||||||
|
|
||||||
public MapleExpedition(MapleCharacter player, MapleExpeditionType met) {
|
public MapleExpedition(MapleCharacter player, MapleExpeditionType met) {
|
||||||
@@ -126,7 +126,7 @@ public class MapleExpedition {
|
|||||||
public void start(){
|
public void start(){
|
||||||
registering = false;
|
registering = false;
|
||||||
startMap.broadcastMessage(MaplePacketCreator.removeClock());
|
startMap.broadcastMessage(MaplePacketCreator.removeClock());
|
||||||
broadcastExped(MaplePacketCreator.serverNotice(6, "The expedition has started! The expedition leader is waiting inside!"));
|
broadcastExped(MaplePacketCreator.serverNotice(6, "The expedition has started! Good luck, brave heroes!"));
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
Server.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, type.toString() + " Expedition started with leader: " + leader.getName()));
|
Server.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, type.toString() + " Expedition started with leader: " + leader.getName()));
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ public class MapleExpedition {
|
|||||||
if (!registering){
|
if (!registering){
|
||||||
return "Sorry, this expedition is already underway. Registration is closed!";
|
return "Sorry, this expedition is already underway. Registration is closed!";
|
||||||
}
|
}
|
||||||
if (banned.contains(player)){
|
if (banned.contains(player.getId())){
|
||||||
return "Sorry, you've been banned from this expedition by #b" + leader.getName() + "#k.";
|
return "Sorry, you've been banned from this expedition by #b" + leader.getName() + "#k.";
|
||||||
}
|
}
|
||||||
if (members.size() >= type.getMaxSize()){ //Would be a miracle if anybody ever saw this
|
if (members.size() >= type.getMaxSize()){ //Would be a miracle if anybody ever saw this
|
||||||
@@ -155,7 +155,13 @@ public class MapleExpedition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean removeMember(MapleCharacter chr) {
|
public boolean removeMember(MapleCharacter chr) {
|
||||||
return members.remove(chr);
|
if(members.remove(chr)) {
|
||||||
|
broadcastExped(MaplePacketCreator.serverNotice(6, chr.getName() + " has left the expedition."));
|
||||||
|
chr.dropMessage(6, "You have left this expedition.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapleExpeditionType getType() {
|
public MapleExpeditionType getType() {
|
||||||
@@ -192,9 +198,14 @@ public class MapleExpedition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void ban(MapleCharacter player) {
|
public void ban(MapleCharacter player) {
|
||||||
if (!banned.contains(player)) {
|
if (!banned.contains(player.getId())) {
|
||||||
banned.add(player);
|
banned.add(player.getId());
|
||||||
members.remove(player);
|
members.remove(player);
|
||||||
|
|
||||||
|
broadcastExped(MaplePacketCreator.serverNotice(6, player.getName() + " has been banned from the expedition."));
|
||||||
|
|
||||||
|
player.announce(MaplePacketCreator.removeClock());
|
||||||
|
player.dropMessage(6, "You have been banned from this expedition.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ public class MapleMap {
|
|||||||
private Collection<MapleCharacter> characters = new LinkedHashSet<>();
|
private Collection<MapleCharacter> characters = new LinkedHashSet<>();
|
||||||
private Map<Integer, MaplePortal> portals = new HashMap<>();
|
private Map<Integer, MaplePortal> portals = new HashMap<>();
|
||||||
private Map<Integer, Integer> backgroundTypes = new HashMap<>();
|
private Map<Integer, Integer> backgroundTypes = new HashMap<>();
|
||||||
|
private Map<String, Integer> environment = new LinkedHashMap<String, Integer>();
|
||||||
private List<Rectangle> areas = new ArrayList<>();
|
private List<Rectangle> areas = new ArrayList<>();
|
||||||
private MapleFootholdTree footholds = null;
|
private MapleFootholdTree footholds = null;
|
||||||
private int mapid;
|
private int mapid;
|
||||||
@@ -252,6 +253,28 @@ public class MapleMap {
|
|||||||
objectRLock.unlock();
|
objectRLock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void limitReactor(final int rid, final int num) {
|
||||||
|
List<MapleReactor> toDestroy = new ArrayList<>();
|
||||||
|
Map<Integer, Integer> contained = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
for (MapleMapObject obj : getReactors()) {
|
||||||
|
MapleReactor mr = (MapleReactor) obj;
|
||||||
|
if (contained.containsKey(mr.getId())) {
|
||||||
|
if (contained.get(mr.getId()) >= num) {
|
||||||
|
toDestroy.add(mr);
|
||||||
|
} else {
|
||||||
|
contained.put(mr.getId(), contained.get(mr.getId()) + 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
contained.put(mr.getId(), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (MapleReactor mr : toDestroy) {
|
||||||
|
destroyReactor(mr.getObjectId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int getForcedReturnId() {
|
public int getForcedReturnId() {
|
||||||
return forcedReturnMap;
|
return forcedReturnMap;
|
||||||
@@ -837,6 +860,22 @@ public class MapleMap {
|
|||||||
killMonster(monster, null, false, 1);
|
killMonster(monster, null, false, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void destroyReactors(final int first, final int last) {
|
||||||
|
List<MapleReactor> toDestroy = new ArrayList<>();
|
||||||
|
List<MapleMapObject> reactors = getReactors();
|
||||||
|
|
||||||
|
for (MapleMapObject obj : reactors) {
|
||||||
|
MapleReactor mr = (MapleReactor) obj;
|
||||||
|
if (mr.getId() >= first && mr.getId() <= last) {
|
||||||
|
toDestroy.add(mr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (MapleReactor mr : toDestroy) {
|
||||||
|
destroyReactor(mr.getObjectId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void destroyReactor(int oid) {
|
public void destroyReactor(int oid) {
|
||||||
final MapleReactor reactor = getReactorByOid(oid);
|
final MapleReactor reactor = getReactorByOid(oid);
|
||||||
@@ -897,6 +936,25 @@ public class MapleMap {
|
|||||||
objectRLock.unlock();
|
objectRLock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void shuffleReactors(int first, int last) {
|
||||||
|
List<Point> points = new ArrayList<>();
|
||||||
|
List<MapleMapObject> reactors = getReactors();
|
||||||
|
List<MapleMapObject> targets = new LinkedList<>();
|
||||||
|
|
||||||
|
for (MapleMapObject obj : reactors) {
|
||||||
|
MapleReactor mr = (MapleReactor) obj;
|
||||||
|
if (mr.getId() >= first && mr.getId() <= last) {
|
||||||
|
points.add(mr.getPosition());
|
||||||
|
targets.add(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Collections.shuffle(points);
|
||||||
|
for (MapleMapObject obj : targets) {
|
||||||
|
MapleReactor mr = (MapleReactor) obj;
|
||||||
|
mr.setPosition(points.remove(points.size() - 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Automagically finds a new controller for the given monster from the chars
|
* Automagically finds a new controller for the given monster from the chars
|
||||||
@@ -2035,6 +2093,27 @@ public class MapleMap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// \/\/\/\/\/\/ CWKPQ things \/\/\/\/\/\/
|
||||||
|
|
||||||
|
public final void toggleEnvironment(final String ms) {
|
||||||
|
if (environment.containsKey(ms)) {
|
||||||
|
moveEnvironment(ms, environment.get(ms) == 1 ? 2 : 1);
|
||||||
|
} else {
|
||||||
|
moveEnvironment(ms, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void moveEnvironment(final String ms, final int type) {
|
||||||
|
broadcastMessage(MaplePacketCreator.environmentChange(ms, type));
|
||||||
|
environment.put(ms, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final Map<String, Integer> getEnvironment() {
|
||||||
|
return environment;
|
||||||
|
}
|
||||||
|
|
||||||
|
// /\/\/\/\/\/\/\ CWKPQ things /\/\/\/\/\/\
|
||||||
|
|
||||||
public String getMapName() {
|
public String getMapName() {
|
||||||
return mapName;
|
return mapName;
|
||||||
|
|||||||
@@ -5939,7 +5939,7 @@ public class MaplePacketCreator {
|
|||||||
mplew.writeInt(alliance.getCapacity()); // probably capacity
|
mplew.writeInt(alliance.getCapacity()); // probably capacity
|
||||||
mplew.writeShort(0);
|
mplew.writeShort(0);
|
||||||
for (Integer guildd : alliance.getGuilds()) {
|
for (Integer guildd : alliance.getGuilds()) {
|
||||||
getGuildInfo(mplew, Server.getInstance().getGuild(guildd, c.getWorld(), c.getPlayer()));
|
getGuildInfo(mplew, Server.getInstance().getGuild(guildd, c.getWorld()));
|
||||||
}
|
}
|
||||||
return mplew.getPacket();
|
return mplew.getPacket();
|
||||||
}
|
}
|
||||||
@@ -5950,7 +5950,7 @@ public class MaplePacketCreator {
|
|||||||
mplew.write(0x0D);
|
mplew.write(0x0D);
|
||||||
mplew.writeInt(alliance.getGuilds().size());
|
mplew.writeInt(alliance.getGuilds().size());
|
||||||
for (Integer guild : alliance.getGuilds()) {
|
for (Integer guild : alliance.getGuilds()) {
|
||||||
getGuildInfo(mplew, Server.getInstance().getGuild(guild, worldId, null));
|
getGuildInfo(mplew, Server.getInstance().getGuild(guild, worldId));
|
||||||
}
|
}
|
||||||
return mplew.getPacket();
|
return mplew.getPacket();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user