Package com.l2jfrozen.gameserver.model.actor.instance

Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PetInstance


    _swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
    _maxHp = _summon.getMaxHp();
    _maxMp = _summon.getMaxMp();
    if(_summon instanceof L2PetInstance)
    {
      L2PetInstance pet = (L2PetInstance) _summon;
      _curFed = pet.getCurrentFed(); // how fed it is
      _maxFed = pet.getMaxFed(); //max fed it can be
    }
    else if (_summon instanceof L2SummonInstance)
    {
      L2SummonInstance sum = (L2SummonInstance)_summon;
      _curFed = sum.getTimeRemaining();
View Full Code Here


    // if this player has a pet that takes from the owner's Exp, give the pet Exp now

    if(activeChar.getPet() instanceof L2PetInstance)
    {
      L2PetInstance pet = (L2PetInstance) activeChar.getPet();
      ratioTakenByPet = pet.getPetData().getOwnerExpTaken();

      // only give exp/sp to the pet by taking from the owner if the pet has a non-zero, positive ratio
      // allow possible customizations that would have the pet earning more than 100% of the owner's exp/sp
      if(ratioTakenByPet > 0 && !pet.isDead())
      {
        pet.addExpAndSp((long) (addToExp * ratioTakenByPet), (int) (addToSp * ratioTakenByPet));
      }

      // now adjust the max ratio to avoid the owner earning negative exp/sp
      if(ratioTakenByPet > 1)
      {
View Full Code Here

    {
      player.sendMessage("You get items from pet too fast.");
      return;
    }
   
    L2PetInstance pet = (L2PetInstance) player.getPet();

    if(player.getActiveEnchantItem() != null)
    {
      Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " Tried To Use Enchant Exploit , And Got Banned!", IllegalPlayerAction.PUNISH_KICKBAN);
      return;
    }

    if(_amount < 0)
    {
      player.setAccessLevel(-1);
      Util.handleIllegalPlayerAction(player, "[RequestGetItemFromPet] count < 0! ban! oid: " + _objectId + " owner: " + player.getName(), Config.DEFAULT_PUNISH);
      return;
    }
    else if(_amount == 0)
      return;

    if(player.getDistanceSq(pet) > 40000) // 200*200
    {
      player.sendPacket(new SystemMessage(SystemMessageId.TARGET_TOO_FAR));
      sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }

    if(pet.transferItem("Transfer", _objectId, _amount, player.getInventory(), player, pet) == null)
    {
      _log.warning("Invalid item transfer request: " + pet.getName() + "(pet) --> " + player.getName());
    }
    player.sendPacket(new ItemList(player, true));
  }
View Full Code Here

    _summon = summon;
    _maxHp = _summon.getMaxHp();
    _maxMp = _summon.getMaxMp();
    if(_summon instanceof L2PetInstance)
    {
      L2PetInstance pet = (L2PetInstance) _summon;
      _curFed = pet.getCurrentFed(); // how fed it is
      _maxFed = pet.getMaxFed(); //max fed it can be
    }
    else if (_summon instanceof L2SummonInstance)
    {
      L2SummonInstance sum = (L2SummonInstance)_summon;
      _curFed = sum.getTimeRemaining();
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.actor.instance.L2PetInstance

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.