Cpq1 ,2 add linguas
This commit is contained in:
@@ -9598,7 +9598,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
private MapleFitness fitness;
|
||||
private MapleOla ola;
|
||||
private long snowballattack;
|
||||
private int lingua = 0;// 0 PTB 1 ESP 2 ENG
|
||||
public static final List<String> itens = new ArrayList();
|
||||
public static final List<Item> item = new ArrayList();
|
||||
|
||||
@@ -10174,12 +10173,24 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
this.challenged = challenged;
|
||||
}
|
||||
|
||||
public void setLingua(int a) {
|
||||
this.lingua = a;
|
||||
public void setLingua(int num) {
|
||||
getClient().setLingua(num);
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
try (PreparedStatement ps = con.prepareStatement("UPDATE accounts SET lingua = ? WHERE id = ?")) {
|
||||
ps.setInt(1, num);
|
||||
ps.setInt(2, getClient().getAccID());
|
||||
ps.executeUpdate();
|
||||
} finally {
|
||||
con.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int getLingua() {
|
||||
return lingua;
|
||||
return getClient().getLingua();
|
||||
}
|
||||
|
||||
public void setItens(String item) {
|
||||
|
||||
@@ -124,6 +124,7 @@ public class MapleClient {
|
||||
private int visibleWorlds;
|
||||
private long lastNpcClick;
|
||||
private long sessionId;
|
||||
private int lingua = 0;
|
||||
|
||||
public MapleClient(MapleAESOFB send, MapleAESOFB receive, IoSession session) {
|
||||
this.send = send;
|
||||
@@ -535,7 +536,7 @@ public class MapleClient {
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
con = DatabaseConnection.getConnection();
|
||||
ps = con.prepareStatement("SELECT id, password, gender, banned, pin, pic, characterslots, tos FROM accounts WHERE name = ?");
|
||||
ps = con.prepareStatement("SELECT id, password, gender, banned, pin, pic, characterslots, tos, lingua FROM accounts WHERE name = ?");
|
||||
ps.setString(1, login);
|
||||
rs = ps.executeQuery();
|
||||
if (rs.next()) {
|
||||
@@ -546,6 +547,7 @@ public class MapleClient {
|
||||
pic = rs.getString("pic");
|
||||
gender = rs.getByte("gender");
|
||||
characterSlots = rs.getByte("characterslots");
|
||||
lingua = rs.getInt("lingua");
|
||||
String passhash = rs.getString("password");
|
||||
byte tos = rs.getByte("tos");
|
||||
|
||||
@@ -1528,4 +1530,12 @@ public class MapleClient {
|
||||
public boolean canBypassPic() {
|
||||
return MapleLoginBypassCoordinator.getInstance().canLoginBypass(getNibbleHWID(), accId, true);
|
||||
}
|
||||
|
||||
public int getLingua() {
|
||||
return lingua;
|
||||
}
|
||||
|
||||
public void setLingua(int lingua) {
|
||||
this.lingua = lingua;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ public class CommandsExecutor {
|
||||
addCommand("uptime", UptimeCommand.class);
|
||||
addCommand("gacha", GachaCommand.class);
|
||||
addCommand("dispose", DisposeCommand.class);
|
||||
addCommand("changel", ChangeLinguaCommand.class);
|
||||
addCommand("equiplv", EquipLvCommand.class);
|
||||
addCommand("showrates", ShowRatesCommand.class);
|
||||
addCommand("rates", RatesCommand.class);
|
||||
|
||||
42
src/client/command/commands/gm0/ChangeLinguaCommand.java
Normal file
42
src/client/command/commands/gm0/ChangeLinguaCommand.java
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
|
||||
Copyleft (L) 2016 - 2018 RonanLana
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
@Author: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.gm0;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
|
||||
public class ChangeLinguaCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
if (params.length < 1) {
|
||||
c.getPlayer().yellowMessage("Syntax: !changel <0=ptb, 1=esp, 2=eng>");
|
||||
return;
|
||||
}
|
||||
c.setLingua(Integer.parseInt(params[0]));
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,10 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package constants;
|
||||
|
||||
import client.MapleCharacter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Drago
|
||||
* @author Drago - Dragohe4rt
|
||||
*/
|
||||
public class LinguaConstants {
|
||||
// Portugues
|
||||
|
||||
@@ -939,7 +939,7 @@ public class MapleStatEffect {
|
||||
applyto.removeAllCooldownsExcept(Buccaneer.TIME_LEAP, true);
|
||||
} else if (cp != 0 && applyto.getMonsterCarnival() != null) {
|
||||
applyto.gainCP(cp);
|
||||
} else if (nuffSkill != 0 && applyto.getParty() != null && applyto.getMap().isCPQMap()) {
|
||||
} else if (nuffSkill != 0 && applyto.getParty() != null && applyto.getMap().isCPQMap()) { // by Drago-Dragohe4rt
|
||||
final MCSkill skil = MapleCarnivalFactory.getInstance().getSkill(nuffSkill);
|
||||
if (skil != null) {
|
||||
final MapleDisease dis = skil.getDisease();
|
||||
@@ -964,7 +964,7 @@ public class MapleStatEffect {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (cureDebuffs.size() > 0) {
|
||||
} else if (cureDebuffs.size() > 0) { // by Drago-Dragohe4rt
|
||||
for (final MapleDisease debuff : cureDebuffs) {
|
||||
if (applyfrom.getParty() != null) {
|
||||
for (MaplePartyCharacter chrs : applyfrom.getParty().getPartyMembers()) {
|
||||
|
||||
Reference in New Issue
Block a user