newChar.addAdena("Init", Config.STARTING_ADENA, null, false);
newChar.setXYZInvisible(template.spawnX, template.spawnY, template.spawnZ);
newChar.setTitle("");
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());
}