Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.CursedWeapon


        }
      }
     
      if (cursedWeaponsManager.isCursed(id))
      {
        final CursedWeapon cursedWeapon = cursedWeaponsManager.getCursedWeapon(id);
        if (cursedWeapon.isActive())
        {
          activeChar.sendMessage("This Cursed Weapon is already active!");
        }
        else
        {
          //end time is equal to dropped one
          long endTime = System.currentTimeMillis() + cursedWeapon.getDuration() * 60000L;
          cursedWeapon.setEndTime(endTime);
         
          L2Object target = activeChar.getTarget();
          if ((target != null) && (target instanceof L2PcInstance))
          {
            ((L2PcInstance) target).addItem("AdminCursedWeaponAdd", id, 1, target, true);
View Full Code Here


              NamedNodeMap attrs = d.getAttributes();
              int id = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
              int skillId = Integer.parseInt(attrs.getNamedItem("skillId").getNodeValue());
              String name = attrs.getNamedItem("name").getNodeValue();

              CursedWeapon cw = new CursedWeapon(id, skillId, name);
              name = null;

              int val;
              for(Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
              {
                if("dropRate".equalsIgnoreCase(cd.getNodeName()))
                {
                  attrs = cd.getAttributes();
                  val = Integer.parseInt(attrs.getNamedItem("val").getNodeValue());
                  cw.setDropRate(val);
                }
                else if("duration".equalsIgnoreCase(cd.getNodeName()))
                {
                  attrs = cd.getAttributes();
                  val = Integer.parseInt(attrs.getNamedItem("val").getNodeValue());
                  cw.setDuration(val);
                }
                else if("durationLost".equalsIgnoreCase(cd.getNodeName()))
                {
                  attrs = cd.getAttributes();
                  val = Integer.parseInt(attrs.getNamedItem("val").getNodeValue());
                  cw.setDurationLost(val);
                }
                else if("disapearChance".equalsIgnoreCase(cd.getNodeName()))
                {
                  attrs = cd.getAttributes();
                  val = Integer.parseInt(attrs.getNamedItem("val").getNodeValue());
                  cw.setDisapearChance(val);
                }
                else if("stageKills".equalsIgnoreCase(cd.getNodeName()))
                {
                  attrs = cd.getAttributes();
                  val = Integer.parseInt(attrs.getNamedItem("val").getNodeValue());
                  cw.setStageKills(val);
                }
              }

              // Store cursed weapon
              _cursedWeapons.put(id, cw);
View Full Code Here

        int playerKarma = rset.getInt("playerKarma");
        int playerPkKills = rset.getInt("playerPkKills");
        int nbKills = rset.getInt("nbKills");
        long endTime = rset.getLong("endTime");

        CursedWeapon cw = _cursedWeapons.get(itemId);
        cw.setPlayerId(playerId);
        cw.setPlayerKarma(playerKarma);
        cw.setPlayerPkKills(playerPkKills);
        cw.setNbKills(nbKills);
        cw.setEndTime(endTime);
        cw.reActivate();

        cw = null;
       
        // clean up the cursed weapons table.
        removeFromDb(itemId);
View Full Code Here

    }
  }

  public void activate(L2PcInstance player, L2ItemInstance item)
  {
    CursedWeapon cw = _cursedWeapons.get(item.getItemId());
    if(player.isCursedWeaponEquiped()) // cannot own 2 cursed swords
    {
      CursedWeapon cw2 = _cursedWeapons.get(player.getCursedWeaponEquipedId());
      /* TODO: give the bonus level in a more appropriate manner.
       *  The following code adds "_stageKills" levels.  This will also show in the char status.
       * I do not have enough info to know if the bonus should be shown in the pk count, or if it
       * should be a full "_stageKills" bonus or just the remaining from the current count till the
       * of the current stage...
       * This code is a TEMP fix, so that the cursed weapon's bonus level can be observed with as
       * little change in the code as possible, until proper info arises.
       */
      cw2.setNbKills(cw2.getStageKills() - 1);
      cw2.increaseKills();

      // erase the newly obtained cursed weapon
      cw.setPlayer(player); // NECESSARY in order to find which inventory the weapon is in!
      cw.endOfLife(); // expire the weapon and clean up.
     
View Full Code Here

  }

 
  public void drop(int itemId, L2Character killer)
  {
    CursedWeapon cw = _cursedWeapons.get(itemId);

    cw.dropIt(killer);
    cw = null;
  }
View Full Code Here

    cw = null;
  }

  public void increaseKills(int itemId)
  {
    CursedWeapon cw = _cursedWeapons.get(itemId);

    cw.increaseKills();
    cw = null;
  }
View Full Code Here

    cw = null;
  }

  public int getLevel(int itemId)
  {
    CursedWeapon cw = _cursedWeapons.get(itemId);

    return cw.getLevel();
  }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.CursedWeapon

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.