Reformat and clean up "net" package

This commit is contained in:
P0nk
2021-09-09 23:26:02 +02:00
parent 69f4580637
commit 6be6ea9927
235 changed files with 3556 additions and 3398 deletions

View File

@@ -40,18 +40,20 @@ public final class NPCTalkHandler extends AbstractPacketHandler {
c.sendPacket(PacketCreator.enableActions());
return;
}
if(currentServerTime() - c.getPlayer().getNpcCooldown() < YamlConfig.config.server.BLOCK_NPC_RACE_CONDT) {
if (currentServerTime() - c.getPlayer().getNpcCooldown() < YamlConfig.config.server.BLOCK_NPC_RACE_CONDT) {
c.sendPacket(PacketCreator.enableActions());
return;
}
int oid = p.readInt();
MapObject obj = c.getPlayer().getMap().getMapObject(oid);
if (obj instanceof NPC) {
NPC npc = (NPC) obj;
if(YamlConfig.config.server.USE_DEBUG == true) c.getPlayer().dropMessage(5, "Talking to NPC " + npc.getId());
if (YamlConfig.config.server.USE_DEBUG == true) {
c.getPlayer().dropMessage(5, "Talking to NPC " + npc.getId());
}
if (npc.getId() == 9010009) { //is duey
DueyProcessor.dueySendTalk(c, false);
} else {
@@ -59,7 +61,7 @@ public final class NPCTalkHandler extends AbstractPacketHandler {
c.sendPacket(PacketCreator.enableActions());
return;
}
// Custom handling to reduce the amount of scripts needed.
if (npc.getId() >= 9100100 && npc.getId() <= 9100200) {
NPCScriptManager.getInstance().start(c, npc.getId(), "gachapon", null);
@@ -77,7 +79,7 @@ public final class NPCTalkHandler extends AbstractPacketHandler {
c.sendPacket(PacketCreator.enableActions());
return;
}
npc.sendShop(c);
}
}
@@ -85,7 +87,7 @@ public final class NPCTalkHandler extends AbstractPacketHandler {
} else if (obj instanceof PlayerNPC) {
PlayerNPC pnpc = (PlayerNPC) obj;
NPCScriptManager nsm = NPCScriptManager.getInstance();
if (pnpc.getScriptId() < 9977777 && !nsm.isNpcScriptAvailable(c, "" + pnpc.getScriptId())) {
nsm.start(c, pnpc.getScriptId(), "rank_user", null);
} else {