Client: [Account: extr3me - IP: 89.136.27.10] - Failed running: [C] 0B Character
Create
java.lang.NullPointerException
at lt.equal.gameserver.network.clientpackets.CharacterCreate.runImpl(Cha
racterCreate.java:126)
at lt.equal.gameserver.network.clientpackets.L2GameClientPacket.run(L2Ga
meClientPacket.java:77)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* 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 General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package lt.equal.gameserver.network.clientpackets;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import lt.equal.Config;
import lt.equal.gameserver.datatables.CharNameTable;
import lt.equal.gameserver.datatables.CharTemplateTable;
import lt.equal.gameserver.datatables.ItemTable;
import lt.equal.gameserver.datatables.SkillTable;
import lt.equal.gameserver.datatables.SkillTreeTable;
import lt.equal.gameserver.idfactory.IdFactory;
import lt.equal.gameserver.model.L2ItemInstance;
import lt.equal.gameserver.model.L2ShortCut;
import lt.equal.gameserver.model.L2SkillLearn;
import lt.equal.gameserver.model.L2World;
import lt.equal.gameserver.model.quest.Quest;
import lt.equal.gameserver.model.quest.QuestState;
import lt.equal.gameserver.instancemanager.QuestManager;
import lt.equal.gameserver.model.actor.instance.L2PcInstance;
import lt.equal.gameserver.network.L2GameClient;
import lt.equal.gameserver.network.serverpackets.CharCreateFail;
import lt.equal.gameserver.network.serverpackets.CharCreateOk;
import lt.equal.gameserver.network.serverpackets.CharSelectInfo;
import lt.equal.gameserver.templates.L2Item;
import lt.equal.gameserver.templates.L2PcTemplate;
import lt.equal.gameserver.util.Util;
@SuppressWarnings("unused")
public final class CharacterCreate extends L2GameClientPacket
{
private static final String _C__0B_CHARACTERCREATE = "[C] 0B CharacterCreate";
private static Logger _log = Logger.getLogger(CharacterCreate.class.getName());
// cSdddddddddddd
private String _name;
private int _race;
private byte _sex;
private int _classId;
private int _int;
private int _str;
private int _con;
private int _men;
private int _dex;
private int _wit;
private byte _hairStyle;
private byte _hairColor;
private byte _face;
@Override
protected void readImpl()
{
_name = readS();
_race = readD();
_sex = (byte)readD();
_classId = readD();
_int = readD();
_str = readD();
_con = readD();
_men = readD();
_dex = readD();
_wit = readD();
_hairStyle = (byte)readD();
_hairColor = (byte)readD();
_face = (byte)readD();
}
@Override
protected void runImpl()
{
if (CharNameTable.getInstance().accountCharNumber(getClient().getAccountName()) >= Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT && Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT != 0)
{
if (Config.DEBUG)
_log.fine("Max number of characters reached. Creation failed.");
CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_TOO_MANY_CHARACTERS);
sendPacket(ccf);
return;
}
else if (CharNameTable.getInstance().doesCharNameExist(_name))
{
if (Config.DEBUG)
_log.fine("charname: "+ _name + " already exists. creation failed.");
CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_NAME_ALREADY_EXISTS);
sendPacket(ccf);
return;
}
else if ((_name.length() < 3) || (_name.length() > 16) || !Util.isAlphaNumeric(_name) || !isValidName(_name))
{
if (Config.DEBUG)
_log.fine("charname: " + _name + " is invalid. creation failed.");
CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_16_ENG_CHARS);
sendPacket(ccf);
return;
}
if (Config.DEBUG)
_log.fine("charname: " + _name + " classId: " + _classId);
L2PcTemplate template = CharTemplateTable.getInstance().getTemplate(_classId);
if(template == null || template.classBaseLevel > 1)
{
CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED);
sendPacket(ccf);
return;
}
int objectId = IdFactory.getInstance().getNextId();
L2PcInstance newChar = L2PcInstance.create(objectId, template, getClient().getAccountName(),
_name, _hairStyle, _hairColor, _face, _sex!=0);
newChar.setCurrentHp(template.baseHpMax);
newChar.setCurrentCp(template.baseCpMax);
newChar.setCurrentMp(template.baseMpMax);
//newChar.setMaxLoad(template.baseLoad);
// send acknowledgement
CharCreateOk cco = new CharCreateOk();
sendPacket(cco);
initNewChar(getClient(), newChar);
}
private boolean isValidName(String text)
{
boolean result = true;
String test = text;
Pattern pattern;
try
{
pattern = Pattern.compile(Config.CNAME_TEMPLATE);
}
catch (PatternSyntaxException e) // case of illegal pattern
{
_log.warning("ERROR : Character name pattern of config is wrong!");
pattern = Pattern.compile(".*");
}
Matcher regexp = pattern.matcher(test);
if (!regexp.matches())
{
result = false;
}
return result;
}
private void initNewChar(L2GameClient client, L2PcInstance newChar)
{
if (Config.DEBUG) _log.fine("Character init start");
L2World.getInstance().storeObject(newChar);
L2PcTemplate template = newChar.getTemplate();
newChar.addAdena("Init", Config.STARTING_ADENA, null, false);
newChar.setXYZInvisible(-83063, 150791, -3133);
newChar.setTitle("HeroesOfMight");
L2ShortCut shortcut;
//add attack shortcut
shortcut = new L2ShortCut(0,0,3,2,-1,1);
newChar.registerShortCut(shortcut);
//add take shortcut
shortcut = new L2ShortCut(3,0,3,5,-1,1);
newChar.registerShortCut(shortcut);
//add sit shortcut
shortcut = new L2ShortCut(10,0,3,0,-1,1);
newChar.registerShortCut(shortcut);
ItemTable itemTable = ItemTable.getInstance();
L2Item[] items = template.getItems();
for (int i = 0; i < items.length; i++)
{
L2ItemInstance item = newChar.getInventory().addItem("Init", items[i].getItemId(), 1, newChar, null);
if (item.getItemId()==5588){
//add tutbook shortcut
shortcut = new L2ShortCut(11,0,1,item.getObjectId(),-1,1);
newChar.registerShortCut(shortcut);
}
if (item.isEquipable()){
if (newChar.getActiveWeaponItem() == null || !(item.getItem().getType2() != L2Item.TYPE2_WEAPON))
newChar.getInventory().equipItemAndRecord(item);
}
}
L2SkillLearn[] startSkills = SkillTreeTable.getInstance().getAvailableSkills(newChar, newChar.getClassId());
for (int i = 0; i < startSkills.length; i++)
{
newChar.addSkill(SkillTable.getInstance().getInfo(startSkills[i].getId(), startSkills[i].getLevel()), true);
if (startSkills[i].getId()==1001 || startSkills[i].getId()==1177){
shortcut = new L2ShortCut(1,0,2,startSkills[i].getId(),1,1);
newChar.registerShortCut(shortcut);
}
if (startSkills[i].getId()==1216){
shortcut = new L2ShortCut(10,0,2,startSkills[i].getId(),1,1);
newChar.registerShortCut(shortcut);
}
if (Config.DEBUG)
_log.fine("adding starter skill:" + startSkills[i].getId()+ " / "+ startSkills[i].getLevel());
}
L2GameClient.saveCharToDisk(newChar);
newChar.deleteMe(); // release the world of this character and it's inventory
startTutorialQuest(newChar);
// send char list
CharSelectInfo cl = new CharSelectInfo(client.getAccountName(), client.getSessionId().playOkID1);
client.getConnection().sendPacket(cl);
client.setCharSelection(cl.getCharInfo());
if (Config.DEBUG) _log.fine("Character init end");
}
public void startTutorialQuest(L2PcInstance player)
{
QuestState qs = player.getQuestState("255_Tutorial");
Quest q = null;
if (qs == null)
q = QuestManager.getInstance().getQuest("255_Tutorial");
if (q != null)
q.newQuestState(player);
}
@Override
public String getType()
{
return _C__0B_CHARACTERCREATE;
}
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
I can use this folder system for High Five offline server?
The folder does not have a l2.exe file.
Thank you very much if anyone can help me.
https://drive.google.com/file/d/13kU-g_4JJ-sP-kg2F7pqkUOVKmQdubFm/view
ENGLISH
As you know, we have always profiled in the development of Java emulators, we continue to do our favorite thing, and now we have the opportunity to provide you with services in the field of private development of L2 assemblies Essence, Classic and High Five, which we have been doing in recent years, we have not been working on basic builds for a long time and work only on contracts for the world's best projects. These are the best builds we can offer, we have test servers and we can show them to you on the test, and if you are very good at gameplay, you will see a big difference in the quality and detail of the official content compared to the basic builds. These are the best top solutions in the world, which are currently used to implement the largest projects in the world. We guarantee 100% implementation of all official content.
If you have any questions about testing, discussions, etc., please contact our studio and we will discuss everything.
At the moment, you can get acquainted with the preliminary information and prices for Private L2 contracts here:
Private Server packs L2 Essence 464, 447, 388, 362, 286 protocols
Private server packs L2Classic
Private server pack High Five
РУССКИЙ
---------------------------------------------
Как вы знаете мы всегда профилировались на разработке в сфере Java эмуляторов, мы продолжаем заниматься своим любимым делом, и сейчас у нас появилась возможность предоставлять вам услуги в сфере приватных разработок L2 сборок Essence, Classic и High Five, которыми мы занимаемся последние годы, мы уже давно не работаем над базовыми сборками и работаем только на контрактах для лучших мировых проектов. Это лучшие сборки, которые мы можем предложить, у нас есть тестовые сервера, и мы можем показать их вам на тесте, и если вы очень хорошо разбираетесь в игровом процессе, вы увидите большую разницу в качестве и детализации официального контента по сравнению с базовыми сборками. Это лучшие топовые решения в мире, которые на данный момент используются для реализации крупнейших проектов в мире. Мы даем гарантии - 100% реализации всего официального контента.
По вопросам тестирования, обсуждений и тд - пишите по контактам нашей студии и мы все обсудим.
На данный момент вы можете ознакомиться с предварительной информацией и ценами на Приватные контракты L2 тут:
Приватные Сборки L2 Essence 464, 447, 388, 362, 286 protocols
Приватные Сборки L2Classic
Приватная Сборка High Five
--------------------------------------------------------------
Contacts:
Telegram: https://t.me/L2scripts
Whatsapp, Viber: +1 (916) 226 1910
С уважением, Администрация !
Question
extr3me
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.