Package net.sf.l2j.gameserver.serverpackets

Examples of net.sf.l2j.gameserver.serverpackets.SystemMessage


      int count  = _items[i * 2 + 1];
      int price = 0;
      if (count > Integer.MAX_VALUE)
      {
        Util.handleIllegalPlayerAction(player,"Warning!! Character "+player.getName()+" of account "+player.getAccountName()+" tried to purchase over "+Integer.MAX_VALUE+" items at the same time.",  Config.DEFAULT_PUNISH);
        SystemMessage sm = new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED);
        sendPacket(sm);
        return;
      }

      L2Item template = ItemTable.getInstance().getTemplate(L2Manor.getInstance().getRewardItem(
          itemId,manor.getCastle().getCrop(itemId,CastleManorManager.PERIOD_CURRENT).getReward()));
          weight += count * template.getWeight();

      if (!template.isStackable()) slots += count;
      else if (player.getInventory().getItemByItemId(itemId) == null) slots++;
    }

    if (!player.getInventory().validateWeight(weight))
    {
      sendPacket(new SystemMessage(SystemMessageId.WEIGHT_LIMIT_EXCEEDED));
      return;
    }


    if (!player.getInventory().validateCapacity(slots))
    {
      sendPacket(new SystemMessage(SystemMessageId.SLOTS_FULL));
      return;
    }

    // Proceed the purchase
    InventoryUpdate playerIU = new InventoryUpdate();
    _procureList =  manor.getCastle().getCropProcure(CastleManorManager.PERIOD_CURRENT);

    for (int i=0; i < _count; i++)
    {
      int itemId = _items[i * 2 + 0];
      int count  = _items[i * 2 + 1];
      if (count < 0) count = 0;

      int rewradItemId=L2Manor.getInstance().getRewardItem(
          itemId,manor.getCastle().getCrop(itemId, CastleManorManager.PERIOD_CURRENT).getReward());

      int rewradItemCount = 1; //L2Manor.getInstance().getRewardAmount(itemId, manor.getCastle().getCropReward(itemId));

      rewradItemCount = count / rewradItemCount;

      // Add item to Inventory and adjust update packet
      L2ItemInstance item = player.getInventory().addItem("Manor",rewradItemId,rewradItemCount,player,manor);
      L2ItemInstance iteme = player.getInventory().destroyItemByItemId("Manor",itemId,count,player,manor);

      if (item == null || iteme == null)
        continue;

      playerIU.addRemovedItem(iteme);
      if (item.getCount() > rewradItemCount) playerIU.addModifiedItem(item);
      else playerIU.addNewItem(item);

      // Send Char Buy Messages
      SystemMessage sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
      sm.addItemName(rewradItemId);
      sm.addNumber(rewradItemCount);
      player.sendPacket(sm);
      sm = null;

      //manor.getCastle().setCropAmount(itemId, manor.getCastle().getCrop(itemId, CastleManorManager.PERIOD_CURRENT).getAmount() - count);
    }
