{
if (Config.DEBUG)
_log.fine("DEBUG "+getType()+": Character init start");
L2World.getInstance().storeObject(newChar);
L2PcTemplate template = newChar.getTemplate();
// Starting Items
if (Config.STARTING_ADENA > 0)
newChar.addAdena("Init", Config.STARTING_ADENA, null, false);
if (Config.STARTING_AA > 0)
newChar.addAncientAdena("Init", Config.STARTING_AA, null, false);
if (Config.CUSTOM_STARTER_ITEMS_ENABLED)
{
if (newChar.isMageClass())
{
for (int[] reward : Config.STARTING_CUSTOM_ITEMS_M)
{
if (ItemTable.getInstance().createDummyItem(reward[0]).isStackable())
newChar.getInventory().addItem("Starter Items Mage", reward[0], reward[1], newChar, null);
else
for (int i = 0; i < reward[1]; ++i)
newChar.getInventory().addItem("Starter Items Mage", reward[0], 1, newChar, null);
}
}
else
{
for (int[] reward : Config.STARTING_CUSTOM_ITEMS_F)
{
if(ItemTable.getInstance().createDummyItem(reward[0]).isStackable())
newChar.getInventory().addItem("Starter Items Fighter", reward[0], reward[1], newChar, null);
else
for (int i = 0; i < reward[1]; ++i)
newChar.getInventory().addItem("Starter Items Fighter", reward[0], 1, newChar, null);
}
}
}
if (Config.SPAWN_CHAR)
newChar.setXYZInvisible(Config.SPAWN_X, Config.SPAWN_Y, Config.SPAWN_Z);
else
newChar.setXYZInvisible(template.spawnX, template.spawnY, template.spawnZ);
if (Config.ALLOW_CREATE_LVL)
newChar.getStat().addExp(ExperienceData.getInstance().getExpForLevel(Config.CHAR_CREATE_LVL));
if (Config.CHAR_TITLE)
newChar.setTitle(Config.ADD_CHAR_TITLE);
else
newChar.setTitle("");
if (Config.PVP_PK_TITLE)
newChar.setTitle(Config.PVP_TITLE_PREFIX + "0" + Config.PK_TITLE_PREFIX + "0 ");
// Shortcuts
newChar.registerShortCut(new L2ShortCut(0, 0, 3, 2, -1, 1)); // Attack
newChar.registerShortCut(new L2ShortCut(3, 0, 3, 5, -1, 1)); // Take
newChar.registerShortCut(new L2ShortCut(10, 0, 3, 0, -1, 1)); // Sit
ItemTable itemTable = ItemTable.getInstance();
L2Item[] items = template.getItems();
for (L2Item item2 : items)
{
L2ItemInstance item = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null);