コード例 #1
0
 @Override
 protected void handleDialogStart(Player player) {
   checkDialog(player);
   if (player.getLegion() != null) {
     int SiegeId = ((SiegeNpc) this.getOwner()).getSiegeId();
     SiegeLocation Location = SiegeService.getInstance().getSiegeLocation(SiegeId);
     if (Location != null) {
       if (Location.getLegionId() == player.getLegion().getLegionId()) {
         PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(getOwner().getObjectId(), 10));
         return;
       }
     }
   }
   PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(getOwner().getObjectId(), 1011));
 }
コード例 #2
0
  @Override
  protected void runImpl() {
    Player activePlayer = getConnection().getActivePlayer();

    if (activePlayer.getHouseRegistry() != null) sendPacket(new SM_HOUSE_OBJECTS(activePlayer));
    if (activePlayer.isInInstance()) {
      sendPacket(
          new SM_INSTANCE_COUNT_INFO(activePlayer.getWorldId(), activePlayer.getInstanceId()));
    }
    if (activePlayer.getItemEffectId() <= 1) activePlayer.updataItemEffectId();
    sendPacket(new SM_PLAYER_INFO(activePlayer, false));
    activePlayer.getController().startProtectionActiveTask();
    sendPacket(
        new SM_MOTION(activePlayer.getObjectId(), activePlayer.getMotions().getActiveMotions()));

    WindstreamTemplate template =
        DataManager.WINDSTREAM_DATA.getStreamTemplate(activePlayer.getPosition().getMapId());
    Location2D location;
    if (template != null)
      for (int i = 0; i < template.getLocations().getLocation().size(); i++) {
        location = template.getLocations().getLocation().get(i);
        sendPacket(
            new SM_WINDSTREAM_ANNOUNCE(
                location.getFlyPathType().getId(),
                template.getMapid(),
                location.getId(),
                location.getState()));
      }
    location = null;
    template = null;

    /** Spawn player into the world. */
    // If already spawned, despawn before spawning into the world
    if (activePlayer.isSpawned()) World.getInstance().despawn(activePlayer);
    World.getInstance().spawn(activePlayer);

    activePlayer.getController().refreshZoneImpl();

    // because fortress buff should only be avaible in fortress 5011-6011-6021
    SiegeService.getInstance().fortressBuffRemove(activePlayer);

    // SM_SHIELD_EFFECT, SM_ABYSS_ARTIFACT_INFO3
    if (activePlayer.isInSiegeWorld()) {
      SiegeService.getInstance().onEnterSiegeWorld(activePlayer);
    }

    // SM_NPC_INFO
    BaseService.getInstance().onEnterBaseWorld(activePlayer);

    // SM_SERIAL_KILLER
    SerialKillerService.getInstance().onEnterMap(activePlayer);

    // SM_RIFT_ANNOUNCE
    // RiftInformer.sendRiftsInfo(activePlayer);
    InstanceRiftSpawnManager.sendInstanceRiftStatus(activePlayer);

    // SM_UPGRADE_ARCADE
    // sendPacket(new SM_UPGRADE_ARCADE(true));

    // SM_NEARBY_QUESTS
    activePlayer.getController().updateNearbyQuests();

    /** Loading weather for the player's region */
    WeatherService.getInstance().loadWeather(activePlayer);

    QuestEngine.getInstance().onEnterWorld(new QuestEnv(null, activePlayer, 0, 0));

    activePlayer.getController().onEnterWorld();

    // zone channel message (is this must be here?)
    if (!WorldMapType.getWorld(activePlayer.getWorldId()).isPersonal())
      sendPacket(new SM_SYSTEM_MESSAGE(1390122, activePlayer.getPosition().getInstanceId()));

    activePlayer.getEffectController().updatePlayerEffectIcons();
    sendPacket(SM_CUBE_UPDATE.cubeSize(StorageType.CUBE, activePlayer));

    Pet pet = activePlayer.getPet();
    if (pet != null && !pet.isSpawned()) World.getInstance().spawn(pet);
    activePlayer.setPortAnimation(0);

    TownService.getInstance().onEnterWorld(activePlayer);
  }