View Full Code Here


        int val = Integer.parseInt(st.nextToken());
        boolean sendMessage = activeChar.getFirstEffect(7029) != null;
        activeChar.stopSkillEffects(7029);
        if (val == 0 && sendMessage)
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.EFFECT_S1_DISAPPEARED).addSkillName(7029));
        }
        else if ((val >= 1) && (val <= 4))
        {
          L2Skill gmSpeedSkill = SkillTable.getInstance().getInfo(7029, val);
          activeChar.doCast(gmSpeedSkill);
        }
      }
      catch (Exception e)
      {
        activeChar.sendMessage("Use //gmspeed value (0=off...4=max).");
      }
      finally
      {
        activeChar.updateEffectIcons();
      }
    }
    else if (command.startsWith("admin_polyself"))
    {
      try
      {
        String id = st.nextToken();
        activeChar.getPoly().setPolyInfo("npc", id);
        activeChar.teleToLocation(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false);
        CharInfo info1 = new CharInfo(activeChar);
        activeChar.broadcastPacket(info1);
        UserInfo info2 = new UserInfo(activeChar);
        activeChar.sendPacket(info2);
      }
      catch(Exception e)
      {
      }
    }
    else if (command.startsWith("admin_unpolyself"))
    {
      activeChar.getPoly().setPolyInfo(null, "1");
      activeChar.decayMe();
      activeChar.spawnMe(activeChar.getX(),activeChar.getY(),activeChar.getZ());
      CharInfo info1 = new CharInfo(activeChar);
      activeChar.broadcastPacket(info1);
      UserInfo info2 = new UserInfo(activeChar);
      activeChar.sendPacket(info2);
    }
    else if (command.startsWith("admin_changename"))
    {
      try
      {
        String name = st.nextToken();
        String oldName = "null";
        try
        {
          L2Object target = activeChar.getTarget();
          L2Character player = null;
          if (target instanceof L2Character)
          {
            player = (L2Character)target;
            oldName = player.getName();
          }
          else if (target == null)
          {
            player = activeChar;
            oldName = activeChar.getName();
          }
          if (player instanceof L2PcInstance)
            L2World.getInstance().removeFromAllPlayers((L2PcInstance)player);
          player.setName(name);
          if (player instanceof L2PcInstance)
            L2World.getInstance().addVisibleObject(player, null, null);
          if (player instanceof L2PcInstance)
          {
            CharInfo info1 = new CharInfo((L2PcInstance)player);
            player.broadcastPacket(info1);
            UserInfo info2 = new UserInfo((L2PcInstance)player);
            player.sendPacket(info2);
          }
          else if(player instanceof L2NpcInstance)
          {
            NpcInfo info1 = new NpcInfo((L2NpcInstance)player, null);
            player.broadcastPacket(info1);
          }
          activeChar.sendMessage("Changed name from "+ oldName +" to "+ name +".");
        }
        catch (Exception e){}
      }
      catch (StringIndexOutOfBoundsException e){}
    }
    else if (command.equals("admin_clear_teams"))
    {
      try
      {
        for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
        {
          player.setTeam(0);
          player.broadcastUserInfo();
        }
      }
      catch (Exception e){}
    }
    else if (command.startsWith("admin_setteam_close"))
    {
      try
      {
        String val = st.nextToken();
        int teamVal = Integer.parseInt(val);
        for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
        {
          if (activeChar.isInsideRadius(player, 400, false, true))
          {
            player.setTeam(0);
            if (teamVal != 0)
            {
              SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
              sm.addString("You have joined team " + teamVal);
              player.sendPacket(sm);
            }
            player.broadcastUserInfo();
          }
        }
      }
      catch (Exception e)
      {
      }
    }
    else if (command.startsWith("admin_setteam"))
    {
      String val = command.substring(14);
      int teamVal = Integer.parseInt(val);
      L2Object target = activeChar.getTarget();
      L2PcInstance player = null;
      if (target instanceof L2PcInstance)
        player = (L2PcInstance)target;
      else
        return false;
      player.setTeam(teamVal);
      if (teamVal != 0)
      {
        SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
        sm.addString("You have joined team " + teamVal);
        player.sendPacket(sm);
      }
      player.broadcastUserInfo();
    }
    else if (command.startsWith("admin_social"))
    {
      try
      {
        String target=null;
        L2Object obj = activeChar.getTarget();
        if (st.countTokens() == 2)
        {
          int social = Integer.parseInt(st.nextToken());
          target = st.nextToken();
          if (target != null)
          {
            L2PcInstance player = L2World.getInstance().getPlayer(target);
            if (player != null)
            {
              if (performSocial(social,player,activeChar))
                activeChar.sendMessage(player.getName()+" was affected by your request.");
            }
            else
            {
              try
              {
                int radius = Integer.parseInt(target);
                for (L2Object object : activeChar.getKnownList().getKnownObjects().values())
                  if (activeChar.isInsideRadius(object, radius, false, false))
                    performSocial(social,object,activeChar);
                activeChar.sendMessage(radius+ " units radius affected by your request.");
              }
              catch (NumberFormatException nbe)
              {
                activeChar.sendMessage("Incorrect parameter");
              }
            }
          }
        }
        else if (st.countTokens() == 1)
        {
          int social = Integer.parseInt(st.nextToken());
          if (obj == null)
            obj = activeChar;
         
          if (performSocial(social,obj,activeChar))
            activeChar.sendMessage(obj.getName()+ " was affected by your request.");
          else
            activeChar.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
        }
        else if (!command.contains("menu"))
          activeChar.sendMessage("Usage: //social <social_id> [player_name|radius]");
      }
      catch (Exception e)
      {
        if (Config.DEBUG)
          e.printStackTrace();
      }
    }
    else if (command.startsWith("admin_abnormal"))
    {
      try
      {
        String target=null;
        L2Object obj = activeChar.getTarget();
        if (st.countTokens() == 2)
        {
          String parm = st.nextToken();
          int abnormal = Integer.decode("0x"+parm);
          target = st.nextToken();
          if (target != null)
          {
            L2PcInstance player = L2World.getInstance().getPlayer(target);
            if (player != null)
            {
              if (performAbnormal(abnormal,player))
                activeChar.sendMessage(player.getName()+"'s abnormal status was affected by your request.");
              else
                activeChar.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
            }
            else
            {
              try
              {
                int radius = Integer.parseInt(target);
                for (L2Object object : activeChar.getKnownList().getKnownObjects().values())
                  if (activeChar.isInsideRadius(object, radius, false, false))
                    performAbnormal(abnormal,object);
                activeChar.sendMessage(radius+ " units radius affected by your request.");
              }
              catch (NumberFormatException nbe)
              {
                activeChar.sendMessage("Usage: //abnormal <hex_abnormal_mask> [player|radius]");
              }
            }
          }
        }
        else if (st.countTokens() == 1)
        {
          int abnormal = Integer.decode("0x"+st.nextToken());
          if (obj == null)
            obj = activeChar;
          if (performAbnormal(abnormal,obj))
            activeChar.sendMessage(obj.getName()+ "'s abnormal status was affected by your request.");
          else
            activeChar.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
        }
        else if (!command.contains("menu"))
          activeChar.sendMessage("Usage: //abnormal <abnormal_mask> [player_name|radius]");
      }
      catch (Exception e)
      {
        if (Config.DEBUG)
          e.printStackTrace();
      }
    }
    else if (command.startsWith("admin_effect"))
    {
      try
      {
        L2Object obj = activeChar.getTarget();
        int level = 1,hittime = 1;
        int skill = Integer.parseInt(st.nextToken());
        if (st.hasMoreTokens())
          level = Integer.parseInt(st.nextToken());
        if (st.hasMoreTokens())
          hittime = Integer.parseInt(st.nextToken());
        if (obj == null)
          obj = activeChar;
        if (!(obj instanceof L2Character))
          activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
        else
        {
          L2Character target = (L2Character)obj;
          target.broadcastPacket(new MagicSkillUser(target,activeChar,skill,level,hittime,0));
          activeChar.sendMessage(obj.getName()+" performs MSU "+skill+"/"+level+" by your request.");
View Full Code Here

    {
      if (target instanceof L2Character)
      {
        if ((target instanceof L2Summon) || (target instanceof L2ChestInstance))
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
          return false;
        }
        if((target instanceof L2NpcInstance) && (action < 1 || action > 3))
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
          return false;
        }
        if((target instanceof L2PcInstance) && (action < 2 || action > 16))
        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
          return false;
        }
        L2Character character = (L2Character)target;
        character.broadcastPacket(new SocialAction(target.getObjectId(),action));
      }
View Full Code Here

        {
          if (target.reflectSkill(skill))
          {
            activeChar.stopSkillEffects(skill.getId());
            skill.getEffects(null, activeChar);
            SystemMessage sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
            sm.addSkillName(skill.getId());
            activeChar.sendPacket(sm);
          }
        }
              L2ItemInstance weapon = activeChar.getActiveWeaponInstance();
              boolean soul = (weapon != null && weapon.getChargedSoulshot() == L2ItemInstance.CHARGED_SOULSHOT && weapon.getItemType() == L2WeaponType.DAGGER);
              boolean shld = Formulas.getInstance().calcShldUse(activeChar, target);

              // Crit rate base crit rate for skill, modified with STR bonus
              boolean crit = false;
        if(Formulas.getInstance().calcCrit(skill.getBaseCritRate()*10*Formulas.getInstance().getSTRBonus(activeChar)))
          crit = true;
        double damage = (int)Formulas.getInstance().calcBlowDamage(activeChar, target, skill, shld, soul);
        if (crit)
        {
          damage *= 2;
          // Vicious Stance is special after C5, and only for BLOW skills
          // Adds directly to damage
          L2Effect vicious = activeChar.getFirstEffect(312);
          if(vicious != null && damage > 1)
          {
            for(Func func: vicious.getStatFuncs())
            {
              Env env = new Env();
              env.player = activeChar;
              env.target = target;
              env.skill = skill;
              env.value = damage;
              func.calc(env);
              damage = (int)env.value;
            }
          }
        }

        if (soul && weapon != null)
                weapon.setChargedSoulshot(L2ItemInstance.CHARGED_NONE);
        if(skill.getDmgDirectlyToHP() && target instanceof L2PcInstance)
            {
          L2PcInstance player = (L2PcInstance)target;
              if (!player.isInvul())
          {
                   if (damage >= player.getCurrentHp())
                   {
                     if(player.isInDuel()) player.setCurrentHp(1);
                     else
                     {
                       player.setCurrentHp(0);
                       if (player.isInOlympiadMode())
                       {
                         player.abortAttack();
                         player.abortCast();
                         player.getStatus().stopHpMpRegeneration();
                       }
                       else
                         player.doDie(activeChar);
                     }
                   }
                   else
                    player.setCurrentHp(player.getCurrentHp() - damage);
          }
              SystemMessage smsg = new SystemMessage(SystemMessageId.S1_GAVE_YOU_S2_DMG);
              smsg.addString(activeChar.getName());
              smsg.addNumber((int)damage);
              player.sendPacket(smsg);
            }
            else
              target.reduceCurrentHp(damage, activeChar);
        if(activeChar instanceof L2PcInstance)
          activeChar.sendPacket(new SystemMessage(SystemMessageId.CRITICAL_HIT));
        SystemMessage sm = new SystemMessage(SystemMessageId.YOU_DID_S1_DMG);
              sm.addNumber((int)damage);
              activeChar.sendPacket(sm);
      }
      //Possibility of a lethal strike
      if(!target.isRaid()
          && !(target instanceof L2DoorInstance)
          && !(target instanceof L2NpcInstance && ((L2NpcInstance)target).getNpcId() == 35062))
      {
        int chance = Rnd.get(100);
        //2nd lethal effect activate (cp,hp to 1 or if target is npc then hp to 1)
        if(skill.getLethalChance2() > 0 && chance < Formulas.getInstance().calcLethal(activeChar, target, skill.getLethalChance2()))
              {
                if (target instanceof L2NpcInstance)
                        target.reduceCurrentHp(target.getCurrentHp()-1, activeChar);
              else if (target instanceof L2PcInstance) // If is a active player set his HP and CP to 1
              {
                L2PcInstance player = (L2PcInstance)target;
                if (!player.isInvul()){
                  player.setCurrentHp(1);
                player.setCurrentCp(1);
                }
              }
                activeChar.sendPacket(new SystemMessage(SystemMessageId.LETHAL_STRIKE));
              }
              else if(skill.getLethalChance1() > 0 && chance < Formulas.getInstance().calcLethal(activeChar, target, skill.getLethalChance1())){
                if (target instanceof L2PcInstance)
                  {
                  L2PcInstance player = (L2PcInstance)target;
                if (!player.isInvul())
                  player.setCurrentCp(1); // Set CP to 1
                  }
                else if (target instanceof L2NpcInstance) // If is a monster remove first damage and after 50% of current hp
                  target.reduceCurrentHp(target.getCurrentHp()/2, activeChar);
                activeChar.sendPacket(new SystemMessage(SystemMessageId.LETHAL_STRIKE));
        }
      }
            L2Effect effect = activeChar.getFirstEffect(skill.getId());
            //Self Effect
            if (effect != null && effect.isSelfEffect())
