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

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


    if(!checkAllowed(player))
      return;

    if(!PowerPakConfig.GLOBALGK_USEBBS && !PowerPakConfig.GLOBALGK_USECOMMAND){
     
      L2NpcInstance gknpc = null;
     
      if(player.getTarget()!=null)
        if(player.getTarget() instanceof L2NpcInstance)
        {
          gknpc = (L2NpcInstance)player.getTarget();
          if(gknpc.getTemplate().getNpcId()!=PowerPakConfig.GLOBALGK_NPC)
            gknpc=null;
        }
     
      //Possible fix to Buffer - 1
      if (gknpc == null)
View Full Code Here


  @Override
  public void onStart()
  {
    if(getEffected() instanceof L2NpcInstance)
    {
      L2NpcInstance npc = (L2NpcInstance) getEffected();
      npc.setCollisionHeight((int) (npc.getCollisionHeight() * 1.24));
      npc.setCollisionRadius((int) (npc.getCollisionRadius() * 1.19));

      getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_GROW);
    }
  }
 
View Full Code Here

  @Override
  public boolean onActionTime()
  {
    if(getEffected() instanceof L2NpcInstance)
    {
      L2NpcInstance npc = (L2NpcInstance) getEffected();
      npc.setCollisionHeight(npc.getTemplate().collisionHeight);
      npc.setCollisionRadius(npc.getTemplate().collisionRadius);

      getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_GROW);
    }
    return false;
  }
View Full Code Here

  @Override
  public void onExit()
  {
    if(getEffected() instanceof L2NpcInstance)
    {
      L2NpcInstance npc = (L2NpcInstance) getEffected();
      npc.setCollisionHeight(npc.getTemplate().collisionHeight);
      npc.setCollisionRadius(npc.getTemplate().collisionRadius);

      getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_GROW);
    }
  }
