Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Summon


    return null;
  }

  private static boolean HatchlingSummoned(QuestState st, boolean CheckObjID)
  {
    L2Summon _pet = st.getPlayer().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;
      }
    }
    L2ItemInstance dragonflute = GetDragonflute(st);
    if(dragonflute == null)
    {
      return false;
    }
    if(PetDataTable.getControlItemId(_pet.getNpcId()) != dragonflute.getItemId())
    {
      return false;
    }
    return true;
  }
View Full Code Here


        }
      }
      // Remove Summon's Buffs
      if(player.getPet() != null)
      {
        L2Summon summon = player.getPet();
        if(summon.isPet())
        {
          summon.unSummon();
        }
        else
        {
          summon.getEffectList().stopAllEffects();
        }
      }
      // unsummon agathion
      if(player.getAgathion() != null)
      {
View Full Code Here

      {
        packets.add(new PetInfo(activeChar.getPet()));
      }
      if(activeChar.isInParty())
      {
        L2Summon member_pet;
        //sends new member party window for all members
        //we do all actions before adding member to a list, this speeds things up a little
        packets.add(new PartySmallWindowAll(activeChar.getParty(), activeChar));
        for(L2Player member : activeChar.getParty().getPartyMembers())
        {
View Full Code Here

  @Override
  public void runImpl()
  {
    L2Player cha = getClient().getActiveChar();
    L2Summon pet = cha.getPet();
    if(pet != null && (pet.getName() == null || pet.getName().isEmpty() || pet.getName().equalsIgnoreCase(pet.getTemplate().name)))
    {
      if(_name.length() < 1 || _name.length() > 8)
      {
        sendPacket(Msg.YOUR_PETS_NAME_CAN_BE_UP_TO_8_CHARACTERS);
        return;
      }
      pet.setName(_name);
      pet.broadcastPetInfo();
      if(pet.isPet())
      {
        L2PetInstance _pet = (L2PetInstance) pet;
        L2ItemInstance controlItem = _pet.getControlItem();
        if(controlItem != null)
        {
View Full Code Here

    boolean isAutoSoulShot = false;
    if(player.getAutoSoulShot().contains(item.getItemId()))
    {
      isAutoSoulShot = true;
    }
    L2Summon pet = player.getPet();
    if(pet == null)
    {
      if(!isAutoSoulShot)
      {
        player.sendPacket(Msg.PETS_AND_SERVITORS_ARE_NOT_AVAILABLE_AT_THIS_TIME);
      }
      return;
    }
    if(pet.isDead())
    {
      if(!isAutoSoulShot)
      {
        player.sendPacket(Msg.WHEN_PET_OR_SERVITOR_IS_DEAD_SOULSHOTS_OR_SPIRITSHOTS_FOR_PET_OR_SERVITOR_ARE_NOT_AVAILABLE);
      }
      return;
    }
    int consumption = 0;
    int skillid = 0;
    switch(item.getItemId())
    {
      case 6645:
      case 20332:
        if(pet.getChargedSoulShot())
        {
          return;
        }
        consumption = pet.getSoulshotConsumeCount();
        if(item.getCount() < consumption)
        {
          player.sendPacket(Msg.YOU_DONT_HAVE_ENOUGH_SOULSHOTS_NEEDED_FOR_A_PET_SERVITOR);
          return;
        }
        pet.chargeSoulShot();
        skillid = 2033;
        break;
      case 6646:
      case 20333:
        if(pet.getChargedSpiritShot() > 0)
        {
          return;
        }
        consumption = pet.getSpiritshotConsumeCount();
        if(item.getCount() < consumption)
        {
          player.sendPacket(Msg.YOU_DONT_HAVE_ENOUGH_SPIRITSHOTS_NEEDED_FOR_A_PET_SERVITOR);
          return;
        }
        pet.chargeSpiritShot(L2ItemInstance.CHARGED_SPIRITSHOT);
        skillid = 2008;
        break;
      case 6647:
      case 20334:
        if(pet.getChargedSpiritShot() > 1)
        {
          return;
        }
        consumption = pet.getSpiritshotConsumeCount();
        if(item.getCount() < consumption)
        {
          player.sendPacket(Msg.YOU_DONT_HAVE_ENOUGH_SPIRITSHOTS_NEEDED_FOR_A_PET_SERVITOR);
          return;
        }
        pet.chargeSpiritShot(L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT);
        skillid = 2009;
        break;
    }
    pet.broadcastPacket(new MagicSkillUse(pet, pet, skillid, 1, 0, 0));
    player.getInventory().destroyItem(item, consumption, false);
  }
View Full Code Here

      show(Files.read("data/html/default/13184-3.htm", player), player);
      return;
    }
    player.broadcastPacket(new MagicSkillUse(player, player, 23017, 1, 0, 0));
    player.altOnMagicUseTimer(player, SkillTable.getInstance().getInfo(23017, 1));
    L2Summon pet = player.getPet();
    if(pet != null)
    {
      pet.broadcastPacket(new MagicSkillUse(pet, pet, 23017, 1, 0, 0));
      pet.altOnMagicUseTimer(pet, SkillTable.getInstance().getInfo(23017, 1));
    }
  }
View Full Code Here

  public void onStart()
  {
    super.onStart();
    if(_effected instanceof L2Summon)
    {
      L2Summon summon = (L2Summon) _effected;
      summon.setPossessed(true);
      summon.getAI().Attack(summon.getPlayer(), true, false);
    }
  }
View Full Code Here

  public void onExit()
  {
    super.onExit();
    if(_effected instanceof L2Summon)
    {
      L2Summon summon = (L2Summon) _effected;
      summon.setPossessed(false);
      summon.getAI().setIntention(AI_INTENTION_ACTIVE);
    }
  }
View Full Code Here

            return;
        }
        _showSpawnAnimation = showSpawnAnimation;
        _cha = cha;
        _attacker = attacker;
        L2Summon _summon = cha;
        _npcId = cha.getTemplate().npcId;
        _isAttackable = cha.isAutoAttackable(attacker); // (cha.getKarma() > 0);
        _rhand = 0;
        _lhand = 0;
        _enchantEffect = 0;
        if (Config.SERVER_SIDE_NPC_NAME || cha.isPet()) {
            _name = _cha.getName();
        }
        _title = cha.getTitle();
        switch (_summon.getTemplate().getNpcId()) {
        case PetDataTable.GREAT_WOLF_ID:
        case PetDataTable.WGREAT_WOLF_ID:
        case PetDataTable.FENRIR_WOLF_ID:
        case PetDataTable.WFENRIR_WOLF_ID:
            if (_summon.getLevel() >= 70) {
                type = 3;
            } else if (_summon.getLevel() >= 65) {
                type = 2;
            } else if (_summon.getLevel() >= 60) {
                type = 1;
            }
            break;
        }
        common();
View Full Code Here

    {
      return empty;
    }
    Collection<L2GameServerPacket> ret = new GArray<L2GameServerPacket>(2);
    boolean newVer = sendTo.getRevision() >= 152;
    L2Summon pet = targetChar.getPet();
    int relation = targetChar.getRelation(activeChar);
    RelationChangedData d1 = new RelationChangedData(targetChar, targetChar.isAutoAttackable(activeChar), relation);
    if(newVer)
    {
      RelationChanged pkt = new RelationChanged(d1);
      if(pet != null)
      {
        pkt.add(new RelationChangedData(pet, pet.isAutoAttackable(activeChar), relation));
      }
      ret.add(pkt);
    }
    else
    {
      ret.add(new RelationChangedOld(d1));
      if(pet != null)
      {
        ret.add(new RelationChangedOld(new RelationChangedData(pet, pet.isAutoAttackable(activeChar), relation)));
      }
    }
    return ret;
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Summon

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.