View Full Code Here

                  if (attacker instanceof L2PcInstance)
                  {
                    L2PcInstance player = (L2PcInstance)attacker;
                    if (isOverhit() && attacker == getOverhitAttacker())
                    {
                      player.sendPacket(new SystemMessage(SystemMessageId.OVER_HIT));
                      exp += calculateOverhitExp(exp);
                    }
                  }

                  // Distribute the Exp and SP between the L2PcInstance and its L2Summon
                  if (!attacker.isDead())
                    attacker.addExpAndSp(Math.round(attacker.calcStat(Stats.EXPSP_RATE, exp, null, null)),
                        (int)attacker.calcStat(Stats.EXPSP_RATE, sp, null, null));
                }
              }
              else
              {
                //share with party members
                partyDmg = 0;
                partyMul = 1.f;
                partyLvl = 0;

                // Get all L2Character that can be rewarded in the party
                List<L2PlayableInstance> rewardedMembers = new FastList<L2PlayableInstance>();

                // Go through all L2PcInstance in the party
                List<L2PcInstance> groupMembers;
                if (attackerParty.isInCommandChannel())
                  groupMembers = attackerParty.getCommandChannel().getMembers();
                else
                  groupMembers = attackerParty.getPartyMembers();

                for (L2PcInstance pl : groupMembers)
                {
                  if (pl == null || pl.isDead()) continue;

                  // Get the RewardInfo of this L2PcInstance from L2Attackable rewards
                  reward2 = rewards.get(pl);

                  // If the L2PcInstance is in the L2Attackable rewards add its damages to party damages
                  if (reward2 != null)
                  {
                    if (Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, pl, true))
                    {
                      partyDmg += reward2._dmg; // Add L2PcInstance damages to party damages
                      rewardedMembers.add(pl);
                      if (pl.getLevel() > partyLvl)
                      {
                        if(attackerParty.isInCommandChannel())
                          partyLvl = attackerParty.getCommandChannel().getLevel();
                        else
                          partyLvl = pl.getLevel();
                      }
                    }
                    rewards.remove(pl); // Remove the L2PcInstance from the L2Attackable rewards
                  }
                  else
                  {
                    // Add L2PcInstance of the party (that have attacked or not) to members that can be rewarded
                    // and in range of the monster.
                    if (Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, pl, true))
                    {
                      rewardedMembers.add(pl);
                      if (pl.getLevel() > partyLvl)
                      {
                        if(attackerParty.isInCommandChannel())
                          partyLvl = attackerParty.getCommandChannel().getLevel();
                        else
                          partyLvl = pl.getLevel();
                      }
                    }
                  }
                  L2PlayableInstance summon = pl.getPet();
                  if (summon != null && summon instanceof L2PetInstance)
                  {
                    reward2 = rewards.get(summon);
                    if (reward2 != null) // Pets are only added if they have done damage
                    {
                      if (Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, summon, true))
                      {
                        partyDmg += reward2._dmg; // Add summon damages to party damages
                        rewardedMembers.add(summon);
                        if (summon.getLevel() > partyLvl)
                          partyLvl = summon.getLevel();
                      }
                      rewards.remove(summon); // Remove the summon from the L2Attackable rewards
                    }
                  }
                }

                // If the party didn't killed this L2Attackable alone
                if (partyDmg < getMaxHp()) partyMul = ((float)partyDmg / (float)getMaxHp());

                // Avoid "over damage"
                if (partyDmg > getMaxHp()) partyDmg = getMaxHp();

                // Calculate the level difference between Party and L2Attackable
                levelDiff = partyLvl - getLevel();

                // Calculate Exp and SP rewards
                tmp = calculateExpAndSp(levelDiff, partyDmg);
                exp = tmp[0];
                sp = tmp[1];

                if (Config.L2JMOD_CHAMPION_ENABLE && isChampion())
                {
                  exp *= Config.L2JMOD_CHAMPION_REWARDS;
                  sp *= Config.L2JMOD_CHAMPION_REWARDS;
                }

                exp *= partyMul;
                sp *= partyMul;

                // Check for an over-hit enabled strike
                // (When in party, the over-hit exp bonus is given to the whole party and splitted proportionally through the party members)
                if (attacker instanceof L2PcInstance)
                {
                  L2PcInstance player = (L2PcInstance)attacker;
                  if (isOverhit() && attacker == getOverhitAttacker())
                  {
                    player.sendPacket(new SystemMessage(SystemMessageId.OVER_HIT));
                    exp += calculateOverhitExp(exp);
                  }
                }

                // Distribute Experience and SP rewards to L2PcInstance Party members in the known area of the last attacker
