Package net.sf.l2j.gameserver.model

Examples of net.sf.l2j.gameserver.model.L2ShortCut


    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());
    }
View Full Code Here


        for (L2ShortCut sc : allShortCuts)
        {
          if (sc.getId() == _skillId && sc.getType() == L2ShortCut.TYPE_SKILL)
          {
            L2ShortCut newsc = new L2ShortCut(sc.getSlot(), sc.getPage(), sc.getType(), sc.getId(), _skillLvl, 1);
            player.sendPacket(new ShortCutRegister(newsc));
            player.registerShortCut(newsc);
          }
        }
  }
View Full Code Here

    writeC(0x45);
    writeD(_shortCuts.length);

    for (int i = 0; i < _shortCuts.length; i++)
    {
        L2ShortCut sc = _shortCuts[i];
            writeD(sc.getType());
            writeD(sc.getSlot() + sc.getPage() * 12);

            switch(sc.getType())
            {
            case L2ShortCut.TYPE_ITEM: //1
              writeD(sc.getId());
              writeD(0x01);
              writeD(-1);
              writeD(0x00);
              writeD(0x00);
              writeH(0x00);
              writeH(0x00);
              break;
            case L2ShortCut.TYPE_SKILL: //2
              writeD(sc.getId());
              writeD(sc.getLevel());
              writeC(0x00); // C5
              writeD(0x01); // C6
              break;
            case L2ShortCut.TYPE_ACTION: //3
              writeD(sc.getId());
              writeD(0x01); // C6
              break;
            case L2ShortCut.TYPE_MACRO: //4
              writeD(sc.getId());
              writeD(0x01); // C6
              break;
            case L2ShortCut.TYPE_RECIPE: //5
              writeD(sc.getId());
              writeD(0x01); // C6
              break;
            default:
              writeD(sc.getId());
            writeD(0x01); // C6
            }
    }
  }
View Full Code Here

      case 0x01// item
      case 0x03// action
      case 0x04// macro
            case 0x05// recipe
      {
        L2ShortCut sc = new L2ShortCut(_slot, _page, _type, _id, -1, _unk);
        sendPacket(new ShortCutRegister(sc));
        activeChar.registerShortCut(sc);
        break;
      }
      case 0x02// skill
      {
        int level = activeChar.getSkillLevel( _id );
        if (level > 0)
        {
          L2ShortCut sc = new L2ShortCut(_slot, _page, _type, _id, level, _unk);
          sendPacket(new ShortCutRegister(sc));
          activeChar.registerShortCut(sc);
        }
        break;
      }
View Full Code Here

      for (L2ShortCut sc : allShortCuts)
      {
        if (sc.getId() == _id && sc.getType() == L2ShortCut.TYPE_SKILL)
        {
          L2ShortCut newsc = new L2ShortCut(sc.getSlot(), sc
              .getPage(), sc.getType(), sc.getId(), _level, 1);
          player.sendPacket(new ShortCutRegister(newsc));
          player.registerShortCut(newsc);
        }
      }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.L2ShortCut

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.