Package lineage2.gameserver.model.base

Examples of lineage2.gameserver.model.base.MultiSellIngredient


    _zoneListener = new ZoneListener();
    for (String element : ZONES)
    {
      int random = Rnd.get(60 * 1000 * 1, 60 * 1000 * 7);
      int message;
      Zone zone = ReflectionUtils.getZone(element);
      ThreadPoolManager.getInstance().schedule(new CampDestroyTask(zone), random);
      if (random > (5 * 60000))
      {
        message = random - (5 * 60000);
        ThreadPoolManager.getInstance().schedule(new BroadcastMessageTask(0, zone), message);
      }
      if (random > (3 * 60000))
      {
        message = random - (3 * 60000);
        ThreadPoolManager.getInstance().schedule(new BroadcastMessageTask(0, zone), message);
      }
      if (random > 60000)
      {
        message = random - 60000;
        ThreadPoolManager.getInstance().schedule(new BroadcastMessageTask(0, zone), message);
      }
      if (random > 15000)
      {
        message = random - 15000;
        ThreadPoolManager.getInstance().schedule(new BroadcastMessageTask(1, zone), message);
      }
      zone.addListener(_zoneListener);
    }
    _buffTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(new BuffTask(), TICK_BUFF_DELAY, TICK_BUFF_DELAY);
  }