View Full Code Here

      // Go through all L2Object that belong to its faction
      for(L2Object obj : _actor.getKnownList().getKnownObjects().values())
      {
        if(obj instanceof L2NpcInstance)
        {
          L2NpcInstance npc = (L2NpcInstance) obj;
          String faction_id = ((L2NpcInstance) _actor).getFactionId();

          if(!faction_id.equalsIgnoreCase(npc.getFactionId()) || npc.getFactionRange() == 0)
          {
            faction_id = null;
            continue;
          }

          // Check if the L2Object is inside the Faction Range of the actor
          if(_actor.getAttackByList()!=null && _actor.isInsideRadius(npc, npc.getFactionRange(), true, false) && npc.getAI() != null &&
              _actor.getAttackByList().contains(originalAttackTarget))
          {
            if(npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE || npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE){
             
              if(GeoData.getInstance().canSeeTarget(_actor, npc) && Math.abs(originalAttackTarget.getZ() - npc.getZ()) < 600){
               
                if(originalAttackTarget instanceof L2PcInstance && originalAttackTarget.isInParty() && originalAttackTarget.getParty().isInDimensionalRift())
                {
                  byte riftType = originalAttackTarget.getParty().getDimensionalRift().getType();
                  byte riftRoom = originalAttackTarget.getParty().getDimensionalRift().getCurrentRoom();

                  if(_actor instanceof L2RiftInvaderInstance && !DimensionalRiftManager.getInstance().getRoom(riftType, riftRoom).checkIfInZone(npc.getX(), npc.getY(), npc.getZ()))
                  {
                    continue;
                  }
                }
                // Notify the L2Object AI with EVT_AGGRESSION
                npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, originalAttackTarget, 1);
               
              }
             
            }
           
            if(GeoData.getInstance().canSeeTarget(_actor, npc) && Math.abs(originalAttackTarget.getZ() - npc.getZ()) < 500){
             
              if(originalAttackTarget instanceof L2PcInstance || originalAttackTarget instanceof L2Summon)
              {
                L2PcInstance player = originalAttackTarget instanceof L2PcInstance ? (L2PcInstance) originalAttackTarget : ((L2Summon) originalAttackTarget).getOwner();
                for(Quest quest : npc.getTemplate().getEventQuests(Quest.QuestEventType.ON_FACTION_CALL))
                {
                  quest.notifyFactionCall(npc, (L2NpcInstance) _actor, player, (originalAttackTarget instanceof L2Summon));
                }
              }
             
View Full Code Here

        for(AutoChatDefinition chatDef : chatDefinitions)
        {
          try
          {
            L2NpcInstance chatNpc = chatDef._npcInstance;
            List<L2PcInstance> nearbyPlayers = new FastList<L2PcInstance>();
            List<L2PcInstance> nearbyGMs = new FastList<L2PcInstance>();

            for(L2Character player : chatNpc.getKnownList().getKnownCharactersInRadius(1500))
            {
              if(!(player instanceof L2PcInstance))
              {
                continue;
              }

              if(((L2PcInstance) player).isGM())
              {
                nearbyGMs.add((L2PcInstance) player);
              }
              else
              {
                nearbyPlayers.add((L2PcInstance) player);
              }
            }

            int maxIndex = chatDef.getChatTexts().length;
            int lastIndex = Rnd.nextInt(maxIndex);

            String creatureName = chatNpc.getName();
            String text;

            if(!chatDef.isRandomChat())
            {
              lastIndex = chatDef._chatIndex;
              lastIndex++;

              if(lastIndex == maxIndex)
              {
                lastIndex = 0;
              }

              chatDef._chatIndex = lastIndex;
            }

            text = chatDef.getChatTexts()[lastIndex];

            if(text == null)
              return;

            if(!nearbyPlayers.isEmpty())
            {
              int randomPlayerIndex = Rnd.nextInt(nearbyPlayers.size());

              L2PcInstance randomPlayer = nearbyPlayers.get(randomPlayerIndex);

              final int winningCabal = SevenSigns.getInstance().getCabalHighestScore();
              int losingCabal = SevenSigns.CABAL_NULL;

              if(winningCabal == SevenSigns.CABAL_DAWN)
              {
                losingCabal = SevenSigns.CABAL_DUSK;
              }
              else if(winningCabal == SevenSigns.CABAL_DUSK)
              {
                losingCabal = SevenSigns.CABAL_DAWN;
              }

              if(text.indexOf("%player_random%") > -1)
              {
                text = text.replaceAll("%player_random%", randomPlayer.getName());
              }

              if(text.indexOf("%player_cabal_winner%") > -1)
              {
                for(L2PcInstance nearbyPlayer : nearbyPlayers)
                {
                  if(SevenSigns.getInstance().getPlayerCabal(nearbyPlayer) == winningCabal)
                  {
                    text = text.replaceAll("%player_cabal_winner%", nearbyPlayer.getName());
                    break;
                  }
                }
              }

              if(text.indexOf("%player_cabal_loser%") > -1)
              {
                for(L2PcInstance nearbyPlayer : nearbyPlayers)
                {
                  if(SevenSigns.getInstance().getPlayerCabal(nearbyPlayer) == losingCabal)
                  {
                    text = text.replaceAll("%player_cabal_loser%", nearbyPlayer.getName());
                    break;
                  }
                }
              }

              randomPlayer = null;
            }

            if(text == null)
              return;

            if(text.contains("%player_cabal_loser%") || text.contains("%player_cabal_winner%") || text.contains("%player_random%"))
              return;

            CreatureSay cs = new CreatureSay(chatNpc.getObjectId(), 0, creatureName, text);

            for(L2PcInstance nearbyPlayer : nearbyPlayers)
            {
              nearbyPlayer.sendPacket(cs);
            }

            for(L2PcInstance nearbyGM : nearbyGMs)
            {
              nearbyGM.sendPacket(cs);
            }

            cs = null;

            if(Config.DEBUG)
            {
              _log.fine("AutoChatHandler: Chat propogation for object ID " + chatNpc.getObjectId() + " (" + creatureName + ") with text '" + text + "' sent to " + nearbyPlayers.size() + " nearby players.");
            }

            text = null;
            creatureName = null;
            nearbyGMs = null;
View Full Code Here

          }
        }
        continue;
      }

      L2NpcInstance npc = (L2NpcInstance) cha;

      if(!faction_id.equalsIgnoreCase(npc.getFactionId()))
      {
        continue;
      }

      if(npc.getAI() != null) // TODO: possibly check not needed
      {
        if(!npc.isDead() && Math.abs(target.getZ() - npc.getZ()) < 600
        //&& _actor.getAttackByList().contains(getAttackTarget())
        && (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE || npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
        //limiting aggro for siege guards
        && target.isInsideRadius(npc, 1500, true, false) && GeoData.getInstance().canSeeTarget(npc, target))
        {
          // Notify the L2Object AI with EVT_AGGRESSION
          L2CharacterAI ai = npc.getAI();
          if(ai!=null)
            ai.notifyEvent(CtrlEvent.EVT_AGGRESSION, getAttackTarget(), 1);
        }
        // heal friends
        if(/*_selfAnalysis.hasHealOrResurrect && */!_actor.isAttackingDisabled() && npc.getCurrentHp() < npc.getMaxHp() * 0.6 && _actor.getCurrentHp() > _actor.getMaxHp() / 2 && _actor.getCurrentMp() > _actor.getMaxMp() / 2 && npc.isInCombat())
        {
          for(L2Skill sk : /* _selfAnalysis.healSkills*/healSkills)
          {
            if(_actor.getCurrentMp() < sk.getMpConsume())
            {
View Full Code Here

                {
                        player.setMultiSellId(-1);
                        return;
                }
               
                L2NpcInstance merchant = player.getTarget() instanceof L2NpcInstance ? (L2NpcInstance) player.getTarget() : null;

                // Possible fix to Multisell Radius
                if (merchant == null || !player.isInsideRadius(merchant, L2NpcInstance.INTERACTION_DISTANCE, false, false))
                {
                        player.setMultiSellId(-1);
View Full Code Here

                PcInventory inv = player.getInventory();
                boolean maintainItemFound = false;

                // given the template entry and information about maintaining enchantment and applying taxes re-create the instance of
                // the entry that will be used for this exchange i.e. change the enchantment level of select ingredient/products and adena amount appropriately.
                L2NpcInstance merchant = player.getTarget() instanceof L2NpcInstance ? (L2NpcInstance) player.getTarget() : null;

//              if(merchant == null) TODO: Check this
//                      return;

                MultiSellEntry entry = prepareEntry(merchant, templateEntry, applyTaxes, maintainEnchantment, enchantment);

                // Generate a list of distinct ingredients and counts in order to check if the correct item-counts
                // are possessed by the player
                FastList<MultiSellIngredient> _ingredientsList = new FastList<MultiSellIngredient>();
                boolean newIng = true;

                for (MultiSellIngredient e : entry.getIngredients())
                {
                        newIng = true;

                        // at this point, the template has already been modified so that enchantments are properly included
                        // whenever they need to be applied.  Uniqueness of items is thus judged by item id AND enchantment level
                        for (MultiSellIngredient ex : _ingredientsList)
                        {
                                // if the item was already added in the list, merely increment the count
                                // this happens if 1 list entry has the same ingredient twice (example 2 swords = 1 dual)
                                if (ex.getItemId() == e.getItemId() && ex.getEnchantmentLevel() == e.getEnchantmentLevel())
                                {
                                        if ((double) ex.getItemCount() + e.getItemCount() > Integer.MAX_VALUE)
                                        {
                                                player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED));
                                                _ingredientsList.clear();
                                                _ingredientsList = null;
                                                return;
                                        }
                                        ex.setItemCount(ex.getItemCount() + e.getItemCount());
                                        newIng = false;
                                }
                        }
                        if (newIng)
                        {
                                // If there is a maintainIngredient, then we do not need to check the enchantment parameter as the enchant level will be checked elsewhere
                                if (maintainEnchantment)
                                {
                                        maintainItemFound = true;
                                }

                                // if it's a new ingredient, just store its info directly (item id, count, enchantment)
                                _ingredientsList.add(new MultiSellIngredient(e));
                        }
                }

                // If there is no maintainIngredient, then we must make sure that the enchantment is not kept from the client packet, as it may have been forged
                if (!maintainItemFound)
                {
                        for (MultiSellIngredient product : entry.getProducts())
                        {
                                product.setEnchantmentLevel(0);
                        }
                }

                // now check if the player has sufficient items in the inventory to cover the ingredients' expences
                for (MultiSellIngredient e : _ingredientsList)
                {
                    if ((double) e.getItemCount() * _amount > Integer.MAX_VALUE)
                    {
                            player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED));
                            _ingredientsList.clear();
                            _ingredientsList = null;
                            return;
                    }

                    if (e.getItemId() != 65336 && e.getItemId() != 65436)
                    {
                        // if this is not a list that maintains enchantment, check the count of all items that have the given id.
                    // otherwise, check only the count of items with exactly the needed enchantment level
                        if (inv.getInventoryItemCount(e.getItemId(), maintainEnchantment ? e.getEnchantmentLevel() : -1) < (Config.ALT_BLACKSMITH_USE_RECIPES || !e.getMantainIngredient() ? e.getItemCount() * _amount : e.getItemCount()))
                        {
                            player.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
                            _ingredientsList.clear();
                            _ingredientsList = null;
                            return;
                        }
                    }
                    else
                    {
                        if (e.getItemId() == 65336)
                        {
                            if (player.getClan() == null)
                            {
                                player.sendPacket(new SystemMessage(SystemMessageId.YOU_ARE_NOT_A_CLAN_MEMBER));
                                return;
                            }

                            if (!player.isClanLeader())
                            {
                                player.sendPacket(new SystemMessage(SystemMessageId.ONLY_THE_CLAN_LEADER_IS_ENABLED));
                                return;
                            }

                            if (player.getClan().getReputationScore() < e.getItemCount() * _amount)
                            {
                                player.sendPacket(new SystemMessage(SystemMessageId.THE_CLAN_REPUTATION_SCORE_IS_TOO_LOW));
                                return;
                            }
                        }
                        if (e.getItemId() == 65436 && e.getItemCount() * _amount > player.getPcBangScore())
                        {
                                player.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
                                return;
                        }
                    }
                }

                _ingredientsList.clear();
                _ingredientsList = null;
                FastList<L2Augmentation> augmentation = new FastList<L2Augmentation>();
                /** All ok, remove items and add final product */

                for (MultiSellIngredient e : entry.getIngredients())
                {
                        if (e.getItemId() != 65336 && e.getItemId() != 65436)
                        {
                                for (MultiSellIngredient a : entry.getProducts())
                                {
                                        if (player.getInventoryLimit() < inv.getSize() + _amount && !ItemTable.getInstance().createDummyItem(a.getItemId()).isStackable())
                                        {
                                                player.sendPacket(new SystemMessage(SystemMessageId.SLOTS_FULL));
                                                return;
                                        }
                                        if (player.getInventoryLimit() < inv.getSize() && ItemTable.getInstance().createDummyItem(a.getItemId()).isStackable())
                                        {
                                                player.sendPacket(new SystemMessage(SystemMessageId.SLOTS_FULL));
                                                return;
                                        }
                                }
                                L2ItemInstance itemToTake = inv.getItemByItemId(e.getItemId()); // initialize and initial guess for the item to take.

                                //this is a cheat, transaction will be aborted and if any items already tanken will not be returned back to inventory!
                                if (itemToTake == null)
                                {
                                        _log.severe("Character: " + player.getName() + " is trying to cheat in multisell, merchatnt id:" + (merchant!=null?merchant.getNpcId():0));
                                        return;
                                }
                                if (itemToTake.fireEvent("MULTISELL", (Object[]) null) != null)
                                        return;

                                if (itemToTake.isWear())
                                {
                                        _log.severe("Character: " + player.getName() + " is trying to cheat in multisell with weared item");
                                        return;
                                }

                                if (Config.ALT_BLACKSMITH_USE_RECIPES || !e.getMantainIngredient())
                                {
                                        // if it's a stackable item, just reduce the amount from the first (only) instance that is found in the inventory
                                        if (itemToTake.isStackable())
                                        {
                                                if (!player.destroyItem("Multisell", itemToTake.getObjectId(), (e.getItemCount() * _amount), player.getTarget(), true))
                                                        return;
                                        }
                                        else
                                        {
                                                // for non-stackable items, one of two scenaria are possible:
                                                // a) list maintains enchantment: get the instances that exactly match the requested enchantment level
                                                // b) list does not maintain enchantment: get the instances with the LOWEST enchantment level

                                                // a) if enchantment is maintained, then get a list of items that exactly match this enchantment
                                                if (maintainEnchantment)
                                                {
                                                    // loop through this list and remove (one by one) each item until the required amount is taken.
                                                    L2ItemInstance[] inventoryContents = inv.getAllItemsByItemId(e.getItemId(), e.getEnchantmentLevel());
                                                    for (int i = 0; i < e.getItemCount() * _amount; i++)
                                                    {
                                                        if (inventoryContents[i].isAugmented())
                                                        {
                                                            augmentation.add(inventoryContents[i].getAugmentation());
                                                        }

                                                        if (inventoryContents[i].isEquipped())
                                                        {
                                                            if (inventoryContents[i].isAugmented())
                                                            {
                                                                inventoryContents[i].getAugmentation().removeBoni(player);
                                                            }
                                                        }

                                                        if (!player.destroyItem("Multisell", inventoryContents[i].getObjectId(), 1, player.getTarget(), true))
                                                            return;
                                                    }
                                                }
                                                else
                                                // b) enchantment is not maintained.  Get the instances with the LOWEST enchantment level
                                                {
                                                        /* NOTE: There are 2 ways to achieve the above goal.
                                                         * 1) Get all items that have the correct itemId, loop through them until the lowest enchantment
                                                         *              level is found.  Repeat all this for the next item until proper count of items is reached.
                                                         * 2) Get all items that have the correct itemId, sort them once based on enchantment level,
                                                         *              and get the range of items that is necessary.
                                                         * Method 1 is faster for a small number of items to be exchanged.
                                                         * Method 2 is faster for large amounts.
                                                         *
                                                         * EXPLANATION:
                                                         *   Worst case scenario for algorithm 1 will make it run in a number of cycles given by:
                                                         * m*(2n-m+1)/2 where m is the number of items to be exchanged and n is the total
                                                         * number of inventory items that have a matching id.
                                                         *   With algorithm 2 (sort), sorting takes n*log(n) time and the choice is done in a single cycle
                                                         * for case b (just grab the m first items) or in linear time for case a (find the beginning of items
                                                         * with correct enchantment, index x, and take all items from x to x+m).
                                                         * Basically, whenever m > log(n) we have: m*(2n-m+1)/2 = (2nm-m*m+m)/2 >
                                                         * (2nlogn-logn*logn+logn)/2 = nlog(n) - log(n*n) + log(n) = nlog(n) + log(n/n*n) =
                                                         * nlog(n) + log(1/n) = nlog(n) - log(n) = (n-1)log(n)
                                                         * So for m < log(n) then m*(2n-m+1)/2 > (n-1)log(n) and m*(2n-m+1)/2 > nlog(n)
                                                         *
                                                         * IDEALLY:
                                                         * In order to best optimize the performance, choose which algorithm to run, based on whether 2^m > n
                                                         * if ( (2<<(e.getItemCount() * _amount)) < inventoryContents.length )
                                                         *   // do Algorithm 1, no sorting
                                                         * else
                                                         *   // do Algorithm 2, sorting
                                                         *
                                                         * CURRENT IMPLEMENTATION:
                                                         * In general, it is going to be very rare for a person to do a massive exchange of non-stackable items
                                                         * For this reason, we assume that algorithm 1 will always suffice and we keep things simple.
                                                         * If, in the future, it becomes necessary that we optimize, the above discussion should make it clear
                                                         * what optimization exactly is necessary (based on the comments under "IDEALLY").
                                                         */

                                                        // choice 1.  Small number of items exchanged.  No sorting.
                                                        for (int i = 1; i <= e.getItemCount() * _amount; i++)
                                                        {
                                                                L2ItemInstance[] inventoryContents = inv.getAllItemsByItemId(e.getItemId());

                                                                itemToTake = inventoryContents[0];
                                                                // get item with the LOWEST enchantment level  from the inventory...
                                                                // +0 is lowest by default...
                                                                if (itemToTake.getEnchantLevel() > 0)
                                                                {
                                                                        for (L2ItemInstance inventoryContent : inventoryContents)
                                                                        {
                                                                                if (inventoryContent.getEnchantLevel() < itemToTake.getEnchantLevel())
                                                                                {
                                                                                        itemToTake = inventoryContent;
                                                                                        // nothing will have enchantment less than 0. If a zero-enchanted
                                                                                        // item is found, just take it
                                                                                        if (itemToTake.getEnchantLevel() == 0)
                                                                                        {
                                                                                                break;
                                                                                        }
                                                                                }
                                                                        }
                                                                }

                                                                if (itemToTake.isEquipped())
                                                                {
                                                                        if (itemToTake.isAugmented())
                                                                        {
                                                                                itemToTake.getAugmentation().removeBoni(player);
                                                                        }
                                                                }

                                                                if (!player.destroyItem("Multisell", itemToTake.getObjectId(), 1, player.getTarget(), true))
                                                                        return;

                                                        }
                                                }
                                        }
                                }
                        }
                        else
                        {
                                if (e.getItemId() == 65336)
                                {
                                        int repCost = player.getClan().getReputationScore() - e.getItemCount();
                                        player.getClan().setReputationScore(repCost, true);
                                        player.sendPacket(new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP).addNumber(e.getItemCount()));
                                        player.getClan().broadcastToOnlineMembers(new PledgeShowInfoUpdate(player.getClan()));
                                }
                                else
                                {
                                        player.reducePcBangScore(e.getItemCount() * _amount);
                                        player.sendPacket(new SystemMessage(SystemMessageId.USING_S1_PCPOINT).addNumber(e.getItemCount()));
                                }
                        }
                }
                // Generate the appropriate items
                for (MultiSellIngredient e : entry.getProducts())
                {
                        if (ItemTable.getInstance().createDummyItem(e.getItemId()).isStackable())
                        {
                                inv.addItem("Multisell["+_listId+"]" , e.getItemId(), (e.getItemCount() * _amount), player, player.getTarget());
                        }
                        else
                        {
                                L2ItemInstance product = null;
                                for (int i = 0; i < e.getItemCount() * _amount; i++)
                                {
                                        product = inv.addItem("Multisell["+_listId+"]", e.getItemId(), 1, player, player.getTarget());
                                        if (maintainEnchantment && (product != null))
                                        {
                                                if (i < augmentation.size())
                                                {
                                                        product.setAugmentation(new L2Augmentation(product, augmentation.get(i).getAugmentationId(), augmentation.get(i).getSkill(), true));
                                                }
                                                product.setEnchantLevel(e.getEnchantmentLevel());
                                        }
                                }
                        }
                        // Msg part
                        SystemMessage sm;

                        if (e.getItemCount() * _amount > 1)
                        {
                                sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
                                sm.addItemName(e.getItemId());
                                sm.addNumber(e.getItemCount() * _amount);
                                player.sendPacket(sm);
                        }
                        else
                        {
                                if (maintainEnchantment && e.getEnchantmentLevel() > 0)
                                {
                                        sm = new SystemMessage(SystemMessageId.ACQUIRED);
                                        sm.addNumber(e.getEnchantmentLevel());
                                        sm.addItemName(e.getItemId());
                                }
                                else
                                {
                                        sm = new SystemMessage(SystemMessageId.EARNED_ITEM);
                                        sm.addItemName(e.getItemId());
                                }
                                player.sendPacket(sm);
                        }
                }
                player.sendPacket(new ItemList(player, false));

                StatusUpdate su = new StatusUpdate(player.getObjectId());
                su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
                player.sendPacket(su);

                player.broadcastUserInfo();

                // Finally, give the tax to the castle...
                if (merchant != null && merchant.getIsInTown() && merchant.getCastle().getOwnerId() > 0)
                {
                        merchant.getCastle().addToTreasury(_transactionTax * _amount);
                }
        }
View Full Code Here

     if(!checkAllowed(player))
       return;
    
     if(!PowerPakConfig.GMSHOP_USEBBS && !PowerPakConfig.GMSHOP_USECOMMAND){
     
      L2NpcInstance gmshopnpc = null;
     
      if(player.getTarget()!=null)
        if(player.getTarget() instanceof L2NpcInstance)
        {
          gmshopnpc = (L2NpcInstance)player.getTarget();
          if(gmshopnpc.getTemplate().getNpcId()!=PowerPakConfig.GMSHOP_NPC)
            gmshopnpc=null;
        }
     
      //Possible fix to Buffer - 1
      if (gmshopnpc == null)
View Full Code Here

TOP

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

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.