Package lineage2.gameserver.model.entity.residence

Examples of lineage2.gameserver.model.entity.residence.ClanHall


  {
    String htmlText = "noquest";
    int cond = st.getCond();
    Player player = st.getPlayer();
    Clan clan = player.getClan();
    ClanHall clanhall = ResidenceHolder.getInstance().getResidence(63);
    if (clanhall.getSiegeEvent().isRegistrationOver())
    {
      htmlText = null;
      showHtmlFile(player, "farm_messenger_q0655_02.htm", false, "%siege_time%", TimeUtils.toSimpleFormat(clanhall.getSiegeDate()));
    }
    else if ((clan == null) || (player.getObjectId() != clan.getLeaderId()))
    {
      htmlText = "farm_messenger_q0655_03.htm";
    }
    else if ((player.getObjectId() == clan.getLeaderId()) && (clan.getLevel() < 4))
    {
      htmlText = "farm_messenger_q0655_05.htm";
    }
    else if (clanhall.getSiegeEvent().getSiegeClan(SiegeEvent.ATTACKERS, player.getClan()) != null)
    {
      htmlText = "farm_messenger_q0655_07.htm";
    }
    else if (clan.getHasHideout() > 0)
    {
View Full Code Here


    Commands command = (Commands) comm;
    if (!activeChar.getPlayerAccess().CanEditNPC)
    {
      return false;
    }
    ClanHall clanhall = null;
    if (wordList.length > 1)
    {
      clanhall = ResidenceHolder.getInstance().getResidence(ClanHall.class, Integer.parseInt(wordList[1]));
    }
    if (clanhall == null)
    {
      showClanHallSelectPage(activeChar);
      return true;
    }
    switch (command)
    {
      case admin_clanhall:
        showClanHallSelectPage(activeChar);
        break;
      case admin_clanhallset:
        GameObject target = activeChar.getTarget();
        Player player = activeChar;
        if ((target != null) && target.isPlayer())
        {
          player = (Player) target;
        }
        if (player.getClan() == null)
        {
          activeChar.sendPacket(SystemMsg.THAT_IS_AN_INCORRECT_TARGET);
        }
        else
        {
          clanhall.changeOwner(player.getClan());
        }
        break;
      case admin_clanhalldel:
        clanhall.changeOwner(null);
        break;
      case admin_clanhallteleportself:
        Zone zone = clanhall.getZone();
        if (zone != null)
        {
          activeChar.teleToLocation(zone.getSpawn());
        }
        break;
View Full Code Here

   * Method enter_dc.
   */
  public void enter_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
View Full Code Here

   * Method exit_dc.
   */
  public void exit_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
View Full Code Here

   * @return boolean
   */
  @Override
  protected boolean thinkActive()
  {
    final NpcInstance actor = getActor();
    if (actor == null)
    {
      return true;
    }
    for (Player player : World.getAroundPlayers(actor, 200, 200))
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if (_firstTimeAttacked)
    {
      _firstTimeAttacked = false;
      if (Rnd.chance(25))
      {
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if ((attacker == null) || (attacker.getPlayer() == null))
    {
      return;
    }
    if ((System.currentTimeMillis() - _lastAction) > 15000)
    {
      _lastAction = System.currentTimeMillis();
      Functions.npcSayCustomMessage(actor, "scripts.ai.FieldMachine." + actor.getNpcId());
      final List<NpcInstance> around = actor.getAroundNpc(1500, 300);
      if ((around != null) && !around.isEmpty())
      {
        for (NpcInstance npc : around)
        {
          if (npc.isMonster() && (npc.getNpcId() >= 22656) && (npc.getNpcId() <= 22659))
View Full Code Here

   * @return boolean
   */
  @Override
  protected boolean thinkActive()
  {
    final NpcInstance actor = getActor();
    if (actor.isDead())
    {
      return true;
    }
    if (_def_think)
    {
View Full Code Here

  {
    BaiumManager.setLastAttackTime();
    if (_firstTimeAttacked)
    {
      _firstTimeAttacked = false;
      final NpcInstance actor = getActor();
      if (attacker == null)
      {
        return;
      }
      if (attacker.isPlayer())
View Full Code Here

   * @return boolean
   */
  @Override
  protected boolean createNewTask()
  {
    final NpcInstance actor = getActor();
    if (actor == null)
    {
      return true;
    }
    if (!BaiumManager.getZone().checkIfInZone(actor))
    {
      teleportHome();
      return false;
    }
    clearTasks();
    Creature target = prepareTarget();
    if (target == null)
    {
      return false;
    }
    if (!BaiumManager.getZone().checkIfInZone(target))
    {
      actor.getAggroList().remove(target, false);
      return false;
    }
    final int s_energy_wave = 20;
    final int s_earth_quake = 20;
    final int s_group_hold = (actor.getCurrentHpPercents() > 50) ? 0 : 20;
    final int s_thunderbolt = (actor.getCurrentHpPercents() > 25) ? 0 : 20;
    Skill r_skill = null;
    if (actor.isMovementDisabled())
    {
      r_skill = thunderbolt;
    }
    else if (!Rnd.chance(100 - s_thunderbolt - s_group_hold - s_energy_wave - s_earth_quake))
    {
      final Map<Skill, Integer> d_skill = new HashMap<>();
      final double distance = actor.getDistance(target);
      addDesiredSkill(d_skill, target, distance, energy_wave);
      addDesiredSkill(d_skill, target, distance, earth_quake);
      if (s_group_hold > 0)
      {
        addDesiredSkill(d_skill, target, distance, group_hold);
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.entity.residence.ClanHall

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.