Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Multi-pets based Lithium

Newbie Spellweaver
Joined
Mar 7, 2011
Messages
62
Reaction score
0
Which part needs changing to other my 2 pets to be equipped? Was it here?

Code:
public void spawnPet(byte slot, boolean lead, boolean broadcast) {
    Item item = getInventory(MapleInventoryType.CASH).getItem((short)slot);
    if ((item == null) || (item.getItemId() > 5000200) || (item.getItemId() < 5000000)) {
      return;
    }
    switch (item.getItemId()) {
    case 5000028:
    case 5000047:{
      MaplePet pet = MaplePet.createPet(item.getItemId() + 1, MapleInventoryIdentifier.getInstance());
      if (pet != null) {
        MapleInventoryManipulator.addById(this.client, item.getItemId() + 1, (short)1, item.getOwner(), pet, 45L, new StringBuilder().append("Evolved from pet ").append(item.getItemId()).append(" on ").append(FileoutputUtil.CurrentReadable_Date()).toString());
        MapleInventoryManipulator.removeFromSlot(this.client, MapleInventoryType.CASH, (short)slot, (short)1, false); } break;}
    default:
      MaplePet pet = item.getPet();
      if ((pet != null) && ((item.getItemId() != 5000054) || (pet.getSecondsLeft() > 0)) && ((item.getExpiration() == -1L) || (item.getExpiration() > System.currentTimeMillis())))
        if (pet.getSummoned()) {
          unequipPet(pet, true, false);
        } else {
          int leadid = 8;
          if (GameConstants.isKOC(getJob()))
            leadid = 10000018;
          else if (GameConstants.isAran(getJob()))
            leadid = 20000024;
          else if (GameConstants.isEvan(getJob()))
            leadid = 20011024;
          else if (GameConstants.isMercedes(getJob()))
            leadid = 20021024;
          else if (GameConstants.isPhantom(getJob()))
            leadid = 20031024;
          else if (GameConstants.isDemon(getJob()))
            leadid = 30011024;
          else if (GameConstants.isResist(getJob())) {
            leadid = 30001024;
          }

          if ((getSkillLevel(SkillFactory.getSkill(leadid)) == 0) && (getPet(0) != null))
            unequipPet(getPet(0), false, false);
          else if ((!lead) || (getSkillLevel(SkillFactory.getSkill(leadid)) <= 0));
          Point pos = getPosition();
          pet.setPos(pos);
          try {
            pet.setFh(getMap().getFootholds().findBelow(pos).getId());
          } catch (NullPointerException e) {
            pet.setFh(0);
          }
          pet.setStance(0);
          pet.setSummoned(1);
          addPet(pet);
          pet.setSummoned(getPetIndex(pet) + 1);
          if ((broadcast) && (getMap() != null)) { getMap().broadcastMessage(this, PetPacket.showPet(this, pet, false, false), true);
            this.client.getSession().write(PetPacket.showPetUpdate(this, pet.getUniqueId(), (byte)(pet.getSummonedValue() - 1)));
            if (!GameConstants.GMS);
          }
        }
      break;
    }

    this.client.getSession().write(CWvsContext.enableActions());
  }
 
Back
Top