Package lineage2.gameserver.model

Examples of lineage2.gameserver.model.Summon


   * @param checkRange boolean
   */
  @Override
  protected void thinkAttack(boolean checkRange)
  {
    Summon actor = getActor();
    if (actor.isDepressed())
    {
      setAttackTarget(actor.getPlayer());
    }
    super.thinkAttack(checkRange);
  }
View Full Code Here


   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    Summon actor = getActor();
    if ((attacker != null) && actor.getPlayer().isDead() && !actor.isDepressed())
    {
      Attack(attacker, false, false);
    }
    if (actor.getPlayer().isDebug())
      actor.getPlayer().sendMessage("SummonAI onEvtAttacked isDefendMode:" + actor.isDefendMode() + " isDepressed:" + actor.isDepressed() + " " + attacker.getName());
    if ((attacker != null) && actor.isDefendMode() && !actor.isDepressed())
    {
      Attack(attacker, false, false);
    }
    super.onEvtAttacked(attacker, damage);
  }
View Full Code Here

    return null;
  }
 
  private static boolean HatchlingSummoned(QuestState st, boolean CheckObjID)
  {
    Summon _pet = st.getPlayer().getSummonList().getPet();
    if (_pet == null)
    {
      return false;
    }
    if (CheckObjID)
    {
      int dragonflute_id = st.getInt("dragonflute");
      if (dragonflute_id == 0)
      {
        return false;
      }
      if (_pet.getControlItemObjId() != dragonflute_id)
      {
        return false;
      }
    }
    ItemInstance dragonflute = GetDragonflute(st);
    if (dragonflute == null)
    {
      return false;
    }
    if (PetDataTable.getControlItemId(_pet.getNpcId()) != dragonflute.getItemId())
    {
      return false;
    }
    return true;
  }
View Full Code Here

    {
      if (_summonList.size() >= 4)
      {
        return false;
      }
      Summon summon = getFirstServitor();
      if (summon != null)
      {
        Skill skill = SkillTable.getInstance().getInfo(summon.getSummonSkillId(), summon.getSummonSkillLvl());
        if (skill != null)
        {
          return (skill instanceof SummonServitor) && (((SummonServitor) skill).getSummonType() == SummonType.MULTI_SERVITOR);
        }
      }
View Full Code Here

   */
  public Summon getFirstServitor()
  {
    if (_summonList.size() == 1)
    {
      Summon summon = _summonList.values().iterator().next();
      Skill skill = SkillTable.getInstance().getInfo(summon.getSummonSkillId(), summon.getSummonSkillLvl());
      if ((skill == null) || (skill.getSkillType() != Skill.SkillType.SUMMON) || (((SummonServitor) skill).getSummonType() == SummonType.MULTI_SERVITOR))
      {
        return null;
      }
      return summon;
View Full Code Here

   */
  public Summon getSecondServitor()
  {
    if (_summonList.size() == 2)
    {
      Summon summon = _summonList.values().iterator().next();
      Skill skill = SkillTable.getInstance().getInfo(summon.getSummonSkillId(), summon.getSummonSkillLvl());
      if ((skill == null) || (skill.getSkillType() != Skill.SkillType.SUMMON))
      {
        return null;
      }
      return summon;
View Full Code Here

  public void onStart()
  {
    super.onStart();
    if ((_effected != null) && _effected.isServitor())
    {
      Summon summon = (Summon) _effected;
      summon.setDepressed(true);
      summon.getAI().Attack(summon.getPlayer(), true, false);
    }
  }
View Full Code Here

  public void onExit()
  {
    super.onExit();
    if ((_effected != null) && _effected.isServitor())
    {
      Summon summon = (Summon) _effected;
      summon.setDepressed(false);
      summon.getAI().setIntention(AI_INTENTION_ACTIVE);
    }
  }
View Full Code Here

    if (!Config.SERVICES_CHANGE_PET_NAME_ENABLED)
    {
      show("Серви�? откл�?чен.", player);
      return;
    }
    Summon pl_pet = player.getSummonList().getPet();
    if ((pl_pet == null) || !pl_pet.isPet())
    {
      show("�?итомец должен быт�? вызван.", player);
      return;
    }
    if (player.getInventory().destroyItemByItemId(Config.SERVICES_CHANGE_PET_NAME_ITEM, Config.SERVICES_CHANGE_PET_NAME_PRICE))
    {
      pl_pet.setName(pl_pet.getTemplate().name);
      pl_pet.broadcastCharInfo();
      PetInstance _pet = (PetInstance) pl_pet;
      ItemInstance control = _pet.getControlItem();
      if (control != null)
      {
        control.setCustomType2(1);
View Full Code Here

    if (!Config.SERVICES_EXCHANGE_BABY_PET_ENABLED)
    {
      show("Серви�? откл�?чен.", player);
      return;
    }
    Summon pl_pet = player.getSummonList().getPet();
    if ((pl_pet == null) || pl_pet.isDead() || !((pl_pet.getNpcId() == PetDataTable.IMPROVED_BABY_BUFFALO_ID) || (pl_pet.getNpcId() == PetDataTable.IMPROVED_BABY_KOOKABURRA_ID)))
    {
      show("�?ет должен быт�? вызван.", player);
      return;
    }
    if (player.getInventory().destroyItemByItemId(Config.SERVICES_EXCHANGE_BABY_PET_ITEM, Config.SERVICES_EXCHANGE_BABY_PET_PRICE))
    {
      ItemInstance control = player.getInventory().getItemByObjectId(pl_pet.getControlItemObjId());
      control.setItemId(L2Pet.IMPROVED_BABY_COUGAR.getControlItemId());
      control.setJdbcState(JdbcEntityState.UPDATED);
      control.update();
      player.sendPacket(new InventoryUpdate().addModifiedItem(control));
      player.getSummonList().unsummonPet(false);
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.Summon

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.