Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2ChestInstance


          {
            activeChar.sendPacket(Msg.YOU_HAVE_FAILED_TO_UNLOCK_THE_DOOR);
          }
          return;
        }
        L2ChestInstance target = (L2ChestInstance) targ;
        if(target.isDead())
        {
          return;
        }
        if(target.isFake())
        {
          target.onOpen((L2Player) activeChar);
          return;
        }
        double chance = getActivateRate();
        double levelmod = (double) getMagicLevel() - target.getLevel();
        chance += levelmod * getLevelModifier();
        if(chance < 0)
        {
          chance = 1;
        }
        if(chance < 100)
        {
          activeChar.sendMessage(new CustomMessage("l2p.gameserver.skills.skillclasses.Unlock.Chance", activeChar).addString(getName()).addNumber((long) chance));
        }
        if(Rnd.chance(chance))
        {
          activeChar.sendMessage(new CustomMessage("l2p.gameserver.skills.skillclasses.Unlock.Success", activeChar));
          target.onOpen((L2Player) activeChar);
        }
        else
        {
          activeChar.sendPacket(new SystemMessage(SystemMessage.S1_HAS_FAILED).addString(getName()));
          target.doDie(activeChar);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.instances.L2ChestInstance

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.