Package lineage2.gameserver.model.items.etcitems

Examples of lineage2.gameserver.model.items.etcitems.AttributeStoneInfo


     * Method runImpl.
     */
    @Override
    public void runImpl()
    {
      final NpcInstance actor = getActor();
      if (actor.getNpcState() == 1)
      {
        actor.setNpcState(2);
      }
      else
      {
        actor.setNpcState(1);
      }
    }
View Full Code Here


   * @param killer Creature
   */
  @Override
  protected void onEvtDead(Creature killer)
  {
    final NpcInstance actor = getActor();
    boolean isOverhit = false;
    if (actor instanceof MonsterInstance)
    {
      isOverhit = ((MonsterInstance) actor).getOverhitDamage() > 0;
    }
    final int npcId = actor.getNpcId();
    int nextId = 0;
    int type = 0;
    if ((npcId != getNextDoppler(npcId)) && (npcId != getNextVoid(npcId)))
    {
      type = 1;
      if (isOverhit)
      {
        if (Rnd.chance(70))
        {
          nextId = getNextDoppler(npcId);
        }
        else if (Rnd.chance(80))
        {
          nextId = getNextVoid(npcId);
        }
      }
      else if (Rnd.chance(65))
      {
        nextId = getNextDoppler(npcId);
      }
    }
    else if (npcId == getNextDoppler(npcId))
    {
      type = 2;
      if (isOverhit)
      {
        if (Rnd.chance(60))
        {
          nextId = getNextDoppler(npcId);
        }
        else if (Rnd.chance(90))
        {
          nextId = getNextVoid(npcId);
        }
      }
      else if (Rnd.chance(40))
      {
        nextId = getNextDoppler(npcId);
      }
      else if (Rnd.chance(50))
      {
        nextId = getNextVoid(npcId);
      }
    }
    else if (npcId == getNextVoid(npcId))
    {
      type = 3;
      if (isOverhit)
      {
        if (Rnd.chance(80))
        {
          nextId = getNextVoid(npcId);
        }
      }
      else if (Rnd.chance(50))
      {
        nextId = getNextVoid(npcId);
      }
    }
    final Reflection r = actor.getReflection();
    boolean spawnPossible = true;
    if (r instanceof KamalokaNightmare)
    {
      final KamalokaNightmare kama = (KamalokaNightmare) r;
      kama.addKilledKanabion(type);
View Full Code Here

      }
    }
    _itemId = item.getItemId();
    _att = new int[6];

    AttributeStoneInfo asi = AttributeStoneManager.getStoneInfo(_itemId);
    _att[asi.getElement().getId()] = 1;
    _stoneLvl = asi.getStoneLevel();
  }