View Full Code Here


  @Override
  public void onReload()
  {
    for (String element : ZONES)
    {
      Zone zone = ReflectionUtils.getZone(element);
      zone.removeListener(_zoneListener);
    }
    if (_buffTask != null)
    {
      _buffTask.cancel(false);
      _buffTask = null;
View Full Code Here

    @Override
    public void runImpl()
    {
      for (String element : ZONES)
      {
        Zone zone = ReflectionUtils.getZone(element);
        NpcInstance npc = getKasha(zone);
        if ((npc != null) && (zone != null))
        {
          int curseLvl = 0;
          int yearningLvl = 0;
          int despairLvl = 0;
          for (Creature c : zone.getObjects())
          {
            if (c.isMonster() && !c.isDead())
            {
              if (getRealNpcId((NpcInstance) c) == mobs[0])
              {
                curseLvl++;
              }
              else if (getRealNpcId((NpcInstance) c) == mobs[1])
              {
                yearningLvl++;
              }
              else if (getRealNpcId((NpcInstance) c) == mobs[2])
              {
                despairLvl++;
              }
            }
          }
          if ((yearningLvl > 0) || (curseLvl > 0) || (despairLvl > 0))
          {
            for (Creature cha : zone.getInsidePlayables())
            {
              boolean casted = false;
              if (curseLvl > 0)
              {
                addEffect(npc, cha.getPlayer(), SkillTable.getInstance().getInfo(_buffs[0], curseLvl), true);
View Full Code Here

  private void init()
  {
    _zoneListener = new ZoneListener();
    for (String s : zones)
    {
      Zone zone = ReflectionUtils.getZone(s);
      zone.addListener(_zoneListener);
    }
  }
View Full Code Here

   * Method init.
   */
  private void init()
  {
    _zoneListener = new ZoneListener();
    Zone zone = ReflectionUtils.getZone(ZONE_NAME);
    if (zone != null)
    {
      zone.addListener(_zoneListener);
    }
  }
View Full Code Here

    }
    if (needFix == 0)
    {
      return ingredients;
    }
    MultiSellIngredient temp;
    List<MultiSellIngredient> result = new ArrayList<>(ingredients.size() + needFix);
    for (MultiSellIngredient ingredient : ingredients)
    {
      ingredient = ingredient.clone();
      while (ingredient.getItemCount() > Integer.MAX_VALUE)
      {
        temp = ingredient.clone();
        temp.setItemCount(2000000000);
        result.add(temp);
        ingredient.setItemCount(ingredient.getItemCount() - 2000000000);
      }
      if (ingredient.getItemCount() > 0)
      {
View Full Code Here

    {
      if (NODE_INGRIDIENT.equalsIgnoreCase(d.getNodeName()))
      {
        int id = Integer.parseInt(d.getAttributes().getNamedItem("id").getNodeValue());
        long count = Long.parseLong(d.getAttributes().getNamedItem("count").getNodeValue());
        MultiSellIngredient mi = new MultiSellIngredient(id, count);
        if (d.getAttributes().getNamedItem("enchant") != null)
        {
          mi.setItemEnchant(Integer.parseInt(d.getAttributes().getNamedItem("enchant").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("mantainIngredient") != null)
        {
          mi.setMantainIngredient(Boolean.parseBoolean(d.getAttributes().getNamedItem("mantainIngredient").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("fireAttr") != null)
        {
          mi.getItemAttributes().setFire(Integer.parseInt(d.getAttributes().getNamedItem("fireAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("waterAttr") != null)
        {
          mi.getItemAttributes().setWater(Integer.parseInt(d.getAttributes().getNamedItem("waterAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("earthAttr") != null)
        {
          mi.getItemAttributes().setEarth(Integer.parseInt(d.getAttributes().getNamedItem("earthAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("windAttr") != null)
        {
          mi.getItemAttributes().setWind(Integer.parseInt(d.getAttributes().getNamedItem("windAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("holyAttr") != null)
        {
          mi.getItemAttributes().setHoly(Integer.parseInt(d.getAttributes().getNamedItem("holyAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("unholyAttr") != null)
        {
          mi.getItemAttributes().setUnholy(Integer.parseInt(d.getAttributes().getNamedItem("unholyAttr").getNodeValue()));
        }
        entry.addIngredient(mi);
      }
      else if (NODE_PRODUCTION.equalsIgnoreCase(d.getNodeName()))
      {
        int id = Integer.parseInt(d.getAttributes().getNamedItem("id").getNodeValue());
        long count = Long.parseLong(d.getAttributes().getNamedItem("count").getNodeValue());
        MultiSellIngredient mi = new MultiSellIngredient(id, count);
        if (d.getAttributes().getNamedItem("enchant") != null)
        {
          mi.setItemEnchant(Integer.parseInt(d.getAttributes().getNamedItem("enchant").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("chance") != null)
        {
          mi.setChance(Integer.parseInt(d.getAttributes().getNamedItem("chance").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("fireAttr") != null)
        {
          mi.getItemAttributes().setFire(Integer.parseInt(d.getAttributes().getNamedItem("fireAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("waterAttr") != null)
        {
          mi.getItemAttributes().setWater(Integer.parseInt(d.getAttributes().getNamedItem("waterAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("earthAttr") != null)
        {
          mi.getItemAttributes().setEarth(Integer.parseInt(d.getAttributes().getNamedItem("earthAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("windAttr") != null)
        {
          mi.getItemAttributes().setWind(Integer.parseInt(d.getAttributes().getNamedItem("windAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("holyAttr") != null)
        {
          mi.getItemAttributes().setHoly(Integer.parseInt(d.getAttributes().getNamedItem("holyAttr").getNodeValue()));
        }
        if (d.getAttributes().getNamedItem("unholyAttr") != null)
        {
          mi.getItemAttributes().setUnholy(Integer.parseInt(d.getAttributes().getNamedItem("unholyAttr").getNodeValue()));
        }
        if (!Config.ALT_ALLOW_SHADOW_WEAPONS && (id > 0))
        {
          ItemTemplate item = ItemHolder.getInstance().getTemplate(id);
          if ((item != null) && item.isShadowItem() && item.isWeapon() && !Config.ALT_ALLOW_SHADOW_WEAPONS)
View Full Code Here

    if (((ingredient = parseItemIdAndCount(a[0])) == null) || ((production = parseItemIdAndCount(a[1])) == null))
    {
      return null;
    }
    MultiSellEntry entry = new MultiSellEntry();
    entry.addIngredient(new MultiSellIngredient((int) ingredient[0], ingredient[1]));
    entry.addProduct(new MultiSellIngredient((int) production[0], production[1]));
    return entry;
  }
View Full Code Here

          }
        }
        adena = Math.round(adena + tax);
        if (adena > 0)
        {
          ingridients.add(new MultiSellIngredient(57, adena));
        }
        ent.setTax(Math.round(tax));
        ent.getIngredients().clear();
        ent.getIngredients().addAll(ingridients);
      }
View Full Code Here

    {
      if (itm.canBeCrystallized(player))
      {
        final ItemTemplate crystal = ItemHolder.getInstance().getTemplate(itm.getTemplate().getCrystalType().cry);
        MultiSellEntry possibleEntry = new MultiSellEntry(++entry, crystal.getItemId(), itm.getTemplate().getCrystalCount(), 0);
        possibleEntry.addIngredient(new MultiSellIngredient(itm.getItemId(), 1, itm.getEnchantLevel()));
        possibleEntry.addIngredient(new MultiSellIngredient(ItemTemplate.ITEM_ID_ADENA, Math.round(itm.getTemplate().getCrystalCount() * crystal.getReferencePrice() * 0.05), 0));
        list.addEntry(possibleEntry);
      }
    }
    MultiSellHolder.getInstance().SeparateAndSend(list, player, castle == null ? 0. : castle.getTaxRate());
  }
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.base.MultiSellIngredient

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.