Examples of AbnormalEffect


Examples of l2p.gameserver.skills.AbnormalEffect

    if(!activeChar.getPlayerAccess().GodMode)
    {
      return false;
    }
    int val;
    AbnormalEffect ae = AbnormalEffect.NULL;
    L2Object target = activeChar.getTarget();
    switch(command)
    {
      case admin_invis:
      case admin_vis:
        if(activeChar.isInvisible())
        {
          activeChar.setInvisible(false);
          activeChar.broadcastUserInfo(true);
          if(activeChar.getPet() != null)
          {
            activeChar.getPet().broadcastPetInfo();
          }
        }
        else
        {
          activeChar.setInvisible(true);
          activeChar.sendUserInfo(true);
          if(activeChar.getCurrentRegion() != null)
          {
            for(L2WorldRegion neighbor : activeChar.getCurrentRegion().getNeighbors())
            {
              neighbor.removePlayerFromOtherPlayers(activeChar);
            }
          }
        }
        break;
      case admin_gmspeed:
        if(wordList.length < 2)
        {
          val = 0;
        }
        else
        {
          try
          {
            val = Integer.parseInt(wordList[1]);
          }
          catch(Exception e)
          {
            activeChar.sendMessage("USAGE: //gmspeed value=[0..4]");
            return false;
          }
        }
        GArray<L2Effect> superhaste = activeChar.getEffectList().getEffectsBySkillId(7029);
        int sh_level = superhaste == null ? 0 : superhaste.isEmpty() ? 0 : superhaste.get(0).getSkill().getLevel();
        if(val == 0)
        {
          if(sh_level != 0)
          {
            activeChar.doCast(SkillTable.getInstance().getInfo(7029, sh_level), activeChar, true);
          } //снимаем еффект
          activeChar.unsetVar("gm_gmspeed");
        }
        else if(val >= 1 && val <= 4)
        {
          if(Config.SAVE_GM_EFFECTS)
          {
            activeChar.setVar("gm_gmspeed", String.valueOf(val));
          }
          if(val != sh_level)
          {
            if(sh_level != 0)
            {
              activeChar.doCast(SkillTable.getInstance().getInfo(7029, sh_level), activeChar, true);
            } //снимаем еффект
            activeChar.doCast(SkillTable.getInstance().getInfo(7029, val), activeChar, true);
          }
        }
        else
        {
          activeChar.sendMessage("USAGE: //gmspeed value=[0..4]");
        }
        break;
      case admin_invul:
        handleInvul(activeChar, activeChar);
        if(activeChar.isInvul())
        {
          if(Config.SAVE_GM_EFFECTS)
          {
            activeChar.setVar("gm_invul", "true");
          }
        }
        else
        {
          activeChar.unsetVar("gm_invul");
        }
        break;
    }
    if(!activeChar.isGM())
    {
      return false;
    }
    switch(command)
    {
      case admin_offline_vis:
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player != null && player.isInOfflineMode())
          {
            player.setInvisible(false);
            player.decayMe();
            player.spawnMe();
          }
        }
        break;
      case admin_offline_invis:
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player != null && player.isInOfflineMode())
          {
            player.setInvisible(true);
            player.decayMe();
          }
        }
        break;
      case admin_earthquake:
        try
        {
          int intensity = Integer.parseInt(wordList[1]);
          int duration = Integer.parseInt(wordList[2]);
          activeChar.broadcastPacket(new Earthquake(activeChar.getLoc(), intensity, duration));
        }
        catch(Exception e)
        {
          activeChar.sendMessage("USAGE: //earthquake intensity duration");
          return false;
        }
        break;
      case admin_unpara_all:
        for(L2Player player : L2World.getAroundPlayers(activeChar, 1250, 200))
        {
          player.stopAbnormalEffect(AbnormalEffect.HOLD_1);
          player.stopAbnormalEffect(AbnormalEffect.HOLD_2);
          player.setParalyzed(false);
        }
        break;
      case admin_para_all:
        ae = wordList.length > 1 && wordList[1].equalsIgnoreCase("2") ? AbnormalEffect.HOLD_2 : AbnormalEffect.HOLD_1;
        for(L2Player player : L2World.getAroundPlayers(activeChar, 1250, 200))
        {
          if(player != null && !player.isGM())
          {
            player.startAbnormalEffect(ae);
            player.setParalyzed(true);
          }
        }
        break;
      case admin_unpara:
        if(target == null || !target.isCharacter())
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        ((L2Character) target).stopAbnormalEffect(AbnormalEffect.HOLD_1);
        ((L2Character) target).stopAbnormalEffect(AbnormalEffect.HOLD_2);
        ((L2Character) target).setParalyzed(false);
        break;
      case admin_para:
        ae = wordList.length > 1 && wordList[1].equalsIgnoreCase("2") ? AbnormalEffect.HOLD_2 : AbnormalEffect.HOLD_1;
        if(target == null || !target.isCharacter())
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        ((L2Character) target).startAbnormalEffect(ae);
        ((L2Character) target).setParalyzed(true);
        break;
      case admin_changename:
        if(wordList.length < 2)
        {
          activeChar.sendMessage("USAGE: //changename newName");
          return false;
        }
        if(target == null)
        {
          target = activeChar;
        }
        if(!target.isCharacter())
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        String oldName = ((L2Character) target).getName();
        String newName = Util.joinStrings(" ", wordList, 1);
        ((L2Character) target).setName(newName);
        if(target.isPlayer())
        {
          ((L2Character) target).broadcastUserInfo(true);
        }
        else if(target.isNpc())
        {
          ((L2Character) target).broadcastPacket(new NpcInfo((L2NpcInstance) target, null));
        }
        activeChar.sendMessage("Changed name from " + oldName + " to " + newName + ".");
        break;
      case admin_setinvul:
        if(target == null || !target.isPlayer())
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        handleInvul(activeChar, (L2Player) target);
        break;
      case admin_getinvul:
        if(target != null && target.isCharacter())
        {
          activeChar.sendMessage("Target " + target.getName() + "(object ID: " + target.getObjectId() + ") is " + (!((L2Character) target).isInvul() ? "NOT " : "") + "invul");
        }
        break;
      case admin_social:
        if(wordList.length < 2)
        {
          val = Rnd.get(1, 7);
        }
        else
        {
          try
          {
            val = Integer.parseInt(wordList[1]);
          }
          catch(NumberFormatException nfe)
          {
            activeChar.sendMessage("USAGE: //social value");
            return false;
          }
        }
        if(target == null || target == activeChar)
        {
          activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), val));
        }
        else if(target.isCharacter())
        {
          ((L2Character) target).broadcastPacket(new SocialAction(target.getObjectId(), val));
        }
        break;
      case admin_abnormal:
        try
        {
          if(wordList.length > 1)
          {
            ae = AbnormalEffect.getByName(wordList[1]);
          }
        }
        catch(Exception e)
        {
          activeChar.sendMessage("USAGE: //abnormal name");
          activeChar.sendMessage("//abnormal - Clears all abnormal effects");
          return false;
        }
        L2Character effectTarget = target == null ? activeChar : (L2Character) target;
        if(ae == AbnormalEffect.NULL)
        {
          effectTarget.startAbnormalEffect(AbnormalEffect.NULL);
          effectTarget.sendMessage("Abnormal effects clearned by admin.");
          if(effectTarget != activeChar)
          {
            effectTarget.sendMessage("Abnormal effects clearned.");
          }
        }
        else
        {
          effectTarget.startAbnormalEffect(ae);
          effectTarget.sendMessage("Admin added abnormal effect: " + ae.getName());
          if(effectTarget != activeChar)
          {
            effectTarget.sendMessage("Aadded abnormal effect: " + ae.getName());
          }
        }
        break;
      case admin_transform:
        try
