Package l2p.gameserver.model.entity.siege

Examples of l2p.gameserver.model.entity.siege.SiegeClan


    if(siege == null)
    {
      activeChar.sendMessage("You must be an attacker to place a flag.");
      return;
    }
    SiegeClan siegeClan = siege.getAttackerClan(clan);
    if(siegeClan == null)
    {
      activeChar.sendMessage("You must be an attacker to place a flag.");
      return;
    }
    if(siegeClan.getHeadquarter() != null)
    {
      activeChar.sendMessage("You already has a flag.");
      return;
    }
    L2SiegeHeadquarterInstance flag = new L2SiegeHeadquarterInstance(player, IdFactory.getInstance().getNextId(), NpcTable.getTemplate(35062));
    if(_advanced)
    {
      flag.addStatFunc(new FuncMul(Stats.MAX_HP, 0x50, flag, _advancedMult));
    }
    flag.setCurrentHpMp(flag.getMaxHp(), flag.getMaxMp(), true);
    flag.setHeading(player.getHeading());
    // Ставим флаг перед чаром
    int x = (int) (player.getX() + 100 * Math.cos(player.headingToRadians(player.getHeading() - 32768)));
    int y = (int) (player.getY() + 100 * Math.sin(player.headingToRadians(player.getHeading() - 32768)));
    flag.spawnMe(GeoEngine.moveCheck(player.getX(), player.getY(), player.getZ(), x, y, player.getReflection().getGeoIndex()));
    siegeClan.setHeadquarter(flag);
  }
View Full Code Here


      {
        activeChar.sendPacket(Msg.IT_IS_IMPOSSIBLE_TO_BE_RESSURECTED_IN_BATTLEFIELDS_WHERE_SIEGE_WARS_ARE_IN_PROCESS);
        return false;
      }
      L2Clan clan = pcTarget.getClan();
      SiegeClan siegeClan = TerritorySiege.getSiegeClan(clan);
      if(siegeClan == null || siegeClan.getHeadquarter() == null) // Возможно, стоит разрешить воскрешаться одиночкам
      {
        activeChar.sendPacket(Msg.IF_A_BASE_CAMP_DOES_NOT_EXIST_RESURRECTION_IS_NOT_POSSIBLE);
        return false;
      }
    }
    Siege siege = SiegeManager.getSiege(target, true);
    if(siege != null)
    {
      L2Clan clan = pcTarget.getClan();
      if(clan == null || clan.getSiege() == null || clan.getSiege() != siege) // Не зарегистрирован на осаду
      {
        activeChar.sendPacket(Msg.IT_IS_IMPOSSIBLE_TO_BE_RESSURECTED_IN_BATTLEFIELDS_WHERE_SIEGE_WARS_ARE_IN_PROCESS);
        return false;
      }
      // Атакующая сторона, проверка на наличие флага
      SiegeClan attackClan = siege.getAttackerClan(clan);
      if(attackClan != null && attackClan.getHeadquarter() == null)
      {
        activeChar.sendPacket(Msg.IF_A_BASE_CAMP_DOES_NOT_EXIST_RESURRECTION_IS_NOT_POSSIBLE);
        return false;
      }
      // Защищающая сторона, проверка на наличие кристалов в замке
View Full Code Here

        {
          activeChar.sendMessage("Ваш клан уже зарегистрированы на на другую территорию.");
          return;
        }
        // Зарегистрироваться
        TerritorySiege.getClans().putIfAbsent(new SiegeClan(clan.getClanId(), null), _terrId);
        TerritorySiegeDatabase.saveSiegeMember(clan.getClanId(), _terrId, 1);
      }
      else
      {
        // Отказаться
        SiegeClan siegeClan = TerritorySiege.getSiegeClan(clan);
        if(siegeClan != null)
        {
          TerritorySiege.getClans().remove(siegeClan);
          TerritorySiegeDatabase.saveSiegeMember(siegeClan.getClanId(), _terrId, 1);
        }
      }
    }
    activeChar.sendPacket(new ExShowDominionRegistry(activeChar, _terrId));
  }
View Full Code Here

          {
            activeChar.restoreExp(fort.getFunction(ResidenceFunction.RESTORE_EXP).getLevel());
          }
          break;
        case TO_SIEGEHQ:
          SiegeClan siegeClan = null;
          if(siege != null)
          {
            siegeClan = siege.getAttackerClan(clan);
          }
          else if(TerritorySiege.checkIfInZone(activeChar))
          {
            siegeClan = TerritorySiege.getSiegeClan(clan);
          }
          if(siegeClan == null || siegeClan.getHeadquarter() == null)
          {
            sendPacket(Msg.IF_A_BASE_CAMP_DOES_NOT_EXIST_RESURRECTION_IS_NOT_POSSIBLE, new Die(activeChar));
            return;
          }
          loc = MapRegion.getTeleToHeadquarter(activeChar);
View Full Code Here

    {
      _sweepable = ((L2MonsterInstance) cha).isSweepActive();
    }
    if(_clan != null)
    {
      SiegeClan siegeClan = null;
      Siege siege = SiegeManager.getSiege(_cha, true);
      if(siege != null)
      {
        siegeClan = siege.getAttackerClan(_clan);
      }
      if(TerritorySiege.checkIfInZone(_cha))
      {
        siegeClan = TerritorySiege.getSiegeClan(_clan);
      }
      to_hideaway = _clan.getHasHideout() > 0 ? 0x01 : 0x00;
      to_castle = _clan.getHasCastle() > 0 ? 0x01 : 0x00;
      to_siege_HQ = siegeClan != null && siegeClan.getHeadquarter() != null ? 0x01 : 0x00;
      to_fortress = _clan.getHasFortress() > 0 ? 0x01 : 0x00;
    }
    else
    {
      to_hideaway = 0;
View Full Code Here

    if(_owner == null)
    {
      deleteMe();
      return;
    }
    SiegeClan sc = null;
    _siege = SiegeManager.getSiege(_player, true);
    if(_siege != null)
    {
      sc = _siege.getAttackerClan(_owner);
    }
    else if(_player.getTerritorySiege() > -1)
    {
      sc = TerritorySiege.getSiegeClan(_owner);
    }
    if(sc == null)
    {
      deleteMe();
      return;
    }
    sc.setHeadquarter(this);
  }
View Full Code Here

  @Override
  public void doDie(L2Character killer)
  {
    if(_siege != null)
    {
      SiegeClan sc = _siege.getAttackerClan(_player.getClan());
      if(sc != null)
      {
        sc.removeHeadquarter();
      }
    }
    super.doDie(killer);
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.entity.siege.SiegeClan

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.