View Full Code Here

           else DropItem(player, item); // drop the item on the ground

           // Broadcast message if RaidBoss was defeated
                 if(this instanceof L2RaidBossInstance)
                 {
                     SystemMessage sm;
                     sm = new SystemMessage(SystemMessageId.S1_DIED_DROPPED_S3_S2);
                     sm.addString(getName());
                     sm.addItemName(item.getItemId());
                     sm.addNumber(item.getCount());
                     broadcastPacket(sm);
                 }
           }
         }
       }
View Full Code Here

            if (crystalQTY < 1 || crystalQTY > 1 || !isSuccess || !doLevelup)
            {
                // Too many crystals in inventory.
                if  (crystalQTY > 1)
                {
                    player.sendPacket(new SystemMessage(SystemMessageId.SOUL_CRYSTAL_ABSORBING_FAILED_RESONATION));
                }
                // The soul crystal stage of the player is way too high
                else if (!doLevelup)
                    player.sendPacket(new SystemMessage(SystemMessageId.SOUL_CRYSTAL_ABSORBING_REFUSED));

                crystalQTY = 0;
                continue;
            }

            /* TODO: Confirm boss chance for crystal level up and for crystal breaking.
             * It is known that bosses with FULL_PARTY crystal level ups have 100% success rate, but this is not
             * the case for the other bosses (one-random or last-hit).
             * While not confirmed, it is most reasonable that crystals leveled up at bosses will never break.
             * Also, the chance to level up is guessed as around 70% if not higher.
             */
            int chanceLevelUp = isBossMob? 70:SoulCrystal.LEVEL_CHANCE;

            // If succeeds or it is a full party absorb, level up the crystal.
            if (((absorbType == L2NpcTemplate.AbsorbCrystalType.FULL_PARTY) && doLevelup) || (dice <= chanceLevelUp))
            {
                // Give staged crystal
                exchangeCrystal(player, crystalOLD, crystalNEW, false);
            }

            // If true and not a last-hit mob, break the crystal.
            else if ((!isBossMob) && dice >= (100.0 - SoulCrystal.BREAK_CHANCE))
            {
                // Remove current crystal an give a broken open.
                if      (crystalNME.startsWith("red"))
                  exchangeCrystal(player, crystalOLD, SoulCrystal.RED_BROKEN_CRYSTAL, true);
                else if (crystalNME.startsWith("gre"))
                    exchangeCrystal(player, crystalOLD, SoulCrystal.GRN_BROKEN_CYRSTAL, true);
                else if (crystalNME.startsWith("blu"))
                    exchangeCrystal(player, crystalOLD, SoulCrystal.BLU_BROKEN_CRYSTAL, true);
                resetAbsorbList();
            }
            else
                player.sendPacket(new SystemMessage(SystemMessageId.SOUL_CRYSTAL_ABSORBING_FAILED));
        }
    }