View Full Code Here

Examples of lineage2.gameserver.skills.AbnormalEffect

    if (!activeChar.getPlayerAccess().GodMode)
    {
      return false;
    }
    int val;
    AbnormalEffect ae = AbnormalEffect.NULL;
    String Skill = new String();
    GameObject target = activeChar.getTarget();
    switch (command)
    {
      case admin_invis:
      case admin_vis:
        if (activeChar.isInvisible())
        {
          activeChar.setInvisibleType(InvisibleType.NONE);
          activeChar.broadcastCharInfo();
          for (Summon summon : activeChar.getSummonList())
          {
            summon.broadcastCharInfo();
          }
        }
        else
        {
          activeChar.setInvisibleType(InvisibleType.NORMAL);
          activeChar.sendUserInfo();
          World.removeObjectFromPlayers(activeChar);
        }
        break;
      case admin_gmspeed:
        if (wordList.length < 2)
        {
          val = 0;
        }
        else
        {
          try
          {
            val = Integer.parseInt(wordList[1]);
          }
          catch (Exception e)
          {
            activeChar.sendMessage("USAGE: //gmspeed value=[0..4]");
            return false;
          }
        }
        List<Effect> superhaste = activeChar.getEffectList().getEffectsBySkillId(7029);
        int sh_level = superhaste == null ? 0 : superhaste.isEmpty() ? 0 : superhaste.get(0).getSkill().getLevel();
        if (val == 0)
        {
          if (sh_level != 0)
          {
            activeChar.doCast(SkillTable.getInstance().getInfo(7029, sh_level), activeChar, true);
          }
          activeChar.unsetVar("gm_gmspeed");
        }
        else if ((val >= 1) && (val <= 4))
        {
          if (Config.SAVE_GM_EFFECTS)
          {
            activeChar.setVar("gm_gmspeed", String.valueOf(val), -1);
          }
          if (val != sh_level)
          {
            if (sh_level != 0)
            {
              activeChar.doCast(SkillTable.getInstance().getInfo(7029, sh_level), activeChar, true);
            }
            activeChar.doCast(SkillTable.getInstance().getInfo(7029, val), activeChar, true);
          }
        }
        else
        {
          activeChar.sendMessage("USAGE: //gmspeed value=[0..4]");
        }
        break;
      case admin_invul:
        handleInvul(activeChar, activeChar);
        if (activeChar.isInvul())
        {
          if (Config.SAVE_GM_EFFECTS)
          {
            activeChar.setVar("gm_invul", "true", -1);
          }
        }
        else
        {
          activeChar.unsetVar("gm_invul");
        }
        break;
      default:
        break;
    }
    if (!activeChar.isGM())
    {
      return false;
    }
    switch (command)
    {
      case admin_offline_vis:
        for (Player player : GameObjectsStorage.getAllPlayers())
        {
          if ((player != null) && player.isInOfflineMode())
          {
            player.setInvisibleType(InvisibleType.NONE);
            player.decayMe();
            player.spawnMe();
          }
        }
        break;
      case admin_offline_invis:
        for (Player player : GameObjectsStorage.getAllPlayers())
        {
          if ((player != null) && player.isInOfflineMode())
          {
            player.setInvisibleType(InvisibleType.NORMAL);
            player.decayMe();
          }
        }
        break;
      case admin_earthquake:
        try
        {
          int intensity = Integer.parseInt(wordList[1]);
          int duration = Integer.parseInt(wordList[2]);
          activeChar.broadcastPacket(new Earthquake(activeChar.getLoc(), intensity, duration));
        }
        catch (Exception e)
        {
          activeChar.sendMessage("USAGE: //earthquake intensity duration");
          return false;
        }
        break;
      case admin_block:
        if ((target == null) || !target.isCreature())
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        if (((Creature) target).isBlocked())
        {
          return false;
        }
        ((Creature) target).abortAttack(true, false);
        ((Creature) target).abortCast(true, false);
        ((Creature) target).block();
        activeChar.sendMessage("Target blocked.");
        break;
      case admin_unblock:
        if ((target == null) || !target.isCreature())
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        if (!((Creature) target).isBlocked())
        {
          return false;
        }
        ((Creature) target).unblock();
        activeChar.sendMessage("Target unblocked.");
        break;
      case admin_changename:
        if (wordList.length < 2)
        {
          activeChar.sendMessage("USAGE: //changename newName");
          return false;
        }
        if (target == null)
        {
          target = activeChar;
        }
        if (!target.isCreature())
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        String oldName = ((Creature) target).getName();
        String newName = Util.joinStrings(" ", wordList, 1);
        ((Creature) target).setName(newName);
        ((Creature) target).broadcastCharInfo();
        activeChar.sendMessage("Changed name from " + oldName + " to " + newName + ".");
        break;
      case admin_setinvul:
        if ((target == null) || !target.isPlayer())
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        handleInvul(activeChar, (Player) target);
        break;
      case admin_getinvul:
        if ((target != null) && target.isCreature())
        {
          activeChar.sendMessage("Target " + target.getName() + "(object ID: " + target.getObjectId() + ") is " + (!((Creature) target).isInvul() ? "NOT " : "") + "invul");
        }
        break;
      case admin_social:
        if (wordList.length < 2)
        {
          val = Rnd.get(1, 7);
        }
        else
        {
          try
          {
            val = Integer.parseInt(wordList[1]);
          }
          catch (NumberFormatException nfe)
          {
            activeChar.sendMessage("USAGE: //social value");
            return false;
          }
        }
        if ((target == null) || (target == activeChar))
        {
          activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), val));
        }
        else if (target.isCreature())
        {
          ((Creature) target).broadcastPacket(new SocialAction(target.getObjectId(), val));
        }
        break;
      case admin_abnormal:
        try
        {
          if (wordList.length > 1)
          {
            ae = AbnormalEffect.getByName(wordList[1]);
          }
        }
        catch (Exception e)
        {
          activeChar.sendMessage("USAGE: //abnormal name");
          activeChar.sendMessage("//abnormal - Clears all abnormal effects");
          return false;
        }
        Creature effectTarget = target == null ? activeChar : (Creature) target;
        if (ae == AbnormalEffect.NULL)
        {
          effectTarget.startAbnormalEffect(AbnormalEffect.NULL);
          effectTarget.sendMessage("Abnormal effects clearned by admin.");
          if (effectTarget != activeChar)
          {
            effectTarget.sendMessage("Abnormal effects clearned.");
          }
        }
        else
        {
          effectTarget.startAbnormalEffect(ae);
          effectTarget.sendMessage("Admin added abnormal effect: " + ae.getName());
          if (effectTarget != activeChar)
          {
            effectTarget.sendMessage("Added abnormal effect: " + ae.getName());
          }
        }
        break;
      case admin_effect:
        try
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.