View Full Code Here

    if (itemToEnchant.isStackable() || ((stone = inventory.getItemByObjectId(stone.getObjectId())) == null))
    {
      activeChar.sendActionFailed();
      return;
    }
    AttributeStoneInfo asi = AttributeStoneManager.getStoneInfo(stone.getItemId());
    if (asi == null)
    {
      return;
    }
    Element element = itemToEnchant.isArmor() ? Element.getReverseElement(asi.getElement()) : asi.getElement();
    if (itemToEnchant.isArmor())
    {
      if (itemToEnchant.getAttributeElementValue(Element.getReverseElement(element), false) != 0)
      {
        activeChar.sendPacket(Msg.ANOTHER_ELEMENTAL_POWER_HAS_ALREADY_BEEN_ADDED_THIS_ELEMENTAL_POWER_CANNOT_BE_ADDED, ActionFail.STATIC);
        return;
      }
    }
    else if (itemToEnchant.isWeapon())
    {
      if ((itemToEnchant.getAttributeElement() != Element.NONE) && (itemToEnchant.getAttributeElement() != element))
      {
        activeChar.sendPacket(Msg.ANOTHER_ELEMENTAL_POWER_HAS_ALREADY_BEEN_ADDED_THIS_ELEMENTAL_POWER_CANNOT_BE_ADDED, ActionFail.STATIC);
        return;
      }
    }
    else
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, ActionFail.STATIC);
      return;
    }
    if (item.isUnderwear() || item.isCloak() || item.isBracelet() || item.isBelt() || !item.isAttributable())
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, ActionFail.STATIC);
      return;
    }
    int maxValue = itemToEnchant.isWeapon() ? asi.getMaxWeapon() : asi.getMaxArmor();
    int minValue = itemToEnchant.isWeapon() ? asi.getMinWeapon() : asi.getMinArmor();
    int currentValue = itemToEnchant.getAttributeElementValue(element, false);
    if ((currentValue >= maxValue) || (currentValue < minValue))
    {
      activeChar.sendPacket(Msg.ELEMENTAL_POWER_ENCHANCER_USAGE_HAS_BEEN_CANCELLED, ActionFail.STATIC);
      return;
    }
    if (itemToEnchant.getOwnerId() != activeChar.getObjectId())
    {
      activeChar.sendPacket(Msg.INAPPROPRIATE_ENCHANT_CONDITIONS, ActionFail.STATIC);
      return;
    }
    if (!inventory.destroyItem(stone, 1L))
    {
      activeChar.sendActionFailed();
      return;
    }
    if (Rnd.chance(asi.getChance()))
    {
      if (itemToEnchant.getEnchantLevel() == 0)
      {
        SystemMessage sm = new SystemMessage(SystemMessage.S2_ELEMENTAL_POWER_HAS_BEEN_ADDED_SUCCESSFULLY_TO_S1);
        sm.addItemName(itemToEnchant.getItemId());
        sm.addItemName(stone.getItemId());
        activeChar.sendPacket(sm);
      }
      else
      {
        SystemMessage sm = new SystemMessage(SystemMessage.S3_ELEMENTAL_POWER_HAS_BEEN_ADDED_SUCCESSFULLY_TO__S1S2);
        sm.addNumber(itemToEnchant.getEnchantLevel());
        sm.addItemName(itemToEnchant.getItemId());
        sm.addItemName(stone.getItemId());
        activeChar.sendPacket(sm);
      }
      int value = itemToEnchant.isWeapon() ? asi.getIncWeapon() : asi.getIncArmor();
      if ((itemToEnchant.getAttributeElementValue(element, false) == 0) && itemToEnchant.isWeapon())
      {
        value = 20;
      }
      boolean equipped = itemToEnchant.isEquipped();
View Full Code Here

      Player player = cha.getPlayer();
     
      QuestState qs = player.getQuestState(_10301_ShadowOfTerrorBlackishRedFog.class);
      if(qs != null && qs.getCond() == 3 && player.getVar("instance10301") == null)
      {
        Quest q = QuestManager.getQuest(10301);
        player.processQuestEvent(q.getName(), "enterInstance", null);
        //player.setVar("instance10301", "true", -1);
        return;
      }
      if (!player.getVarB("@25_20_telzone_to_magmeld"))
      {
View Full Code Here

    {
      htmltext = "32640-10.htm";
    }
    else if (id == CREATED)
    {
      QuestState ImTheOnlyOneYouCanTrust = st.getPlayer().getQuestState(_240_ImTheOnlyOneYouCanTrust.class);
      if ((st.getPlayer().getLevel() >= 81) && (ImTheOnlyOneYouCanTrust != null) && ImTheOnlyOneYouCanTrust.isCompleted())
      {
        htmltext = "32640-1.htm";
      }
      else
      {
View Full Code Here

      {
        return;
      }
      Player player = cha.getPlayer();
     
      QuestState qs = player.getQuestState(_10301_ShadowOfTerrorBlackishRedFog.class);
      if(qs != null && qs.getCond() == 3 && player.getVar("instance10301") == null)
      {
        Quest q = QuestManager.getQuest(10301);
        player.processQuestEvent(q.getName(), "enterInstance", null);
        //player.setVar("instance10301", "true", -1);
        return;
View Full Code Here

      if (cha.isPlayer())
      {
        Player player = cha.getPlayer();
        if (!player.getVarB("@ti_present_video"))
        {
          QuestState qs = player.getQuestState(_10320_LetsGototheCentralSquare.class);
          if ((qs != null) && (qs.getCond() == 1))
          {
            player.showQuestMovie(SceneMovie.si_illusion_02_que);
          }
          else
          {
View Full Code Here

      Class.forName(GarbageCollector.class.getName());
    }
    Shutdown.getInstance().schedule(Config.RESTART_AT_TIME, Shutdown.RESTART);
    _log.info("GameServer Started");
    _log.info("Maximum Numbers of Connected Players: " + Config.MAXIMUM_ONLINE_USERS);
    GamePacketHandler gph = new GamePacketHandler();
    InetAddress serverAddr = Config.GAMESERVER_HOSTNAME.equalsIgnoreCase("*") ? null : InetAddress.getByName(Config.GAMESERVER_HOSTNAME);
    _selectorThreads = new SelectorThread[Config.PORTS_GAME.length];
    for (int i = 0; i < Config.PORTS_GAME.length; i++)
    {
      _selectorThreads[i] = new SelectorThread<>(Config.SELECTOR_CONFIG, gph, gph, gph, null);
View Full Code Here

      list.add(new CharInfo(this));
      list.add(RelationChanged.update(forPlayer, this, forPlayer));
    }
    if (isInCombat())
    {
      list.add(new AutoAttackStart(getObjectId()));
    }
    if (isMoving || isFollow)
    {
      list.add(movePacket());
    }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.items.etcitems.AttributeStoneInfo

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.