View Full Code Here

            playerIU.addItem(Item);

            // Send a sound event and text message to the player
            if(broke)
            {
                player.sendPacket(new SystemMessage(SystemMessageId.SOUL_CRYSTAL_BROKE));
            }
            else
                player.sendPacket(new SystemMessage(SystemMessageId.SOUL_CRYSTAL_ABSORBING_SUCCEEDED));

            // Send system message
            SystemMessage sms = new SystemMessage(SystemMessageId.EARNED_ITEM);
            sms.addItemName(giveid);
            player.sendPacket(sms);

            // Send inventory update packet
            player.sendPacket(playerIU);
        }
View Full Code Here

    if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_USEITEM))
      return;

    if (activeChar.getPrivateStoreType() != 0)
    {
      activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_TRADE_DISCARD_DROP_ITEM_WHILE_IN_SHOPMODE));
      activeChar.sendPacket(new ActionFailed());
      return;
    }

    // NOTE: disabled due to deadlocks
//        synchronized (activeChar.getInventory())
//    {
      L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);

      if (item == null)
                return;

      if (item.isWear())
      {
        // No unequipping wear-items
        return;
      }

      int itemId = item.getItemId();
      /*
       * Alt game - Karma punishment // SOE
       * 736    Scroll of Escape
       * 1538    Blessed Scroll of Escape
       * 1829    Scroll of Escape: Clan Hall
       * 1830    Scroll of Escape: Castle
       * 3958    L2Day - Blessed Scroll of Escape
       * 5858    Blessed Scroll of Escape: Clan Hall
       * 5859    Blessed Scroll of Escape: Castle
       * 6663    Scroll of Escape: Orc Village
       * 6664    Scroll of Escape: Silenos Village
       * 7117    Scroll of Escape to Talking Island
       * 7118    Scroll of Escape to Elven Village
       * 7119    Scroll of Escape to Dark Elf Village
       * 7120    Scroll of Escape to Orc Village
       * 7121    Scroll of Escape to Dwarven Village
       * 7122    Scroll of Escape to Gludin Village
       * 7123    Scroll of Escape to the Town of Gludio
       * 7124    Scroll of Escape to the Town of Dion
       * 7125    Scroll of Escape to Floran
       * 7126    Scroll of Escape to Giran Castle Town
       * 7127    Scroll of Escape to Hardin's Private Academy
       * 7128    Scroll of Escape to Heine
       * 7129    Scroll of Escape to the Town of Oren
       * 7130    Scroll of Escape to Ivory Tower
       * 7131    Scroll of Escape to Hunters Village
       * 7132    Scroll of Escape to Aden Castle Town
       * 7133    Scroll of Escape to the Town of Goddard
       * 7134    Scroll of Escape to the Rune Township
       * 7135    Scroll of Escape to the Town of Schuttgart.
       * 7554    Scroll of Escape to Talking Island
       * 7555    Scroll of Escape to Elven Village
       * 7556    Scroll of Escape to Dark Elf Village
       * 7557    Scroll of Escape to Orc Village
       * 7558    Scroll of Escape to Dwarven Village
       * 7559    Scroll of Escape to Giran Castle Town
       * 7618    Scroll of Escape - Ketra Orc Village
       * 7619    Scroll of Escape - Varka Silenos Village
       */
      if (!Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT && activeChar.getKarma() > 0
        && (itemId == 736 || itemId == 1538 || itemId == 1829 || itemId == 1830
        || itemId == 3958 || itemId == 5858 || itemId == 5859 || itemId == 6663
        || itemId == 6664 || (itemId >= 7117 && itemId <= 7135)
        || (itemId >= 7554 && itemId <= 7559) || itemId == 7618 || itemId == 7619))
        return;

      // Items that cannot be used
      if (itemId == 57)
                return;

            if (activeChar.isFishing() && (itemId < 6535 || itemId > 6540))
            {
                // You cannot do anything else while fishing
                SystemMessage sm = new SystemMessage(SystemMessageId.CANNOT_DO_WHILE_FISHING_3);
                getClient().getActiveChar().sendPacket(sm);
                sm = null;
                return;
            }

      // Char cannot use item when dead
      if (activeChar.isDead())
      {
        SystemMessage sm = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
        sm.addItemName(itemId);
        getClient().getActiveChar().sendPacket(sm);
        sm = null;
        return;
      }

      // Char cannot use pet items
      if (item.getItem().isForWolf() || item.getItem().isForHatchling()
        || item.getItem().isForStrider() || item.getItem().isForBabyPet())
      {
        SystemMessage sm = new SystemMessage(SystemMessageId.CANNOT_EQUIP_PET_ITEM); // You cannot equip a pet item.
        sm.addItemName(itemId);
        getClient().getActiveChar().sendPacket(sm);
        sm = null;
        return;
      }

      if (Config.DEBUG)
                _log.finest(activeChar.getObjectId() + ": use item " + _objectId);

      if (item.isEquipable())
      {
        // No unequipping/equipping while the player is in special conditions
        if (activeChar.isStunned() || activeChar.isSleeping() || activeChar.isParalyzed()
            || activeChar.isAlikeDead())
        {
          activeChar.sendMessage("Your status does not allow you to do that.");
          return;
        }

        int bodyPart = item.getItem().getBodyPart();
                // Prevent player to remove the weapon on special conditions
                if ((activeChar.isAttackingNow() || activeChar.isCastingNow() || activeChar.isMounted())
                        && (bodyPart == L2Item.SLOT_LR_HAND
                            || bodyPart == L2Item.SLOT_L_HAND
                            || bodyPart == L2Item.SLOT_R_HAND))
                {
                    return;
                }
                /* Since c5 you can equip weapon again
                // Don't allow weapon/shield equipment if wearing formal wear
                if (activeChar.isWearingFormalWear()
                  && (bodyPart == L2Item.SLOT_LR_HAND
                            || bodyPart == L2Item.SLOT_L_HAND
                            || bodyPart == L2Item.SLOT_R_HAND))
                {
                SystemMessage sm = new SystemMessage(SystemMessageId.CANNOT_USE_ITEMS_SKILLS_WITH_FORMALWEAR);
                activeChar.sendPacket(sm);
                        return;
                } */

                // Don't allow weapon/shield equipment if a cursed weapon is equiped
                if (activeChar.isCursedWeaponEquiped()
                    && ((bodyPart == L2Item.SLOT_LR_HAND
                        || bodyPart == L2Item.SLOT_L_HAND
                        || bodyPart == L2Item.SLOT_R_HAND)
                    || itemId == 6408)) // Don't allow to put formal wear
                {
                  return;
                }

                // Don't allow weapon/shield hero equipment during Olympiads
                if (activeChar.isInOlympiadMode()
                    && (
                        bodyPart == L2Item.SLOT_LR_HAND
                        || bodyPart == L2Item.SLOT_L_HAND
                        || bodyPart == L2Item.SLOT_R_HAND
                      )
                    && (
                        (item.getItemId() >= 6611 && item.getItemId() <= 6621) ||
                        item.getItemId() == 6842
                      )
                  )
                {
                  return;
                }

                // Don't allow weapon/shield hero equipment during Olympiads
                if (activeChar.isInOlympiadMode()
                    && (
                        bodyPart == L2Item.SLOT_LR_HAND
                        || bodyPart == L2Item.SLOT_L_HAND
                        || bodyPart == L2Item.SLOT_R_HAND
                      )
                    && (
                        (item.getItemId() >= 6611 && item.getItemId() <= 6621) ||
                        item.getItemId() == 6842
                      )
                  )
                {
                  return;
                }

                // Equip or unEquip
                L2ItemInstance[] items = null;
                boolean isEquiped = item.isEquipped();
              SystemMessage sm = null;
              L2ItemInstance old = activeChar.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND);
              if (old == null)
                old = activeChar.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);

              activeChar.checkSSMatch(item, old);

              if (isEquiped)
                {
                if (item.getEnchantLevel() > 0)
                {
                  sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
                  sm.addNumber(item.getEnchantLevel());
                  sm.addItemName(itemId);
                }
                else
                {
                  sm = new SystemMessage(SystemMessageId.S1_DISARMED);
                  sm.addItemName(itemId);
                }
                activeChar.sendPacket(sm);

                // Remove augementation boni on unequip
                if (item.isAugmented())
                  item.getAugmentation().removeBoni(activeChar);

                int slot = activeChar.getInventory().getSlotFromItem(item);
                  items = activeChar.getInventory().unEquipItemInBodySlotAndRecord(slot);
                }
                else
                {
                  int tempBodyPart = item.getItem().getBodyPart();
                  L2ItemInstance tempItem = activeChar.getInventory().getPaperdollItemByL2ItemId(tempBodyPart);

                  // remove augmentation stats for replaced items
                  // currently weapons only..
                  if (tempItem != null && tempItem.isAugmented())
                    tempItem.getAugmentation().removeBoni(activeChar);
                  else if (tempBodyPart == 0x4000)
                  {
                    L2ItemInstance tempItem2 = activeChar.getInventory().getPaperdollItem(7);
                    if (tempItem2 != null && tempItem2.isAugmented())
                      tempItem2.getAugmentation().removeBoni(activeChar);
                    tempItem2 = activeChar.getInventory().getPaperdollItem(8);
                      if (tempItem2 != null && tempItem2.isAugmented())
                        tempItem2.getAugmentation().removeBoni(activeChar);
                  }

                  //check if the item replaces a wear-item
                  if (tempItem != null && tempItem.isWear())
                  {
                    // dont allow an item to replace a wear-item
                    return;
                  }
                  else if (tempBodyPart == 0x4000) // left+right hand equipment
                  {
                    // this may not remove left OR right hand equipment
                    tempItem = activeChar.getInventory().getPaperdollItem(7);
                    if (tempItem != null && tempItem.isWear()) return;

                    tempItem = activeChar.getInventory().getPaperdollItem(8);
                    if (tempItem != null && tempItem.isWear()) return;
                  }
                  else if (tempBodyPart == 0x8000) // fullbody armor
                  {
                    // this may not remove chest or leggins
                    tempItem = activeChar.getInventory().getPaperdollItem(10);
                    if (tempItem != null && tempItem.isWear()) return;

                    tempItem = activeChar.getInventory().getPaperdollItem(11);
                    if (tempItem != null && tempItem.isWear()) return;
                  }

          if (item.getEnchantLevel() > 0)
          {
            sm = new SystemMessage(SystemMessageId.S1_S2_EQUIPPED);
            sm.addNumber(item.getEnchantLevel());
            sm.addItemName(itemId);
          }
          else
          {
            sm = new SystemMessage(SystemMessageId.S1_EQUIPPED);
            sm.addItemName(itemId);
          }
          activeChar.sendPacket(sm);

                // Apply augementation boni on equip
                if (item.isAugmented())
View Full Code Here

        if (activeChar instanceof L2PcInstance)
        {
            if (weaponInst == null && skill.isOffensive())
            {
                SystemMessage sm2 = new SystemMessage(SystemMessageId.S1_S2);
                sm2.addString("You must equip a weapon before casting a spell.");
                activeChar.sendPacket(sm2);
                return;
            }
        }

        if (weaponInst != null)
        {
          if (skill.isMagic())
          {
              if (weaponInst.getChargedSpiritshot() == L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT)
              {
                  bss = true;
                  if (skill.getId() != 1020) // vitalize
                    weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_NONE);
              }
              else if (weaponInst.getChargedSpiritshot() == L2ItemInstance.CHARGED_SPIRITSHOT)
              {
                  sps = true;
                  if (skill.getId() != 1020) // vitalize
                    weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_NONE);
              }
          }
            else
              if (weaponInst.getChargedSoulshot() == L2ItemInstance.CHARGED_SOULSHOT)
              {
                  ss = true;
                  if (skill.getId() != 1020) // vitalize
                    weaponInst.setChargedSoulshot(L2ItemInstance.CHARGED_NONE);
              }
        }
        // If there is no weapon equipped, check for an active summon.
        else if (activeChar instanceof L2Summon)
        {
            L2Summon activeSummon = (L2Summon) activeChar;

          if (skill.isMagic())
          {
              if (activeSummon.getChargedSpiritShot() == L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT)
              {
                  bss = true;
                  activeSummon.setChargedSpiritShot(L2ItemInstance.CHARGED_NONE);
              }
              else if (activeSummon.getChargedSpiritShot() == L2ItemInstance.CHARGED_SPIRITSHOT)
              {
                  sps = true;
                  activeSummon.setChargedSpiritShot(L2ItemInstance.CHARGED_NONE);
              }
          }
            else
              if (activeSummon.getChargedSoulShot() == L2ItemInstance.CHARGED_SOULSHOT)
              {
                  ss = true;
                  activeSummon.setChargedSoulShot(L2ItemInstance.CHARGED_NONE);
              }
        }

        for (int index = 0; index < targets.length; index++)
        {
            // Get a target
            if (!(targets[index] instanceof L2Character)) continue;

            L2Character target = (L2Character) targets[index];

            if (target == null || target.isDead()) //bypass if target is null or dead
            continue;

            switch (type)
            {
            case BETRAY:
             {
               if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, ss, sps, bss))
                 skill.getEffects(activeChar, target);
               else
               {
                 SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
                 sm.addString(target.getName());
                 sm.addSkillName(skill.getId());
                 activeChar.sendPacket(sm);
               }
               break;
             }
                case FAKE_DEATH:
                {
                    // stun/fakedeath is not mdef dependant, it depends on lvl difference, target CON and power of stun
                    skill.getEffects(activeChar, target);
                    break;
                }
                case ROOT:
                case STUN:
                {
                    if(target.reflectSkill(skill))
                      target = activeChar;

                    if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, ss, sps, bss))
                      skill.getEffects(activeChar, target);
                    else
                    {
                        if (activeChar instanceof L2PcInstance)
                        {
                            SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
                            sm.addString(target.getName());
                            sm.addSkillName(skill.getDisplayId());
                            activeChar.sendPacket(sm);
                        }
                    }
                    break;
                }
                case SLEEP:
                case PARALYZE: //use same as root for now
                {
                    if(target.reflectSkill(skill))
                      target = activeChar;

                    if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, ss, sps, bss))
                      skill.getEffects(activeChar, target);
                    else
                    {
                        if (activeChar instanceof L2PcInstance)
                        {
                            SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
                            sm.addString(target.getName());
                            sm.addSkillName(skill.getDisplayId());
                            activeChar.sendPacket(sm);
                        }
                    }
                    break;
                }
                case CONFUSION:
                case MUTE:
                {
                    if(target.reflectSkill(skill))
                      target = activeChar;

                    if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, ss, sps, bss))
                    {
                        // stop same type effect if avaiable
                        L2Effect[] effects = target.getAllEffects();
                        for (L2Effect e : effects)
                            if (e.getSkill().getSkillType() == type)
                              e.exit();
                        // then restart
                        // Make above skills mdef dependant
                        if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, ss, sps, bss))
                        //if(Formulas.getInstance().calcMagicAffected(activeChar, target, skill))
                            skill.getEffects(activeChar, target);
                        else
                        {
                            if (activeChar instanceof L2PcInstance)
                            {
                                SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
                                sm.addString(target.getName());
                                sm.addSkillName(skill.getDisplayId());
                                activeChar.sendPacket(sm);
                            }
                        }
                    }
                    else
                    {
                        if (activeChar instanceof L2PcInstance)
                        {
                            SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
                            sm.addString(target.getName());
                            sm.addSkillName(skill.getDisplayId());
                            activeChar.sendPacket(sm);
                        }
                    }
                    break;
                }
                case CONFUSE_MOB_ONLY:
                {
                    // do nothing if not on mob
                    if (target instanceof L2Attackable)
                      skill.getEffects(activeChar, target);
                    else
                      activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
                    break;
                }
                case AGGDAMAGE:
                {
                    if (target instanceof L2Attackable)
                        target.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, activeChar, (int) ((150*skill.getPower())/(target.getLevel()+7)));
                    //TODO [Nemesiss] should this have 100% chance?
                    skill.getEffects(activeChar, target);
                    break;
                }
                case AGGREDUCE:
                {
                  // these skills needs to be rechecked
                  if (target instanceof L2Attackable)
                    {
                      skill.getEffects(activeChar, target);

                      double aggdiff = ((L2Attackable)target).getHating(activeChar)
                                 - target.calcStat(Stats.AGGRESSION, ((L2Attackable)target).getHating(activeChar), target, skill);

                      if (skill.getPower() > 0)
                        ((L2Attackable)target).reduceHate(null, (int) skill.getPower());
                      else if (aggdiff > 0)
                        ((L2Attackable)target).reduceHate(null, (int) aggdiff);
                    }
                    break;
                }
                case AGGREDUCE_CHAR:
                {
                  // these skills needs to be rechecked
                  if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, ss, sps, bss))
                  {
                    if (target instanceof L2Attackable)
                    {
                        L2Attackable targ = (L2Attackable)target;
                      targ.stopHating(activeChar);
                        if (targ.getMostHated() == null)
                            {
                               ((L2AttackableAI)targ.getAI()).setGlobalAggro(-25);
                            targ.clearAggroList();
                            targ.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                            targ.setWalking();
                            }
                        }
                      skill.getEffects(activeChar, target);
                    }
                  else
                  {
                    if (activeChar instanceof L2PcInstance)
                    {
                      SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
                      sm.addString(target.getName());
                      sm.addSkillName(skill.getId());
                      activeChar.sendPacket(sm);
                    }
                  }
                    break;
                }
                case AGGREMOVE:
                {
                  // these skills needs to be rechecked
                  if (target instanceof L2Attackable && !target.isRaid())
                  {
                    if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, ss, sps, bss))
                    {
                      if (skill.getTargetType() == L2Skill.SkillTargetType.TARGET_UNDEAD)
                      {
                        if(target.isUndead())
                          ((L2Attackable)target).reduceHate(null, ((L2Attackable)target).getHating(((L2Attackable)target).getMostHated()));
                      }
                      else
                        ((L2Attackable)target).reduceHate(null, ((L2Attackable)target).getHating(((L2Attackable)target).getMostHated()));
                    }
                    else
                    {
                      if (activeChar instanceof L2PcInstance)
                      {
                        SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
                        sm.addString(target.getName());
                        sm.addSkillName(skill.getId());
                        activeChar.sendPacket(sm);
                      }
                    }
                  }
                    break;
                }
                case UNBLEED:
                {
                    negateEffect(target,SkillType.BLEED,skill.getPower());
                    break;
                }
                case UNPOISON:
                {
                    negateEffect(target,SkillType.POISON,skill.getPower());
                    break;
                }
                case ERASE:
                {
                  if (Formulas.getInstance().calcSkillSuccess(activeChar, target, skill, ss, sps, bss)
                    // doesn't affect siege golem or wild hog cannon
                    && !(target instanceof L2SiegeSummonInstance)
                    )
                  {
                    L2PcInstance summonOwner = null;
                    L2Summon summonPet = null;
                    summonOwner = ((L2Summon)target).getOwner();
                    summonPet = summonOwner.getPet();
                    summonPet.unSummon(summonOwner);
                        SystemMessage sm = new SystemMessage(SystemMessageId.LETHAL_STRIKE);
                summonOwner.sendPacket(sm);
                  }
                  else
                    {
                        if (activeChar instanceof L2PcInstance)
                        {
                            SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
                            sm.addString(target.getName());
                            sm.addSkillName(skill.getId());
                            activeChar.sendPacket(sm);
                        }
                    }
                  break;
                }
                case MAGE_BANE:
              {
                    for(L2Object t: targets)
                    {
                      L2Character target1 = (L2Character) t;

                        if(target1.reflectSkill(skill))
                          target1 = activeChar;

                      if (! Formulas.getInstance().calcSkillSuccess(activeChar, target1, skill, ss, sps, bss))
                        continue;

                       L2Effect[] effects = target1.getAllEffects();
                       for(L2Effect e: effects)
                       {
                         for(Func f: e.getStatFuncs())
                         {
                           if(f.stat == Stats.MAGIC_ATTACK || f.stat == Stats.MAGIC_ATTACK_SPEED)
                           {
                             e.exit();
                             break;
                           }
                         }
                       }
                    }
                    break;
              }
                case WARRIOR_BANE:
              {
                    for(L2Object t: targets)
                    {
                      L2Character target1 = (L2Character) t;

                        if(target1.reflectSkill(skill))
                          target1 = activeChar;

                      if (! Formulas.getInstance().calcSkillSuccess(activeChar, target1, skill, ss, sps, bss))
                        continue;

                       L2Effect[] effects = target1.getAllEffects();
                       for(L2Effect e: effects)
                       {
                         for(Func f: e.getStatFuncs())
                         {
                           if(f.stat == Stats.RUN_SPEED || f.stat == Stats.POWER_ATTACK_SPEED)
                           {
                             e.exit();
                             break;
                           }
                         }
                       }
                    }
                    break;
              }
                case CANCEL:
                case NEGATE:
                {
                    if(target.reflectSkill(skill))
                      target = activeChar;

                  //TODO@   Rewrite it to properly use Formulas class.
                    // cancel
                    if (skill.getId() == 1056)
                    {
                      int lvlmodifier= 52+skill.getMagicLevel()*2;
                      if(skill.getMagicLevel()==12) lvlmodifier = (Experience.MAX_LEVEL - 1);
                      int landrate = 90;
                      if((target.getLevel() - lvlmodifier)>0) landrate = 90-4*(target.getLevel()-lvlmodifier);

                      landrate = (int) activeChar.calcStat(Stats.CANCEL_VULN, landrate, target, null);

                      if(Rnd.get(100) < landrate)
                      {
                        L2Effect[] effects = target.getAllEffects();
                        int maxfive = 5;
                        for (L2Effect e : effects)
                        {
                          if (e.getSkill().getId() != 4082 && e.getSkill().getId() != 4215 &&
                              e.getSkill().getId() != 4515 && e.getSkill().getId() != 110 && e.getSkill().getId() != 111 &&
                              e.getSkill().getId() != 1323 && e.getSkill().getId() != 1325) // Cannot cancel skills 4082, 4215, 4515, 110, 111, 1323, 1325
                          {
                            if(e.getSkill().getSkillType() != SkillType.BUFF) //sleep, slow, surrenders etc
                              e.exit();
                            else
                            {
                              int rate = 100;
                              int level = e.getLevel();
                              if (level > 0) rate = Integer.valueOf(150/(1 + level));
                              if (rate > 95) rate = 95;
                              else if (rate < 5) rate = 5;
                              if(Rnd.get(100) < rate)  {
                                e.exit();
                                maxfive--;
                                if(maxfive == 0) break;
                              }
                            }
                          }
                        }
                      } else
                      {
                            if (activeChar instanceof L2PcInstance)
                            {
                                SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
                                sm.addString(target.getName());
                                sm.addSkillName(skill.getDisplayId());
                                activeChar.sendPacket(sm);
                            }
                      }
                        break;
                    }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.serverpackets.SystemMessage

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.